From bcf9b230be6d74c71567fd0771b31d47d8dd39c7 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 21 Jan 2021 17:22:53 -0700 Subject: build the blog with nix --- src/_layouts/code.html | 10 ++++++ src/_layouts/default.html | 22 +++++++++++++ src/_layouts/page.html | 13 ++++++++ src/_layouts/post.html | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 src/_layouts/code.html create mode 100644 src/_layouts/default.html create mode 100644 src/_layouts/page.html create mode 100644 src/_layouts/post.html (limited to 'src/_layouts') diff --git a/src/_layouts/code.html b/src/_layouts/code.html new file mode 100644 index 0000000..18cfb3b --- /dev/null +++ b/src/_layouts/code.html @@ -0,0 +1,10 @@ +--- +layout: default +--- + +{% capture body %}```{{ page.lang | default: "go" }} +{% include_relative {{ page.include }} %}```{% endcapture %} + +
Raw source file + +{{ body | markdownify }} diff --git a/src/_layouts/default.html b/src/_layouts/default.html new file mode 100644 index 0000000..5df9d6d --- /dev/null +++ b/src/_layouts/default.html @@ -0,0 +1,22 @@ + + + + {%- include head.html -%} + + + +
+ + {%- include header.html -%} + +
+ {{ content }} +
+ + {%- include footer.html -%} + +
+ + + + diff --git a/src/_layouts/page.html b/src/_layouts/page.html new file mode 100644 index 0000000..469413a --- /dev/null +++ b/src/_layouts/page.html @@ -0,0 +1,13 @@ +--- +layout: default +--- + +
+

+ {{ page.title | escape }} +

+
+ +
+ {{ content }} +
diff --git a/src/_layouts/post.html b/src/_layouts/post.html new file mode 100644 index 0000000..6b97042 --- /dev/null +++ b/src/_layouts/post.html @@ -0,0 +1,80 @@ +--- +layout: default +--- +
+ +
+

+ {{ page.title | escape }} +

+
+ + + + • + {%- if page.updated %} + + • + {% endif -%} + {{ page.description }} +
+
+ + {% if page.series %} + {% assign foundThis = false %} + {% for post in site.posts reversed %} + {% if post.series == page.series %} + {% if post.url == page.url %} + {% assign foundThis = true %} + {% elsif foundThis %} + {% assign next = post %} + {% break %} + {% else %} + {% assign prev = post %} + {% endif %} + {% endif %} + {% endfor %} + {% if prev or next %} +

+ This post is part of a series:
+ {% if prev %} + Previously: {{ prev.title }}
+ {% endif %} + {% if next %} + Next: {{ next.title }}
+ {% endif %} +

+ {% endif %} + {% endif %} + +
+ {{ content }} +
+ + {% if page.git_repo %} +

+ To check this project out locally:
+

git clone {{ page.git_repo }}
+{% if page.git_commit %}git checkout {{ page.git_commit }}{% endif %}
+

+ {% endif %} + + {% if prev or next %} +

+ If you liked this post, consider checking out other posts in the series:
+ {% if prev %} + Previously: {{ prev.title }}
+ {% endif %} + {% if next %} + Next: {{ next.title }}
+ {% endif %} +

+ {% endif %} + +
-- cgit v1.2.3