From 4e4acb78afdb5e2c6f98c5401f6d3f562d6ec1dc Mon Sep 17 00:00:00 2001 From: Ian Andwati Date: Wed, 9 Aug 2023 01:02:29 +0300 Subject: [PATCH] Implemented archive page --- config.toml | 5 +---- content/archive/_index.md | 4 ++++ templates/archive.html | 26 ++++++++++++++++++++++++++ templates/footer.html | 2 ++ templates/index.html | 2 +- 5 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 content/archive/_index.md create mode 100644 templates/archive.html diff --git a/config.toml b/config.toml index 414d667..e6375cd 100644 --- a/config.toml +++ b/config.toml @@ -6,13 +6,10 @@ genenerate_categories_pages = false generate_tags_pages = false generate_rss = true feed_filename = "rss.xml" -minify_html = true +minify_html = false taxonomies = [{ name = 'tags', feed = false }] compile_sass = true -# Whether to build a search index to be used later on by a JavaScript library -build_search_index = true - [markdown] highlight_code = true highlight_theme = "gruvbox-dark" diff --git a/content/archive/_index.md b/content/archive/_index.md new file mode 100644 index 0000000..8406ec7 --- /dev/null +++ b/content/archive/_index.md @@ -0,0 +1,4 @@ ++++ +sort_by = "date" +template= "archive.html" ++++ \ No newline at end of file diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..157c3c8 --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,26 @@ +{% extends "section.html" %} +{% block content %} +
+
+

Archive

+
+ {% set section = get_section(path="posts/_index.md") %} + {% for year, posts in section.pages + | sort(attribute="date") + | reverse + | group_by(attribute="year") %} +
+

{{ year }}

+
    + {% for post in posts %} +
  • + + {{ post.title }} +
  • + {% endfor %} +
+
+ {% endfor %} +
+ {% include "footer.html" %} +{% endblock content %} diff --git a/templates/footer.html b/templates/footer.html index 3fe9425..750503e 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -6,6 +6,8 @@ ⬡ Tags ⬡ + Archive + ⬡ Contact

diff --git a/templates/index.html b/templates/index.html index 668e109..b9ba102 100644 --- a/templates/index.html +++ b/templates/index.html @@ -26,7 +26,7 @@ {% endblock meta %} - + {% block links %} {% endblock links %}