]> Pileus Git - site/blob - theme/html.ct
Support submenus
[site] / theme / html.ct
1 <% #include "html.h" %>
2
3 <% void print_header(page_t *page) { %>
4 <% if (page->error) %><%% "Status: %s\n", page->error %>
5 Content-Type: text/html;charset=UTF-8
6
7 <% } %>
8
9 <% void print_menu_start(void) { %>
10         <div class="nav">
11 <% } %>
12
13 <% void print_menu_end(void) { %>
14         </div>
15 <% } %>
16
17 <% void print_link(char *path, char *name, int cur, int dir) { %>
18         <a href="<% href(path); %>"<%
19                 if (cur) { %> class="cur"<% }
20         %>><%= name %><%
21                 if (dir > 1) { %>/<% }
22         %></a>
23 <% } %>
24
25 <% void print_page(page_t *page, menu_t *menu) { %>
26 <?xml version="1.0" encoding="UTF-8"?>
27 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
28         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
29 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
30         <head>
31                 <title><% if (page->title) %><%% "%s - ", page->title %>pileus.org</title>
32                 <link href="<% href("theme/style.css"); %>" rel="stylesheet" type="text/css" />
33                 <meta http-equiv="X-UA-Compatible" content="IE=9" />
34                 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
35                 <% if (page->keys) { %>
36                 <meta name="keywords" content="<%= page->keys %>" />
37                 <% } %>
38                 <% if (page->desc) { %>
39                 <meta name="description" content="<%= page->desc %>" />
40                 <% } %>
41         </head>
42         <body>
43                 <div class="title">
44                         <a href="<% href(""); %>">pileus.org</a>
45                         <span><% if (page->title) %><%= page->title %></span>
46                 </div>
47                 <h1 class="nav">
48                         <% print_menu(menu, 0, 0); %>
49                         <span style="float:right;">
50                         <!--
51                         <a href="?">View</a>
52                         <a href="?src">Source</a>
53                         <a href="?hist">History</a>
54                         -->
55                         </span>
56                 </h1>
57                 <h2 class="nav">
58                         <% print_menu(menu, 1, -1); %>
59                 </h2>
60                 <div class="content">
61                         <% if (page->error) { %>
62                                 <h1><%= page->error %></h1>
63                                 <h2><%= page->html  %></h2>
64                         <% } else { %>
65                                 <%= page->html %>
66                         <% } %>
67                         <div class="bottom"></div>
68                 </div>
69                 <div class="footer">
70                         Copyright © 2013 pileus.org
71                 </div>
72         </body>
73 </html>
74 <% } %>