diff options
-rw-r--r-- | src/main.cpp | 1 | ||||
-rw-r--r-- | wwwroot/inherit/00_base.tmpl | 11 | ||||
-rw-r--r-- | wwwroot/inherit/index.html | 35 |
3 files changed, 47 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8256717..e5171ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,6 +61,7 @@ int main(int argc, char ** argv) cmgr->RegisterModule(std::make_shared<Markdown>("/", wwwroot + "/pages", "index.html")); cmgr->RegisterModule(std::make_shared<Blog>("/blog", wwwroot + "/blog", "blog/index.html")); + cmgr->RegisterModule(std::make_shared<Blog>("/inherit", wwwroot + "/blog", "inherit/index.html")); if (cmgr->InitAll() == false) { diff --git a/wwwroot/inherit/00_base.tmpl b/wwwroot/inherit/00_base.tmpl new file mode 100644 index 0000000..c1af32e --- /dev/null +++ b/wwwroot/inherit/00_base.tmpl @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> +<head> + {% block head %} + <title>{% block title %}{% endblock %} - My Webpage</title> + {% endblock %} +</head> +<body> + <div>{% block content %}{% endblock %}</div> +</body> +</html> diff --git a/wwwroot/inherit/index.html b/wwwroot/inherit/index.html new file mode 100644 index 0000000..a717e4f --- /dev/null +++ b/wwwroot/inherit/index.html @@ -0,0 +1,35 @@ +{% extends "inherit/00_base.tmpl" %} +{% block title %}Index{% endblock %} +{% block head %} + {{ super() }} + <style type="text/css"> + .important { color: #336699; } + </style> +{% endblock %} +{% block content %} + <h1>Index</h1> + <p class="important"> + Welcome to my blog! + </p> + +{% if exists("blog_listing") %} + <table> +## for entry in blog_listing + <tr> + <td>{{ loop.index1 }}</td> + <td>{{ entry.filename }}</td> + <td>{{ entry.title }}</td> + <td>{{ entry.tags }}</td> + <td>{{ entry.author }}</td> + <td>{{ entry.createDate }}</td> + <td>{{ entry.publishDate }}</td> + <td>{{ entry.published }}</td> + <td> + {{ indent(entry.content, 12, false, false) }} + </td> + <td>{% if loop.is_last == false %}more{% else %}eof{% endif %}<br> + </tr> +## endfor + </table> +{% endif %} +{% endblock %} |