diff --git a/README.md b/README.md index 7367e43..8f681f5 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,6 @@ A simple blog theme powered by [Zola](getzola.org). See a live preview [here](ht - [x] Tags. - [X] Syntax highlighting. -### TODO: -- [ ] Archive. - See the project's roadmap [here](https://github.com/users/welpo/projects/1). ## Quick start diff --git a/config.toml b/config.toml index 7b97c9e..4430c7a 100644 --- a/config.toml +++ b/config.toml @@ -28,6 +28,7 @@ headerImage = "" # The icon is display besides the menu text but is not necessary. It needs to be placed under "menu_icon" in the static "folder" menu = [ { name = "home", url = "$BASE_URL/" }, + { name = "archive", url = "$BASE_URL/archive" }, { name = "tags", url = "$BASE_URL/tags" }, { name = "projects", url = "$BASE_URL/projects" }, ] diff --git a/content/_index.md b/content/_index.md index 84e555d..18d5875 100644 --- a/content/_index.md +++ b/content/_index.md @@ -6,5 +6,7 @@ sort_by = "date" template = "section.html" [extra] -desc = {title = "Hello! I'm tabi~", img = "https://avatars.githubusercontent.com/u/6399341", text = "Tabi is a simple theme for Zola. It aims to be a personal page and home to blog posts. It features responsive design, dark and light modes, and high performance." } +desc = {title = "Hello! I'm tabi~", img = "https://avatars.githubusercontent.com/u/6399341" } +++ + +Tabi is a simple theme for Zola. It aims to be a personal page and home to blog posts. It features responsive design, dark and light modes, and high performance. \ No newline at end of file diff --git a/content/archive/_index.md b/content/archive/_index.md new file mode 100644 index 0000000..2c032c0 --- /dev/null +++ b/content/archive/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Archive" +path = "archive" +template = "archive.html" ++++ diff --git a/content/projects/tabi.md b/content/projects/tabi.md index b7f6bd9..48e0f63 100644 --- a/content/projects/tabi.md +++ b/content/projects/tabi.md @@ -4,6 +4,6 @@ description = "A cute Zola theme." weight = 1 [extra] -remote_image = "https://user-images.githubusercontent.com/6399341/216358758-912b47e3-03ed-4b6d-b818-37cea7c42f45.png" +remote_image = "https://user-images.githubusercontent.com/6399341/216767530-cfe66699-ee6a-40b0-93ff-ce6879f5381e.png" link_to = "https://github.com/welpo/tabi" +++ diff --git a/sass/main.scss b/sass/main.scss index 1ae8836..beb7e9f 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -3,6 +3,7 @@ src: url('fonts/Inter.ttf'); font-display: swap; } +@import 'parts/_archive.scss'; @import 'parts/_cards.scss'; @import 'parts/_code.scss'; @import 'parts/_header.scss'; diff --git a/sass/parts/_archive.scss b/sass/parts/_archive.scss new file mode 100644 index 0000000..a48794f --- /dev/null +++ b/sass/parts/_archive.scss @@ -0,0 +1,25 @@ +.archive { + .listing-title { + font-size: 1.5rem; + opacity: 0.8; + margin-bottom: 1rem; + } + + .listing-item { + padding: 0.2rem 1rem; + display: flex; + gap: 1rem; + .post-time { + width: 4rem; + .date { + opacity: 0.4; + } + } + } + + ul { + list-style: none; + padding: 0; + margin: 0; + } +} diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..5c49cf6 --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} {% block main_content %} + +
+ {{ post_macros::page_header(title=section.title) }} +
+ +
+ +
+{% endblock main_content %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index acfbb03..0e91ca0 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -57,25 +57,28 @@ {% endmacro tags %} {% macro page_header(title) %} -

+

{{ title }} -

-{% endmacro content %} + +{% endmacro page_header %} -{% macro page_desc(desc) %} +{% macro page_desc(desc, page) %} -{% endmacro content %} +{% endmacro page_desc %} + {% macro content(page) %}
diff --git a/templates/section.html b/templates/section.html index 6576f7e..155dda8 100644 --- a/templates/section.html +++ b/templates/section.html @@ -6,7 +6,7 @@ {% endif -%} {%- if section.extra.desc %} - {{ post_macros::page_desc(desc=section.extra.desc) }} + {{ post_macros::page_desc(desc=section.extra.desc, page=section) }} {% endif -%}