From 80ec217607efeaebe892ae53286afeb8c0fdd8ae Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:41:42 +0100 Subject: [PATCH 01/19] =?UTF-8?q?=F0=9F=92=84=20style:=20remove=20"home"?= =?UTF-8?q?=20from=20navigation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index d9fe76d..8b2d44b 100644 --- a/config.toml +++ b/config.toml @@ -31,7 +31,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 = "blog", url = "$BASE_URL/blog" }, { name = "archive", url = "$BASE_URL/archive" }, { name = "tags", url = "$BASE_URL/tags" }, { name = "projects", url = "$BASE_URL/projects" }, From 4ac32077eb76a9ec65321351271eec52d1eec19f Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:42:44 +0100 Subject: [PATCH 02/19] =?UTF-8?q?=F0=9F=93=9D=20docs:=20update=20inspirati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9102441..2591062 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ zola serve This theme was inspired by: - [shadharon](https://github.com/syedzayyan/shadharon). tabi started as a fork of [syedzayyan](https://github.com/syedzayyan)'s theme. -- [Alfonso García's site](https://alfoncode.com/) +- [tailwind-nextjs-starter-blog](https://github.com/timlrx/tailwind-nextjs-starter-blog) - [tale-zola](https://github.com/aaranxu/tale-zola) - [internetVin's blog](https://internetvin.ghost.io) From 64449d5d9ffe22ed7025f07912a8137b4745c900 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:44:36 +0100 Subject: [PATCH 03/19] =?UTF-8?q?=F0=9F=9A=9A=20refactor:=20move=20blog=20?= =?UTF-8?q?posts=20`blog`=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/_index.md | 6 ++++-- content/blog/_index.md | 7 +++++++ content/{ => blog}/almost-no-js.md | 4 +++- content/{ => blog}/markdown.md | 5 ++++- content/blog/one_more.md | 9 +++++++++ content/{ => blog}/security.md | 4 +++- content/{ => blog}/shortcodes.md | 2 ++ content/{ => blog}/toc.md | 24 +++++++++++++----------- 8 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 content/blog/_index.md rename content/{ => blog}/almost-no-js.md (77%) rename content/{ => blog}/markdown.md (82%) create mode 100644 content/blog/one_more.md rename content/{ => blog}/security.md (89%) rename content/{ => blog}/shortcodes.md (90%) rename content/{ => blog}/toc.md (97%) diff --git a/content/_index.md b/content/_index.md index ed5befc..5874e7c 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,12 +1,14 @@ +++ -paginate_by = 4 path = "/" -title = "Posts" +title = "Latest posts" sort_by = "date" template = "section.html" [extra] header = {title = "Hello! I'm tabi~", img = "$BASE_URL/img/main.webp" } +section_path = "blog/_index.md" +section_title = "Latest posts" +max_posts = 4 +++ Tabi is a simple theme for [Zola](https://www.getzola.org/). It aims to be a personal page and home to blog posts. It features responsive design, dark and light modes, and high performance. diff --git a/content/blog/_index.md b/content/blog/_index.md new file mode 100644 index 0000000..b026d8b --- /dev/null +++ b/content/blog/_index.md @@ -0,0 +1,7 @@ ++++ +paginate_by = 5 +path = "/blog" +title = "Blog" +sort_by = "date" +template = "section.html" ++++ diff --git a/content/almost-no-js.md b/content/blog/almost-no-js.md similarity index 77% rename from content/almost-no-js.md rename to content/blog/almost-no-js.md index 5bb3ed2..304e5f6 100644 --- a/content/almost-no-js.md +++ b/content/blog/almost-no-js.md @@ -1,6 +1,8 @@ +++ title = "Almost no JavaScript" -date = "2023-01-06" +date = 2023-01-06 +description = "JavaScript is only used when HTML and CSS aren't enough." + [taxonomies] tags = ["showcase"] +++ diff --git a/content/markdown.md b/content/blog/markdown.md similarity index 82% rename from content/markdown.md rename to content/blog/markdown.md index 9769b29..477b4f2 100644 --- a/content/markdown.md +++ b/content/blog/markdown.md @@ -1,6 +1,9 @@ +++ title = "Markdown examples" -date = "2023-01-31" +date = 2023-01-31 +updated = 2023-03-01 +description = "This post showcases some examples of Markdown formatting, including a table, code blocks and tags, quotes, tables, and footnotes." + [taxonomies] tags = ["markdown", "showcase"] +++ diff --git a/content/blog/one_more.md b/content/blog/one_more.md new file mode 100644 index 0000000..5915c75 --- /dev/null +++ b/content/blog/one_more.md @@ -0,0 +1,9 @@ ++++ +title = "One more post" +date = 2021-05-30 +description = "The only reason this post exists is to show the pagination in the blog section." ++++ + +> ‘Look at you,’ she said, not without affection. ‘Sitting there like an owl. Melancholy bloody gargoyle. You mawkish bugger. You don’t get any insight, you know, just because it’s night. Just because some buildings have their lights on.’ +> +> — China Miéville, The City & the City diff --git a/content/security.md b/content/blog/security.md similarity index 89% rename from content/security.md rename to content/blog/security.md index bda2613..a6e84a5 100644 --- a/content/security.md +++ b/content/blog/security.md @@ -1,6 +1,8 @@ +++ title = "Secure by default" -date = "2023-02-22" +date = 2023-02-22 +description = "tabi has an easily customizable Content Security Policy (CSP) with safe defaults. Get peace of mind and an A+ on Mozilla Observatory." + [taxonomies] tags = ["security", "showcase"] +++ diff --git a/content/shortcodes.md b/content/blog/shortcodes.md similarity index 90% rename from content/shortcodes.md rename to content/blog/shortcodes.md index 6d2e8fa..64ed2fd 100644 --- a/content/shortcodes.md +++ b/content/blog/shortcodes.md @@ -2,6 +2,8 @@ title = "Custom shortcodes" date = 2023-02-19 updated = 2023-02-27 +description = "This theme includes some useful custom shortcodes that you can use to enhance your posts. Whether you want to display images that adapt to light and dark themes, or format a professional-looking reference section, these custom shortcodes have got you covered." + [taxonomies] tags = ["showcase", "shortcodes"] +++ diff --git a/content/toc.md b/content/blog/toc.md similarity index 97% rename from content/toc.md rename to content/blog/toc.md index 6194c54..25482c9 100644 --- a/content/toc.md +++ b/content/blog/toc.md @@ -1,6 +1,8 @@ +++ title = "Table of Contents" -date = "2022-11-01" +date = 2022-11-01 +description = "A post showcasing the optional Table of Contents." + [taxonomies] tags = ["showcase", "markdown"] @@ -13,14 +15,14 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue ## Heading 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -### Heading 3 +### Heading 3.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -### Heading 3 +### Heading 3.2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. #### Heading 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. @@ -31,16 +33,16 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue ## Heading 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -### Heading 3 +### Heading 3.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -### Heading 3 +### Heading 3.2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. -#### Heading 4 +#### Heading 4.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sed mollis augue, vel efficitur lacus. Pellentesque eu egestas mi. Etiam ultrices lectus sit amet aliquet ullamcorper. Praesent in erat quis est sagittis finibus. Etiam nec sapien in nulla interdum faucibus. Integer iaculis lorem quis arcu lobortis, non malesuada neque vehicula. Aenean nec tellus eu metus bibendum tempus. Sed rutrum urna ut commodo tempor. Vestibulum aliquet elit posuere turpis maximus condimentum. Sed urna libero, ornare eu tellus vitae, laoreet condimentum risus. Aenean elit lectus, mattis quis nibh nec, faucibus rutrum sapien. Sed iaculis consectetur mi, eget posuere turpis finibus et. From 6938ae42f90be2faadae87cd9b463ed67243f306 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:46:26 +0100 Subject: [PATCH 04/19] =?UTF-8?q?=F0=9F=94=A5=20refactor:=20remove=20403?= =?UTF-8?q?=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/403.html | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 templates/403.html diff --git a/templates/403.html b/templates/403.html deleted file mode 100644 index 168a80c..0000000 --- a/templates/403.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "page.html" %} - -{% block main_content %} -
- {{ macros_page_header::page_header(title="403")}} - forbidden -
-{% endblock main_content %} From a8e49cfedfeba14b702db8913b984c87ce20e595 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:48:16 +0100 Subject: [PATCH 05/19] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20use=20co?= =?UTF-8?q?nsistent=20pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_pagination.scss | 30 +++++++++++++++++++++++++++++ templates/base.html | 3 +-- templates/cards.html | 14 +------------- templates/section.html | 38 ++++++++++++++----------------------- 4 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 sass/parts/_pagination.scss diff --git a/sass/parts/_pagination.scss b/sass/parts/_pagination.scss new file mode 100644 index 0000000..a6e51d6 --- /dev/null +++ b/sass/parts/_pagination.scss @@ -0,0 +1,30 @@ +.pagination { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 2rem; + font-size: 1em; + list-style: none; + padding: 0; + + li { + margin-right: 1rem; + } + + .page-link { + background: transparent; + border: none; + cursor: pointer; + padding: 0; + + &.disabled { + opacity: 0.5; + pointer-events: none; + } + } + + .page-numbers { + font-size: 0.9rem; + color: var(--meta-color); + } +} diff --git a/templates/base.html b/templates/base.html index 4e9c324..dee73e3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,9 +4,8 @@ {% import "macros/page_desc.html" as macros_page_desc %} {% import "macros/content.html" as macros_content %} {% import "macros/cards_posts.html" as macros_cards_posts %} -{% import "macros/list_title.html" as macros_list_title %} {% import "macros/set_title.html" as macros_set_title %} - +{% import "macros/paginate.html" as macros_paginate %} diff --git a/templates/cards.html b/templates/cards.html index 8698001..4f02fa5 100644 --- a/templates/cards.html +++ b/templates/cards.html @@ -18,18 +18,6 @@ {% if paginator %} - + {{ macros_paginate::paginate() }} {% endif %} {% endblock main_content %} diff --git a/templates/section.html b/templates/section.html index a2cc00c..a96ace0 100644 --- a/templates/section.html +++ b/templates/section.html @@ -2,39 +2,29 @@ {% block main_content %} {% if section.extra.section_path -%} -{% set section = get_section(path=section.extra.section_path) %} + {% set extra_section = get_section(path=section.extra.section_path) %} {% endif -%} {%- if section.extra.header %} - {{ macros_page_desc::page_desc(desc=section.extra.header, page=section) }} + {{ macros_page_desc::page_desc(desc=section.extra.header, page=section) }} {% endif -%}
-
- {{ macros_page_header::page_header(title=section.title) }} -
- {%- if paginator %} - {%- set show_pages = paginator.pages -%} - {% else %} - {%- set show_pages = section.pages -%} - {% endif -%} +
+ {{ macros_page_header::page_header(title=section.title) }} +
- {{ macros_list_posts::list_posts(pages=show_pages) }} + {%- if paginator %} + {%- set pages = paginator.pages -%} + {% else %} + {%- set pages = extra_section.pages -%} + {% endif -%} + + {% set max = section.extra.max_posts | default(value=999999) %} + {{ macros_list_posts::list_posts(posts=pages, max=max) }}
{% if paginator %} - + {{ macros_paginate::paginate() }} {% endif %} {% endblock main_content %} From f5834a2e39f8f18a90ac6fe99245b34fe4bad0d5 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:50:02 +0100 Subject: [PATCH 06/19] =?UTF-8?q?=F0=9F=92=84=20style:=20increase=20date?= =?UTF-8?q?=20opacity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_archive.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sass/parts/_archive.scss b/sass/parts/_archive.scss index a48794f..0fdaba4 100644 --- a/sass/parts/_archive.scss +++ b/sass/parts/_archive.scss @@ -1,7 +1,7 @@ .archive { .listing-title { font-size: 1.5rem; - opacity: 0.8; + opacity: 0.9; margin-bottom: 1rem; } @@ -12,7 +12,7 @@ .post-time { width: 4rem; .date { - opacity: 0.4; + opacity: 0.5; } } } From 7605ccaf54113749551c990f46ec275e0a159b7c Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:51:20 +0100 Subject: [PATCH 07/19] =?UTF-8?q?=EF=B8=8F=E2=99=BB=EF=B8=8F=20refactor:?= =?UTF-8?q?=20use=20consistent=20pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/macros/paginate.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 templates/macros/paginate.html diff --git a/templates/macros/paginate.html b/templates/macros/paginate.html new file mode 100644 index 0000000..1f44525 --- /dev/null +++ b/templates/macros/paginate.html @@ -0,0 +1,29 @@ +{% macro paginate() %} +{% if paginator %} +
    + {% if paginator.previous %} +
  • + ← Prev +
  • + {% else %} +
  • + ← Prev +
  • + {% endif %} + +
  • + {{ paginator.current_index }} of {{ paginator.number_pagers }} +
  • + + {% if paginator.next %} +
  • + Next → +
  • + {% else %} +
  • + Next → +
  • + {% endif %} +
+{% endif %} +{% endmacro paginate %} From 8ac1894a66c52e370900b2d3f1a7de43207a38de Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:52:51 +0100 Subject: [PATCH 08/19] =?UTF-8?q?=F0=9F=92=84=20style:=20redesign=20tag=20?= =?UTF-8?q?pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_tags.scss | 14 +++++++++++++- templates/macros/list_title.html | 16 ---------------- templates/macros/set_title.html | 2 +- templates/tags/list.html | 25 ++++++++++++------------- templates/tags/single.html | 11 ++++++++++- 5 files changed, 36 insertions(+), 32 deletions(-) delete mode 100644 templates/macros/list_title.html diff --git a/sass/parts/_tags.scss b/sass/parts/_tags.scss index 9e5125a..598ed8c 100644 --- a/sass/parts/_tags.scss +++ b/sass/parts/_tags.scss @@ -6,7 +6,6 @@ .taglist-table-row { padding: 2%; background-color: var(--navbar-color); - transition: 300ms; width: 28%; margin-right: 1%; margin-top: 1%; @@ -52,3 +51,16 @@ margin: 0 } } + +.tag-cloud { + margin-top: 4vmin; + + ul { + list-style: none; + padding: 0; + margin: 0; + } + .tags-item { + margin-top: 1rem; + } +} diff --git a/templates/macros/list_title.html b/templates/macros/list_title.html deleted file mode 100644 index e0d4ae1..0000000 --- a/templates/macros/list_title.html +++ /dev/null @@ -1,16 +0,0 @@ -{% macro list_title(pages, tag_name=false) %} -{% if tag_name %} -
Tag {{ term.name }}
-{% else %} -

All articles

-{% endif %} - -
    - {% for page in pages %} -
  • - - {{ macros_format_date::format_date(date=page.date) }} -
  • - {% endfor %} -
-{% endmacro list_title %} diff --git a/templates/macros/set_title.html b/templates/macros/set_title.html index c91ffaf..364635a 100644 --- a/templates/macros/set_title.html +++ b/templates/macros/set_title.html @@ -16,7 +16,7 @@ {% set suffix = page.title %} {% elif term.name %} {# Individual tags. #} - {% set suffix = term.name ~ " tag" %} + {% set suffix = term.name %} {% elif taxonomy.name %} {# List of tags. #} {% set suffix = taxonomy.name | capitalize %} diff --git a/templates/tags/list.html b/templates/tags/list.html index 02dc0e3..1ed99f7 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -2,20 +2,19 @@ {% block main_content %} -{{ macros_page_header::page_header(title="Tags") }} +{{ macros_page_header::page_header(title="All tags")}} -
    - {% for term in terms -%} -
    -
    - {{ term.name }} +
    +
      + {% for term in terms %} +
      +
    • + {{ term.name }} + – {{ term.pages | length }} post{{ term.pages | length | pluralize }} +
    • - -
      - {{ term.pages | length }} post{{ term.pages | length | pluralize }} -
      -
    - {% endfor %} -
+ {% endfor %} + + {% endblock main_content %} diff --git a/templates/tags/single.html b/templates/tags/single.html index 841ff41..b1f7ef8 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -2,6 +2,15 @@ {% block main_content %} -{{ macros_list_title::list_title(pages=term.pages, tag_name=term.name) }} +{{ macros_page_header::page_header(title=term.name | title) }} + +{% set max = section.extra.max_posts | default(value=999999) %} +{{ macros_list_posts::list_posts(posts=term.pages, max=max) }} + + {% endblock main_content %} From cec746c1ce58fd92275103534287e81648f1b9c3 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:53:12 +0100 Subject: [PATCH 09/19] =?UTF-8?q?=F0=9F=92=84=20style:=20remove=20transiti?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_theme-switch.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/sass/parts/_theme-switch.scss b/sass/parts/_theme-switch.scss index 7379cf7..b4ac3a8 100644 --- a/sass/parts/_theme-switch.scss +++ b/sass/parts/_theme-switch.scss @@ -11,7 +11,6 @@ height: 1rem; position: absolute; left: 0px; - transition: all 0.3s ease-in-out; display: flex; justify-content: center; align-items: center; @@ -19,7 +18,6 @@ width: 100%; height: auto; position: absolute; - transition: all 0.2s ease-in-out; border: none; } .sun { From 14156b590adbf274e527ecb4f9dd1be5c86a5c15 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:53:52 +0100 Subject: [PATCH 10/19] =?UTF-8?q?=F0=9F=9A=9A=20refactor:=20move=20blog=20?= =?UTF-8?q?posts=20to=20`blog`=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/archive.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/archive.html b/templates/archive.html index 9f3913b..32d6ef2 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -4,7 +4,7 @@
    - {% set section_item = get_section(path="_index.md") %} {% for year, posts in + {% set section_item = get_section(path="blog/_index.md") %} {% for year, posts in section_item.pages | group_by(attribute="year") %} {% if posts | length > 0 %}
  • From cd2ab356bef6817122aa6fd390e1735106a99458 Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 19:58:19 +0100 Subject: [PATCH 11/19] =?UTF-8?q?=F0=9F=92=84=20style:=20redesign=20post?= =?UTF-8?q?=20listing=20and=20other=20minor=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/main.scss | 21 ++++---- sass/parts/_cards.scss | 41 ---------------- sass/parts/_header.scss | 4 +- sass/parts/_home-banner.scss | 4 +- sass/parts/_misc.scss | 29 +++++++++--- sass/parts/_posts_list.scss | 79 +++++++++++++++++++++++++++++++ templates/macros/list_posts.html | 77 ++++++++++++++++++------------ templates/macros/page_header.html | 2 +- templates/partials/footer.html | 2 +- templates/partials/nav.html | 46 +++++++++--------- 10 files changed, 185 insertions(+), 120 deletions(-) create mode 100644 sass/parts/_posts_list.scss diff --git a/sass/main.scss b/sass/main.scss index fd30dc0..b9dd2ce 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -32,7 +32,9 @@ @import 'parts/home-banner.scss'; @import 'parts/footer.scss'; @import 'parts/theme-switch.scss'; +@import 'parts/posts_list.scss'; @import 'parts/tags.scss'; +@import 'parts/pagination.scss'; @import 'syntax/syntax-ayu-dark.scss'; :root { @@ -54,13 +56,13 @@ --bg-2: #fefefe; --hover-color: white; --primary-color: #91D8E4; - --secondary-color: rgb(158, 158, 158); + --secondary-color: #d7d7d7; --links: #78cfcb; --text-color: #222226; --text-color-2: #45454b; + --text-color-high-contrast: #151516; --quote-color: #355f62; --border-color: rgb(114, 114, 114); - --light-border-color: rgba(255, 255, 255, 0.1); --meta-color: #757575; --accent-color: #087E96; --table-header-color: #BFEAF5; @@ -71,15 +73,13 @@ --bg-1: rgba(133, 133, 133, 0.5); --bg-2: rgba(23, 23, 23, 100%); --primary-color: #7cc4d1; - --hover-color: white; - --secondary-color: #696969; + --secondary-color: #4a4a4a; --links: #8fdfe5; --text-color: #eae9e9; --text-color-2: #c7c7c7; + --text-color-high-contrast: #f8f8f8; --quote-color: #a9c5c7; - --code: #ef476f; --border-color: rgb(0, 0, 0); - --light-border-color: rgba(255, 255, 255, 0.1); --meta-color: #BBBBBB; --accent-color: #91e0ee; --table-header-color: #b7e4e4; @@ -130,6 +130,7 @@ article{ margin-left: 0; margin-right: 0; font-weight: 550; + color: var(--text-color-high-contrast); } h1 { @@ -205,18 +206,12 @@ p { max-width: var(--small-layout-width); } } -@media all and (min-width: 640px) { +@media all and (min-width: 600px) { html { font-size: 16.5px; } } -@media all and (min-width: 720px) { - html { - font-size: 17px; - } -} - @media all and (min-width: 960px) { html { font-size: 20px; diff --git a/sass/parts/_cards.scss b/sass/parts/_cards.scss index ff6cb0a..f7bbb0f 100644 --- a/sass/parts/_cards.scss +++ b/sass/parts/_cards.scss @@ -41,44 +41,3 @@ gap: 18px; } } - -.bloglist-title{ - display: block; - font-size: 1.2em; - margin-top: 1.2em; - margin-bottom: 0.83em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} - -.bloglist-table-row { - padding: 2%; - background-color: var(--navbar-color); - transition: 300ms; - width: 28%; - margin-right: 1%; - margin-top: 1%; -} -.bloglist-container { - display: flex; - flex-wrap: wrap; - padding-bottom: 1rem; -} -.bloglist-table-row:hover { - box-shadow: 0.5rem 0.5rem 0 var(--border-color); -} -.bloglist-links { - text-decoration: none; -} -.bloglist-table-row-data { - padding: 10px; -} -.bloglist-table-row-date { - font-size: 12px; -} -@media only screen and (max-width: 600px) { - .bloglist-table-row { - width: 100%; - } -} diff --git a/sass/parts/_header.scss b/sass/parts/_header.scss index 5378fb3..0c66fbd 100644 --- a/sass/parts/_header.scss +++ b/sass/parts/_header.scss @@ -56,13 +56,13 @@ header { justify-content: right; color: var(--text-color); padding: 0.66rem; - transition: 100ms; } .home-title { font-size: 1.7em; font-weight: 450; - padding-right: 0.33rem; + padding: 0.12rem; + margin-left: -0.12rem; border: none; color: var(--accent-color); text-decoration: none; diff --git a/sass/parts/_home-banner.scss b/sass/parts/_home-banner.scss index 64010bf..30e93e3 100644 --- a/sass/parts/_home-banner.scss +++ b/sass/parts/_home-banner.scss @@ -24,7 +24,7 @@ .home-banner-header { margin-bottom: 1rem; font-size: 2.8rem; - font-weight: 600; + font-weight: 550; } #banner-home-subtitle { @@ -36,7 +36,7 @@ } #banner-home-subtitle p { - font-family: 'Inter', Arial, Helvetica, sans-serif; + font-family: var(--sans-serif-font); font-size: 1rem; } diff --git a/sass/parts/_misc.scss b/sass/parts/_misc.scss index e2e01c5..077c2e7 100644 --- a/sass/parts/_misc.scss +++ b/sass/parts/_misc.scss @@ -40,10 +40,13 @@ ul { } .title-container { - border-bottom: var(--secondary-color) solid 0.5px; padding-bottom: 15px; } +.bottom-divider { + border-bottom: var(--secondary-color) solid 0.5px; +} + ::-moz-selection { background: var(--primary-color); color: var(--hover-color); @@ -77,21 +80,33 @@ blockquote { } a { - color: var(--text-color); - text-decoration-color: var(--links); - font-weight: 580; -} - -p a { color: var(--accent-color); text-decoration: inherit; font-weight: inherit; + position: relative; } a:hover { background-color: var(--primary-color); color: var(--hover-color); } + +a:not(.no-hover-padding)::before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: -0.15em; + right: -0.15em; + z-index: -1; + background-color: var(--primary-color); + opacity: 0; +} + +a:not(.no-hover-padding):hover::before { + opacity: 1; +} + /* Remove post list padding */ @media screen and (max-width: 600px) { .list > ul { diff --git a/sass/parts/_posts_list.scss b/sass/parts/_posts_list.scss new file mode 100644 index 0000000..68026ac --- /dev/null +++ b/sass/parts/_posts_list.scss @@ -0,0 +1,79 @@ +.bloglist-container { + display: grid; + grid-template-columns: 1fr; +} + +.bloglist-row { + background-color: var(--navbar-color); + display: flex; + align-items: flex-start; + padding: 2.5rem 0; + + .date { + font-size: 0.85rem; + font-weight: 300; + color: var(--meta-color); + width: 14.5rem; + } + + .bloglist-tags { + margin-top: -0.5rem; + + .tag { + margin-right: 0.7rem; + font-size: 0.7rem; + font-weight: 400; + text-transform: uppercase; + } + } + + .bloglist-content { + flex: 1; + + + .bloglist-title { + font-size: 1.2em; + font-weight: bold; + + a { + color: var(--text-color-high-contrast); + font-weight: 550; + + &:hover { + color: var(--hover-color); + } + } + } + + .description { + margin: 0.5rem 0 1rem; + color: var(--text-color); + font-family: var(--sans-serif-font); + font-size: 0.9rem; + font-weight: 250; + line-height: 1.5rem; + } + } +} + +.all-posts { + font-size: 1.3rem; + font-weight: 350; +} + +@media only screen and (max-width: 1100px) { + .bloglist-row { + flex-direction: column; + align-items: flex-start; + padding: 2rem 0; + } + + .date { + margin-bottom: 0; + width: 100%; + } + + .bloglist-content { + width: 100%; + } +} diff --git a/templates/macros/list_posts.html b/templates/macros/list_posts.html index 5ed7928..b816fa7 100644 --- a/templates/macros/list_posts.html +++ b/templates/macros/list_posts.html @@ -1,38 +1,55 @@ -{% macro list_posts(pages) %} +{% macro list_posts(posts, max) %} +
    - {% for page in pages %} -
    - - -
    - {% if page.date %} - {{ macros_format_date::format_date(date=page.date) }} - {% endif %} - -
    - {{ page.reading_time }} min read - {% if page.draft %} - DRAFT - {% endif %} -
    - -
    -
    - {% if page.description %} - {{ page.description }} - {% elif page.summary %} - {{ page.summary | safe }}… + {% for post in posts %} + {% if loop.index <= max %} + {% if loop.index == max %} +
    + {% elif loop.last %} +
    {% else %} - {% set hide_read_more = true %} +
    {% endif %} -
    - {% if not hide_read_more %} - Read more ⟶ + {% if post.date %} +
    + {{ macros_format_date::format_date(date=post.date) }} +
    + {% endif %} + +
    + + + {% if post.taxonomies.tags %} +
    + {% for tag in post.taxonomies.tags %} + {{ tag }} + {% endfor %} +
    + {% endif %} + +
    + {% if post.description %} + {{ post.description }} + {% elif post.summary %} + {{ post.summary | safe }}… + {% endif %} +
    + + Read more → +
    +
    + {% endif %} + {% if not loop.last %} + {% if loop.index == max %} + + {% endif %} {% endif %} - {% endfor %}
    + {% endmacro %} diff --git a/templates/macros/page_header.html b/templates/macros/page_header.html index 6e71fc7..d0b5710 100644 --- a/templates/macros/page_header.html +++ b/templates/macros/page_header.html @@ -1,5 +1,5 @@ {% macro page_header(title) %} -
    +
    {{ title }}
    {% endmacro page_header %} diff --git a/templates/partials/footer.html b/templates/partials/footer.html index ef35922..a2a93e5 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -3,7 +3,7 @@ + From 7195734d598815d3b9a675d912c1bcd02587263b Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 5 Mar 2023 20:34:17 +0100 Subject: [PATCH 12/19] =?UTF-8?q?=F0=9F=90=9B=20fix:=20set=20proper=20ul?= =?UTF-8?q?=20&=20li=20scope=20for=20.meta=20elements=20Fixes=20broken=20T?= =?UTF-8?q?able=20of=20Contents=20styling.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_header.scss | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sass/parts/_header.scss b/sass/parts/_header.scss index 0c66fbd..fc189c2 100644 --- a/sass/parts/_header.scss +++ b/sass/parts/_header.scss @@ -77,18 +77,18 @@ header { padding-top: 0.7vmin; padding-bottom: 3vmin; line-height: 1.4rem; -} - -.meta a { + + a { color: var(--meta-color); text-decoration-color: none; font-weight: inherit; text-decoration: none; -} + } -.meta ul, li{ - list-style-type: none; - display: inline; + ul, li { + list-style-type: none; + display: inline; + } } .card-meta { From 4b18391c188c0b55e8a76a1297ea96f0aa4531d9 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 00:07:41 +0100 Subject: [PATCH 13/19] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20format?= =?UTF-8?q?=20date=20as=20"6=20July=202049"=20Follows=20Oxford's=20and=20o?= =?UTF-8?q?ther=20formal=20style=20manuals.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 4 +--- templates/base.html | 1 - templates/macros/cards_posts.html | 2 +- templates/macros/content.html | 4 ++-- templates/macros/format_date.html | 22 ---------------------- templates/macros/list_posts.html | 2 +- 6 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 templates/macros/format_date.html diff --git a/config.toml b/config.toml index 8b2d44b..7157a27 100644 --- a/config.toml +++ b/config.toml @@ -16,9 +16,7 @@ highlight_code = true highlight_theme = "css" [extra] -use_cdn = false - -date_format = "" # If unset, uses format: "1st January 2049" +date_format = "" # If unset, uses format: "6 July 2049" ("%d %B %Y") # Custom separator used in title tag and posts metadata (between date, time to read, and tags). separator = "•" diff --git a/templates/base.html b/templates/base.html index dee73e3..7cec6b3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,4 @@ {% import "macros/list_posts.html" as macros_list_posts %} -{% import "macros/format_date.html" as macros_format_date %} {% import "macros/page_header.html" as macros_page_header %} {% import "macros/page_desc.html" as macros_page_desc %} {% import "macros/content.html" as macros_content %} diff --git a/templates/macros/cards_posts.html b/templates/macros/cards_posts.html index 43d2cf7..dc6907b 100644 --- a/templates/macros/cards_posts.html +++ b/templates/macros/cards_posts.html @@ -21,7 +21,7 @@
    {%- if page.date %} - {{ macros_format_date::format_date(date=page.date) }} + {{ page.date | date(format=config.extra.date_format | default (value="%d %B %Y")) }} {% endif -%} {% if page.draft %} DRAFT diff --git a/templates/macros/content.html b/templates/macros/content.html index e29ef2e..0c8c1bf 100644 --- a/templates/macros/content.html +++ b/templates/macros/content.html @@ -13,7 +13,7 @@ {% endif %} {% if page.date %} - {{ macros_format_date::format_date(date=page.date) }} + {{ page.date | date(format=config.extra.date_format | default (value="%d %B %Y")) }} {{ separator }} {% endif %} @@ -30,7 +30,7 @@ {% endif %} {% if page.updated %} -
    Last updated on {{ macros_format_date::format_date(date=page.updated) }} +
    Last updated on {{ page.updated | date(format=config.extra.date_format | default (value="%d %B %Y")) }} {% endif %}
diff --git a/templates/macros/format_date.html b/templates/macros/format_date.html deleted file mode 100644 index 33f930e..0000000 --- a/templates/macros/format_date.html +++ /dev/null @@ -1,22 +0,0 @@ -{% macro format_date(date) %} -{% if config.extra.date_format %} - {{ date | date(format=config.extra.date_format) }} -{% else %} - {% set day = date | date(format='%-d') | int %} - {% if day in [11, 12, 13] %} - {% set suffix = "th" %} - {% else %} - {% set last_digit = day % 10 %} - {% if last_digit == 1 %} - {% set suffix = "st" %} - {% elif last_digit == 2 %} - {% set suffix = "nd" %} - {% elif last_digit == 3 %} - {% set suffix = "rd" %} - {% else %} - {% set suffix = "th" %} - {% endif %} - {% endif %} - {{ date | date(format="%-d") }}{{ suffix }} {{ date | date(format="%B %Y") }} -{% endif %} -{% endmacro %} diff --git a/templates/macros/list_posts.html b/templates/macros/list_posts.html index b816fa7..e10f52f 100644 --- a/templates/macros/list_posts.html +++ b/templates/macros/list_posts.html @@ -13,7 +13,7 @@ {% if post.date %}
- {{ macros_format_date::format_date(date=post.date) }} + {{ post.date | date(format=config.extra.date_format | default (value="%d %B %Y")) }}
{% endif %} From dceceff5fda7ec791bb2e0311663bb034ec0d582 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 00:20:31 +0100 Subject: [PATCH 14/19] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20improve?= =?UTF-8?q?=20spacing=20and=20indentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/404.html | 2 ++ templates/archive.html | 5 ++++- templates/macros/cards_posts.html | 2 ++ templates/macros/content.html | 2 ++ templates/macros/page_desc.html | 2 ++ templates/macros/page_header.html | 2 ++ templates/macros/paginate.html | 2 ++ templates/page.html | 2 ++ templates/partials/footer.html | 18 +++++++++--------- templates/partials/header.html | 12 ++++++------ templates/section.html | 2 ++ 11 files changed, 35 insertions(+), 16 deletions(-) diff --git a/templates/404.html b/templates/404.html index facb826..9dfad10 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,8 +1,10 @@ {% extends "page.html" %} {% block main_content %} +
{{ macros_page_header::page_header(title="404")}} not found
+ {% endblock main_content %} diff --git a/templates/archive.html b/templates/archive.html index 32d6ef2..7f7333f 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -1,4 +1,6 @@ -{% extends "base.html" %} {% block main_content %} +{% extends "base.html" %} + +{% block main_content %} {{ macros_page_header::page_header(title=section.title) }} @@ -27,4 +29,5 @@
+ {% endblock main_content %} diff --git a/templates/macros/cards_posts.html b/templates/macros/cards_posts.html index dc6907b..4edb704 100644 --- a/templates/macros/cards_posts.html +++ b/templates/macros/cards_posts.html @@ -1,4 +1,5 @@ {% macro cards_posts(pages) %} +
{%- for page in pages %}
@@ -38,4 +39,5 @@ {% endfor -%}
+ {% endmacro cards_posts %} diff --git a/templates/macros/content.html b/templates/macros/content.html index 0c8c1bf..4c04b58 100644 --- a/templates/macros/content.html +++ b/templates/macros/content.html @@ -1,4 +1,5 @@ {% macro content(page) %} + {% set separator = config.extra.separator | default(value="•") %}
@@ -81,4 +82,5 @@
+ {% endmacro content %} diff --git a/templates/macros/page_desc.html b/templates/macros/page_desc.html index d35fbf1..2449145 100644 --- a/templates/macros/page_desc.html +++ b/templates/macros/page_desc.html @@ -1,4 +1,5 @@ {% macro page_desc(desc, page) %} + + {% endmacro %} diff --git a/templates/macros/page_header.html b/templates/macros/page_header.html index d0b5710..e0a19bd 100644 --- a/templates/macros/page_header.html +++ b/templates/macros/page_header.html @@ -1,5 +1,7 @@ {% macro page_header(title) %} +
{{ title }}
+ {% endmacro page_header %} diff --git a/templates/macros/paginate.html b/templates/macros/paginate.html index 1f44525..7e01af6 100644 --- a/templates/macros/paginate.html +++ b/templates/macros/paginate.html @@ -1,4 +1,5 @@ {% macro paginate() %} + {% if paginator %}
    {% if paginator.previous %} @@ -26,4 +27,5 @@ {% endif %}
{% endif %} + {% endmacro paginate %} diff --git a/templates/page.html b/templates/page.html index 071651e..dc989d7 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,7 @@ {% extends "base.html" %} {% block main_content %} + {{ macros_content::content(page=page)}} + {% endblock main_content %} diff --git a/templates/partials/footer.html b/templates/partials/footer.html index a2a93e5..868e78c 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -1,14 +1,14 @@
- +
diff --git a/templates/partials/header.html b/templates/partials/header.html index 37a61e0..68e73d9 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -8,7 +8,7 @@ {# Favicon #} {% if config.extra.favicon %} - + {% endif %} {# RSS #} @@ -17,16 +17,16 @@ {% if config.extra.stylesheets %} - {% for stylesheet in config.extra.stylesheets %} - - {% endfor %} + {% for stylesheet in config.extra.stylesheets %} + + {% endfor %} {% endif %} {% if is_404 %} - + {% else %} - + {% endif %} diff --git a/templates/section.html b/templates/section.html index a96ace0..f3f95dd 100644 --- a/templates/section.html +++ b/templates/section.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block main_content %} + {% if section.extra.section_path -%} {% set extra_section = get_section(path=section.extra.section_path) %} {% endif -%} @@ -27,4 +28,5 @@ {% if paginator %} {{ macros_paginate::paginate() }} {% endif %} + {% endblock main_content %} From 026a2405368e30c6328c4e28d6200917abe21694 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 00:33:35 +0100 Subject: [PATCH 15/19] =?UTF-8?q?=F0=9F=90=9B=20fix:=20comment=20out=20emp?= =?UTF-8?q?ty=20`date=5Fformat`=20Otherwise=20dates=20aren't=20rendered.?= =?UTF-8?q?=20Adds=20explanation=20in=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 7157a27..cf55384 100644 --- a/config.toml +++ b/config.toml @@ -16,7 +16,8 @@ highlight_code = true highlight_theme = "css" [extra] -date_format = "" # If unset, uses format: "6 July 2049" ("%d %B %Y") +# If unset, uses format: "6 July 2049" ("%d %B %Y"). Don't leave it empty or dates won't appear. Either use a proper format or comment out the line. +# date_format = "%d %B %Y" # Custom separator used in title tag and posts metadata (between date, time to read, and tags). separator = "•" From 7532e0ab12442ba82562eae0063432c4748830c4 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 02:22:02 +0100 Subject: [PATCH 16/19] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20anchor=20header?= =?UTF-8?q?=20links=20on=20hover=20Closes=20#64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/blog/_index.md | 1 + sass/parts/_misc.scss | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/content/blog/_index.md b/content/blog/_index.md index b026d8b..79a1185 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -4,4 +4,5 @@ path = "/blog" title = "Blog" sort_by = "date" template = "section.html" +insert_anchor_links = "left" +++ diff --git a/sass/parts/_misc.scss b/sass/parts/_misc.scss index 077c2e7..334e83d 100644 --- a/sass/parts/_misc.scss +++ b/sass/parts/_misc.scss @@ -31,6 +31,30 @@ iframe { margin-bottom: 3vmin; } +.zola-anchor { + font-size: 1rem; + position: absolute; + margin-left: -1.7em; + padding-right: 0.45em; + padding-left: 0.4em; + opacity: 0; +} + +h1:hover .zola-anchor, +h2:hover .zola-anchor, +h3:hover .zola-anchor, +h4:hover .zola-anchor, +h5:hover .zola-anchor, +h6:hover .zola-anchor { + opacity: 1; +} + +h1, h2, h3, h4, h5, h6{ + a:hover { + background-color: transparent; + } +} + ul { margin-top: 0; } @@ -91,7 +115,7 @@ a:hover { color: var(--hover-color); } -a:not(.no-hover-padding)::before { +a:not(.no-hover-padding, .zola-anchor)::before { content: ""; position: absolute; top: 0; From 27dc4b9a9606772b22b944a16b5b8f9be7befe0d Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 02:35:38 +0100 Subject: [PATCH 17/19] =?UTF-8?q?=F0=9F=94=A5=20refactor:=20remove=20unuse?= =?UTF-8?q?d=20`section=5Ftitle`=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/_index.md b/content/_index.md index 5874e7c..79e48a8 100644 --- a/content/_index.md +++ b/content/_index.md @@ -7,7 +7,6 @@ template = "section.html" [extra] header = {title = "Hello! I'm tabi~", img = "$BASE_URL/img/main.webp" } section_path = "blog/_index.md" -section_title = "Latest posts" max_posts = 4 +++ From f83c75ed044834882c06d9259bb77983eeee492c Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 02:41:32 +0100 Subject: [PATCH 18/19] =?UTF-8?q?=F0=9F=94=A5=20refactor:=20remove=20usele?= =?UTF-8?q?ss=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_pagination.scss | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sass/parts/_pagination.scss b/sass/parts/_pagination.scss index a6e51d6..cef76c7 100644 --- a/sass/parts/_pagination.scss +++ b/sass/parts/_pagination.scss @@ -7,20 +7,9 @@ list-style: none; padding: 0; - li { - margin-right: 1rem; - } - - .page-link { - background: transparent; - border: none; - cursor: pointer; - padding: 0; - - &.disabled { - opacity: 0.5; - pointer-events: none; - } + .page-item .disabled { + opacity: 0.5; + pointer-events: none; } .page-numbers { From 1f4f3a906fc4fe4de3a53a4be0870cfeaa2d1e2f Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Mar 2023 11:28:56 +0100 Subject: [PATCH 19/19] =?UTF-8?q?=F0=9F=92=84=20style:=20increase=20margin?= =?UTF-8?q?=20between=20anchor=20and=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/parts/_misc.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sass/parts/_misc.scss b/sass/parts/_misc.scss index 334e83d..42e5e62 100644 --- a/sass/parts/_misc.scss +++ b/sass/parts/_misc.scss @@ -34,7 +34,7 @@ iframe { .zola-anchor { font-size: 1rem; position: absolute; - margin-left: -1.7em; + margin-left: -1.9em; padding-right: 0.45em; padding-left: 0.4em; opacity: 0; @@ -49,9 +49,9 @@ h6:hover .zola-anchor { opacity: 1; } -h1, h2, h3, h4, h5, h6{ +h1, h2, h3, h4, h5, h6 { a:hover { - background-color: transparent; + background-color: transparent; } }