3 * html.c: HTML header/footer templating for web interface.
4 * copyright (c) 2006 Ben Stewart.
5 * copyright (c) 2010 Malte S. Stretz.
7 * You may use, modify and redistribute this file under the terms of the
8 * GNU General Public License version 2. (see COPYING.GPL)
11 #include "config.h" /* for PACKAGE_STRING, PACKAGE_URL */
14 #include "http.h" /* for base_url */
16 void html_open(struct str
*buf
, const char *title
, const char *interface
,
17 const int want_graph_js
)
23 "<title>%s (darkstat3 %s)</title>\n"
24 "<meta name=\"generator\" content=\"" PACKAGE_STRING
"\">\n"
25 "<meta name=\"robots\" content=\"noindex, noarchive\">\n"
26 "<link rel=\"stylesheet\" href=\"%sstyle.css\" type=\"text/css\">\n"
27 , title
, interface
, base_url
);
31 "<script src=\"%sgraph.js\" type=\"text/javascript\"></script>\n"
37 "<div class=\"menu\">\n"
38 "<ul class=\"menu\">" /* no whitespace (newlines) in list */
39 "<li class=\"label\">" PACKAGE_STRING
"</li>"
40 "<li><a href=\"%s\">graphs</a></li>"
41 "<li><a href=\"%shosts/\">hosts</a></li>"
42 "<li><a href=\"" PACKAGE_URL
"\">homepage</a></li>"
45 "<div class=\"content\">\n"
46 "<h2 class=\"pageheader\">%s</h2>\n"
47 , base_url
, base_url
, title
);
50 void html_close(struct str
*buf
)
58 /* vim:set ts=4 sw=4 tw=78 expandtab: */