diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-10-23 01:32:04 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-11-13 18:23:53 +0100 |
commit | 7985947c4b5624c2211d2851fa69eefba5daf178 (patch) | |
tree | 628582acb41749eac9b61848df3036e770b2d788 | |
parent | c2ef613b99d01e742127d894756e49f42b1f264d (diff) |
Initial blog.impl.ccblog.impl.cc
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | wwwroot/00_header.tmpl | 47 | ||||
-rw-r--r-- | wwwroot/01_footer.tmpl | 18 | ||||
-rw-r--r-- | wwwroot/blog/hello-world.json | 9 | ||||
-rw-r--r-- | wwwroot/blog/hello-world.md | 3 | ||||
-rw-r--r-- | wwwroot/blog/index.html | 27 | ||||
-rw-r--r-- | wwwroot/blog/my-second-blog-entry.json | 9 | ||||
-rw-r--r-- | wwwroot/blog/my-second-blog-entry.md | 5 | ||||
-rw-r--r-- | wwwroot/blog/my-third-blog-entry.json | 9 | ||||
-rw-r--r-- | wwwroot/blog/my-third-blog-entry.md | 2 | ||||
-rw-r--r-- | wwwroot/blog/my-very-first-blog-entry.json | 9 | ||||
-rw-r--r-- | wwwroot/blog/my-very-first-blog-entry.md | 8 | ||||
-rw-r--r-- | wwwroot/index.html | 22 | ||||
-rw-r--r-- | wwwroot/pages.html | 6 | ||||
-rw-r--r-- | wwwroot/pages/about.md | 9 | ||||
-rw-r--r-- | wwwroot/pages/index.md | 3 | ||||
-rw-r--r-- | wwwroot/static/.placeholder | 0 | ||||
-rw-r--r-- | wwwroot/static/gohu.woff | bin | 0 -> 517184 bytes | |||
-rw-r--r-- | wwwroot/static/test.txt | 1 |
19 files changed, 112 insertions, 79 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8256717..924ac58 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,8 +59,8 @@ int main(int argc, char ** argv) tmgr->ParseTemplates(dynamic_fs); } - 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<Markdown>("/p", wwwroot + "/pages", "pages.html")); + cmgr->RegisterModule(std::make_shared<Blog>("/", wwwroot + "/blog", "index.html")); if (cmgr->InitAll() == false) { diff --git a/wwwroot/00_header.tmpl b/wwwroot/00_header.tmpl new file mode 100644 index 0000000..7175753 --- /dev/null +++ b/wwwroot/00_header.tmpl @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> +<head> + <title>blog.impl.cc</title> + <meta charset="utf-8"> + <style> + body { + color: #FEFEFE; + background-color: #0c0d10; + margin: 0 auto; + padding: 1em 0 1em 0; + } + h1, h3 { + text-align: center; + } + table { + border-collapse: separate; + border-spacing: 1px; + table-layout: fixed; + margin-left:auto; + margin-right:auto; + } + td { + border-spacing: 0px; + } + @font-face { font-family: "gohu"; src: url("/static/gohu.woff") format('woff'); } + pre { font-family: "gohu", "Lucida Console", monospace, Monaco; font-size: 14px; line-height: 1.0; } + a { color: #93ffd7; text-decoration: none; } + </style> +</head> + +<body> +<center><div style="display: inline-block; text-align: left;"> +<pre> + ┌───────────────────────┐ + │████ █████ ███ ████ │ + │█ █ █ █ █ █ █│ + │█ █ ███ █████ █ █│ + │█ █ █ █ █ █ █│ + │████ █████ █ █ ████ │ +┌── <a href="/">blog</a> ── <a href="/p/about">about</a> ─────────────────────────┴───────────────────────┘ +├┐ +└┘ +</pre> +<table width="600"> +<tr><td> + diff --git a/wwwroot/01_footer.tmpl b/wwwroot/01_footer.tmpl new file mode 100644 index 0000000..a4d35e9 --- /dev/null +++ b/wwwroot/01_footer.tmpl @@ -0,0 +1,18 @@ + +</td></tr> +</table> +<pre> +┌┐ +└┤ + └─────────────────────────────────────────┬───────────────────────┐ + │ ████ ███ ████ █████│ + │█ █ █ █ █ █ │ + │█ █ █ █ █ ███ │ + │█ █ █ █ █ █ │ + │ ████ ███ ████ █████│ + └───────────────────────┘ + +made without love and <a href="https://github.com/lnslbrty/cpp-web">cpp-web</a>, theme inspired by <a href="https://tmpout.sh">tmpout.sh</a> +</pre> +</div></center> +</body></html> diff --git a/wwwroot/blog/hello-world.json b/wwwroot/blog/hello-world.json new file mode 100644 index 0000000..ce3ecba --- /dev/null +++ b/wwwroot/blog/hello-world.json @@ -0,0 +1,9 @@ +{ + "title": "Hello World!", + "tags": [ "first" ], + "author": "lns", + "createDate": "30.10.2021 22:32", + "publishDate": "30.10.2021 22:39", + "published": true, + "accessAllowed": true +} diff --git a/wwwroot/blog/hello-world.md b/wwwroot/blog/hello-world.md new file mode 100644 index 0000000..f3891e5 --- /dev/null +++ b/wwwroot/blog/hello-world.md @@ -0,0 +1,3 @@ +```C +hello = world(); +``` diff --git a/wwwroot/blog/index.html b/wwwroot/blog/index.html deleted file mode 100644 index a4c520a..0000000 --- a/wwwroot/blog/index.html +++ /dev/null @@ -1,27 +0,0 @@ -<html><body> -<p> -<b>blabla</b> -Test fn....: <b>{{ test_fn }}</b><br> -Test RetFN.: <b>{{ test_return_true }}</b><br><br><br> -{% 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 %} -</p> -</body></html> diff --git a/wwwroot/blog/my-second-blog-entry.json b/wwwroot/blog/my-second-blog-entry.json deleted file mode 100644 index c1a4fe6..0000000 --- a/wwwroot/blog/my-second-blog-entry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "Second blog entry.", - "tags": [ "bla" ], - "author": "lns", - "createDate": "23.02.1989 23:59", - "publishDate": "30.12.2020 1:00", - "published": true, - "accessAllowed": false -} diff --git a/wwwroot/blog/my-second-blog-entry.md b/wwwroot/blog/my-second-blog-entry.md deleted file mode 100644 index 054046a..0000000 --- a/wwwroot/blog/my-second-blog-entry.md +++ /dev/null @@ -1,5 +0,0 @@ -Text -======= - -*lorem* **ipsum** -~~striked~~ diff --git a/wwwroot/blog/my-third-blog-entry.json b/wwwroot/blog/my-third-blog-entry.json deleted file mode 100644 index 3478508..0000000 --- a/wwwroot/blog/my-third-blog-entry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "Third.", - "tags": [ "test" ], - "author": "lns", - "createDate": "24.02.1989 23:59", - "publishDate": "31.12.2020 1:00", - "published": false, - "accessAllowed": false -} diff --git a/wwwroot/blog/my-third-blog-entry.md b/wwwroot/blog/my-third-blog-entry.md deleted file mode 100644 index 292b1e1..0000000 --- a/wwwroot/blog/my-third-blog-entry.md +++ /dev/null @@ -1,2 +0,0 @@ -Text -======= diff --git a/wwwroot/blog/my-very-first-blog-entry.json b/wwwroot/blog/my-very-first-blog-entry.json deleted file mode 100644 index e10fb2c..0000000 --- a/wwwroot/blog/my-very-first-blog-entry.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "My first blog entry!", - "tags": [ "test", "bla" ], - "author": "lns", - "createDate": "22.02.1989 23:59", - "publishDate": "31.12.2020 1:00", - "published": true, - "accessAllowed": true -} diff --git a/wwwroot/blog/my-very-first-blog-entry.md b/wwwroot/blog/my-very-first-blog-entry.md deleted file mode 100644 index 017cbfc..0000000 --- a/wwwroot/blog/my-very-first-blog-entry.md +++ /dev/null @@ -1,8 +0,0 @@ -Text -======= - -`test` - -``` -some code... -``` diff --git a/wwwroot/index.html b/wwwroot/index.html index 07dd49d..ae3f1a7 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -1,5 +1,17 @@ -<html><body> - <b>INDEX TMPL</b> - {{ uri }}<br> - {{ indent(content, 4, false, false) }} -</body></html> +## include "00_header.tmpl" +## if exists("blog_post") +<a href="{{ blog_post.filename }}">{{ blog_post.title }}</a><br> + {{ blog_post.publishDate }} by {{ blog_post.author }}<br> +{{ blog_post.content }} +## endif +## if exists("blog_listing") and length("blog_listing") > 0 +## for entry in blog_listing + {{ loop.index1 }} + <a href="{{ entry.filename }}">{{ entry.title }}</a> by {{ entry.author }}<br> + published {{ entry.publishDate }}<br> +## if not loop.is_last + <br> +## endif +## endfor +## endif +## include "01_footer.tmpl" diff --git a/wwwroot/pages.html b/wwwroot/pages.html new file mode 100644 index 0000000..311f325 --- /dev/null +++ b/wwwroot/pages.html @@ -0,0 +1,6 @@ +## include "00_header.tmpl" +{{- indent(uri, 4, false, true) -}} + +{{- indent(content, 8, false, true) -}} + +## include "01_footer.tmpl" diff --git a/wwwroot/pages/about.md b/wwwroot/pages/about.md new file mode 100644 index 0000000..9ebe9ab --- /dev/null +++ b/wwwroot/pages/about.md @@ -0,0 +1,9 @@ +*What?*<br> +A blog about _Coding_, _Reverse Engineering_, _Operating Systems_, _Politics_ and _Travelling_. + +*Who?*<br> +See: [GitHub Profile](https://github.com/lnslbrty)<br> +Contact: toni@impl.cc<br> + +Please use my GPG public key for any mail based conversation.<br> +You can get it from [Ubuntu Keyserver](https://keyserver.ubuntu.com/pks/lookup?search=toni%40impl.cc&fingerprint=on&op=index). diff --git a/wwwroot/pages/index.md b/wwwroot/pages/index.md index 99bd385..8c6fcb5 100644 --- a/wwwroot/pages/index.md +++ b/wwwroot/pages/index.md @@ -1,2 +1 @@ -*Just HTML* -~~plaintext~~ +Nothing to see here.. diff --git a/wwwroot/static/.placeholder b/wwwroot/static/.placeholder new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/wwwroot/static/.placeholder diff --git a/wwwroot/static/gohu.woff b/wwwroot/static/gohu.woff Binary files differnew file mode 100644 index 0000000..67cfd9e --- /dev/null +++ b/wwwroot/static/gohu.woff diff --git a/wwwroot/static/test.txt b/wwwroot/static/test.txt deleted file mode 100644 index 50bb49a..0000000 --- a/wwwroot/static/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is a static text file. |