diff --git a/config.toml b/config.toml index 1684482..55f1a73 100644 --- a/config.toml +++ b/config.toml @@ -9,8 +9,13 @@ generate_feed = true theme = "apollo" +taxonomies = [ + { name = "tags" }, +] + [markdown] highlight_code = true +highlight_theme = "zenburn" render_emoji = false external_links_target_blank = true external_links_no_referrer = true diff --git a/content/posts/gitea-on-fly-io.md b/content/posts/gitea-on-fly-io.md index ec4cde4..7a07a5f 100644 --- a/content/posts/gitea-on-fly-io.md +++ b/content/posts/gitea-on-fly-io.md @@ -1,6 +1,9 @@ +++ title = "diy code hosting with gitea and fly.io" -date = "2022-08-08" +date = "2022-08-07" +updated = "2022-08-08" +[taxonomies] +tags = ["git", "gitea", "fly.io"] +++ ## Setting the scene diff --git a/sass/main.scss b/sass/main.scss index 1a080c4..e5b68d6 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -138,4 +138,22 @@ code { // Page title width .page-header { max-width: 720px; +} + +// Tags +ul.tags { + margin: 0.5rem; + + li { + margin-right: 0.6rem; + display: inline-block; + + a { + margin-left: 0; + } + } +} + +.meta.tags { + float: right; } \ No newline at end of file diff --git a/templates/macros/macros.html b/templates/macros/macros.html new file mode 100644 index 0000000..c0d813c --- /dev/null +++ b/templates/macros/macros.html @@ -0,0 +1,148 @@ +{% macro list_posts(pages) %} + +{% endmacro list_posts %} + +{% macro tags(page, short=false) %} +{%- if page.taxonomies and page.taxonomies.tags %} + + {%- if short %} + :: + {%- set sep = "," -%} + {% else %} + :: tags:  + {%- set sep = " " -%} + {% endif -%} + {%- for tag in page.taxonomies.tags %} + #{{ tag }} + {%- if not loop.last %}{{ sep | safe }}{% endif -%} + {% endfor -%} + +{% endif -%} +{% endmacro tags %} + +{% macro page_header(title) %} + +{% endmacro content %} + +{% macro content(page) %} +
+
+
+ {#

{{ page.title }}

#} + {{ post_macros::page_header(title=page.title) }} + + {% if page.date %} +
+ Posted on {{ page.date | date(format="%Y-%m-%d") }} + + {% if page.draft %} + DRAFT + {% endif %} +
+ {% if page.updated %} +
+ Updated on {{ page.updated | date(format="%Y-%m-%d") }} +
+ {% endif %} +
+ {{ page.word_count }} words, {{ page.reading_time }} minute read +
+ {% endif %} +
+ + {% if page.extra.tldr %} +
+ tl;dr: + {{ page.extra.tldr }} +
+ {% endif %} + + {# Optional table of contents #} + {% if config.extra.toc | default(value=false) %} + {% if page.toc %} +

Table of Contents

+ + {% endif %} + {% endif %} + +
+ {{ page.content | safe }} +
+ + {% if page.taxonomies and page.taxonomies.tags %} + + {% endif %} +
+
+{% endmacro content %} \ No newline at end of file diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html new file mode 100644 index 0000000..c550894 --- /dev/null +++ b/templates/taxonomy_list.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block main_content %} +{{ post_macros::page_header(title=taxonomy.name) }} +

go to all posts.

+ + +{% endblock main_content %} \ No newline at end of file diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html new file mode 100644 index 0000000..40dcee1 --- /dev/null +++ b/templates/taxonomy_single.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block main_content %} +{{ post_macros::page_header(title="posts tagged with " ~ term.name)}} +{%- set parent = get_taxonomy(kind=taxonomy.name) -%} +

go to all tags.

+ +{{ post_macros::list_posts(pages=term.pages)}} +{% endblock main_content %} \ No newline at end of file