From 9c1f02f9099b0da48c0bec7f23fa8c0566a331f3 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 30 May 2022 22:33:42 -0700 Subject: Whitespace Cleanup, Fix Recent --- README.md | 8 ++ config.toml | 18 ++-- static/processed_images/199de027950a8f4800.jpg | Bin 37494 -> 0 bytes templates/404.html | 34 ++++---- templates/base.html | 111 ++++++++++++++----------- templates/categories/list.html | 14 ++-- templates/categories/single.html | 13 ++- templates/contact.html | 35 +++++--- templates/index.html | 31 ++++--- templates/macros/macros.html | 9 +- templates/macros/page.html | 8 +- templates/macros/social.html | 7 +- templates/page.html | 68 +++++++-------- templates/pages.html | 6 +- templates/posts.html | 17 ++-- templates/shortcodes/img.html | 51 ++++++------ templates/tags/list.html | 19 +++-- templates/tags/single.html | 13 ++- 18 files changed, 268 insertions(+), 194 deletions(-) delete mode 100644 static/processed_images/199de027950a8f4800.jpg diff --git a/README.md b/README.md index c9ec215..90b9cd3 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,14 @@ You can customize your configurations, templates and content for yourself. Look at the `config.toml`, `content` files, and templates files in this repo for an idea. +### Colors and Styles + +Colors and style are handled by the sass files of [abridge.css](https://github.com/jieiku/abridge.css) + +To change colors of this theme all you need to do is edit `/themes/abridge/sass/themes/_auto.scss` +then in the root of your site type `zola build` which will regenerate your site, this is similar to what zola serve does, except it does not facilitate serving the site. +This is also the way you should generate your site to serve it by a real webserver such as nginx. + ### Global Configuration There are some configuration options that you can customize in `config.toml`. diff --git a/config.toml b/config.toml index c65cdb3..7cb9809 100644 --- a/config.toml +++ b/config.toml @@ -36,9 +36,9 @@ footer_credit = true #google = "Your Google Site verification code." #bing = "Your Bing Site verification code." textlogo = 'Abridge' -sitedesc = false # This enables or disables the display of the site description below the logo. +sitedesc = false # enables or disables the display of the site description below the logo. author = "Your Name" -keywords = "Whatever, SEO, keywords, you want" +favicon = "favicon.png" banner = "banner.png" menu = [ {url = "/", name = "Home", slash = true}, @@ -54,10 +54,13 @@ menu_footer = [ {url = "/privacy/", name = "Privacy", slash = true}, {url = "/sitemap.xml", name = "Sitemap", slash = false}, ] +#copyright_start_year = 2019 # optional +#copyright_end_year = 2020 # optional, recommend leaving unset, zola build will set this to current year by default + # meta tags +keywords = "Whatever, SEO, keywords, you want" twitter = "your-user-name" - -# favicon = images/favicon.png # override default favicon +seo = true # enable or disable seo-related meta tags: opengraph, facebook, twitter # Footer social links; full options listed in macros/social.html [extra.social] @@ -69,20 +72,13 @@ element = "matrix.example.com" twitter = "your-user-name" facebook = "your-user-name" linkedin = "your-user-name" - gitlab = "your-user-name" github = "your-user-name" bitbucket = "your-user-name" python = "your-user-name" docker = "your-user-name" stack = "your-user-name" - instagram = "your-user-name" pinterest = "your-user-name" twitch = "your-user-name" youtube = "your-channel-id" - -# seo = true # enable or disable seo-related tags, defaults to true - -# start_year = 2019 # optional, copyright start year -# end_year = 2022 #optional, copyright end year, defaults to current year if unset diff --git a/static/processed_images/199de027950a8f4800.jpg b/static/processed_images/199de027950a8f4800.jpg deleted file mode 100644 index 51d50a8..0000000 Binary files a/static/processed_images/199de027950a8f4800.jpg and /dev/null differ diff --git a/templates/404.html b/templates/404.html index 23c7168..3b02be6 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,21 +1,23 @@ {% extends "base.html" %} - {# Title #} -{% block title %}Sorry! Page not found.{% endblock title %} - -{% if config.extra.seo | default(value=true) %} - {% block current_url %} - - - {% endblock current_url %} -{% endif %} -{# Page heading #} +{% block title %} + Sorry! Page not found. +{% endblock title %} -{% block content %}
+{% block current_url %} + {% if config.extra.seo | default(value=true) %} + + + {% endif %} +{% endblock current_url %} -

404 Error

-

Sorry

-

The requested page does not exist or has been moved to another address.

-

Please go back to home.

+{# Page heading #} -
{% endblock content %} +{% block content %} +
+

404 Error

+

Sorry

+

The requested page does not exist or has been moved to another address.

+

Please go back to home.

+
+{% endblock content %} diff --git a/templates/base.html b/templates/base.html index 77c4742..f43dcba 100644 --- a/templates/base.html +++ b/templates/base.html @@ -11,16 +11,20 @@ {% block description %} {% if page.description %} + {% if config.extra.seo | default(value=true) %} - - + + {% endif %} + {% else %} + {% if config.extra.seo | default(value=true) %} - - + + {% endif %} + {% endif %} {% endblock description %} @@ -44,11 +48,11 @@ {% block css %}{% endblock css %} + {% if config.extra.favicon %} - - {% else %} - + {% endif %} + {% if config.generate_feed %}{% endif %} @@ -74,8 +78,8 @@ {% endblock current_url %} {% if config.extra.social.twitter %} - - + + {% endif %} {% if page.extra.thumbnail %} @@ -93,55 +97,64 @@ {% endif %} {% elif config.extra.default_og_image %} - - - + + + {% elif config.extra.banner %} - - - + + + {% else %} - + {% endif %} {% endif %} {% block extra_head %}{% endblock extra_head %} -{% block header %}
- - {% if config.extra.sitedesc %}{% if config.description %}
{{ config.description }}
{% endif %}{% endif %} -
-
{% endblock header %} -
{% block content %} +{% block header %} +
+ + {% if config.extra.sitedesc %} + {% if config.description %} +
{{ config.description }}
+ {% endif %} + {% endif %} +
+
+{% endblock header %} +
+{% block content %} {% endblock content %}
-{% block footer %}{% endblock footer %} +{% block footer %} + +{% endblock footer %} diff --git a/templates/categories/list.html b/templates/categories/list.html index 89bbc23..bce31fa 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -1,12 +1,16 @@ {% extends "base.html" %} {% block content %} -
+

{{ terms | length }} Categories

{% for term in terms -%}[{{ term.name }}]   {%- endfor %}

- {% for term in terms -%}

{{ term.name }}

- {% for page in term.pages -%}

{{ page.title }} -

- {% endfor -%}{% endfor -%} -
{% endblock content %} + {% for term in terms -%} +

{{ term.name }}

+ {% for page in term.pages -%} +

{{ page.title }} -

+ {% endfor -%} + {% endfor -%} +
+{% endblock content %} diff --git a/templates/categories/single.html b/templates/categories/single.html index d5fe5b7..641add7 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -1,8 +1,13 @@ {% extends "base.html" %} {% block content %} -
+

{{ term.name }}

- {% for year, posts in term.pages | group_by(attribute="year") %}

{{ year }}

- {% for page in posts %}

{{ page.title }} -

- {% endfor %}{% endfor %}
{% endblock content %} + {% for year, posts in term.pages | group_by(attribute="year") %} +

{{ year }}

+ {% for page in posts %} +

{{ page.title }} -

+ {% endfor %} + {% endfor %} +
+{% endblock content %} diff --git a/templates/contact.html b/templates/contact.html index bf37d2d..6cdbc55 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -1,16 +1,25 @@ {% extends "base.html" %} {% block content %} -
-

Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!

-
-

-

-

-

-

-

-
-

-
-
{% endblock content %} +
+

Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!

+
+

+ + +

+

+ + +

+

+ + +

+
+

+ +

+
+
+{% endblock content %} diff --git a/templates/index.html b/templates/index.html index 1bd4976..ad4af41 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,20 +1,27 @@ {% import "macros/page.html" as page_macros %} {% import "macros/macros.html" as macros %} -{% extends "base.html" %}{% block content %} -
{% for page in paginator.pages %} -
-{{ macros::title(page=page) }}

{{ page.summary | markdown(inline=true) | safe }} ...more

-
{% endfor %} +{% extends "base.html" %} +{% block content %} +
+ {% for page in paginator.pages %} +
+ {{ macros::title(page=page) }} +

{{ page.summary | markdown(inline=true) | safe }} ...more

+
+ {% endfor %} -
{% set section_item = get_section(path="_index.md") %} +
+ {% set section_item = get_section(path="_index.md") %} {% if recent %} -
-
-

Recent Posts

{% for page in section_item.pages | slice(end=config.extra.recent_items) %} -{{ page_macros::page_listing(page=page) }}{% endfor %} +
+
+

Recent Posts

+ {% for page in section_item.pages | slice(end=config.extra.recent_items) %} + {{ page_macros::page_listing(page=page) }} + {% endfor %} +
-
{% endif %} - {% endblock content %} +{% endblock content %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index a470bb0..c3147aa 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,6 +1,9 @@ -{% macro title(page) %}

{{ page.title }}

- {{ page.date | date(format="%B %d, %Y") }}{% if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}] {% endif %} - {% if page.taxonomies.tags %} {% for tag in page.taxonomies.tags %} #{{ tag }} {% endfor %}{% endif %} +{% macro title(page) %} +

{{ page.title }}

+{{ page.date | date(format="%B %d, %Y") }}{% if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}] {% endif %} +{% if page.taxonomies.tags %} + {% for tag in page.taxonomies.tags %} #{{ tag }} {% endfor %} +{% endif %} {% endmacro title %} {% macro footer(page) %}

Back to top

diff --git a/templates/macros/page.html b/templates/macros/page.html index 69d40f7..0029e13 100644 --- a/templates/macros/page.html +++ b/templates/macros/page.html @@ -1,3 +1,5 @@ -{% macro page_listing(page) %} {% endmacro page_listing %} +{% macro page_listing(page) %} + +{% endmacro page_listing %} diff --git a/templates/macros/social.html b/templates/macros/social.html index 8daf7bc..6d45b9e 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,4 +1,6 @@ -{% macro social_links(social_config) %}{% set base_url = get_url(path="", lang=lang) %} +{% macro social_links(social_config) %} +{% set base_url = get_url(path="", lang=lang) %} + {% if config.generate_feed %}{% if config.extra.social.feed %} {% endif %}{% endif %} {% if social_config.mail %} {% endif %} @@ -20,4 +22,5 @@ {% if social_config.pinterest %} {% endif %} {% if social_config.twitch %} {% endif %} {% if social_config.youtube %} {% endif %} - {% endmacro %} + +{% endmacro %} diff --git a/templates/page.html b/templates/page.html index e3388c0..f92574e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -2,39 +2,39 @@ {% import "macros/macros.html" as macros %} {{config.title}} - {{page.title}} {% block content %} -
- {{ macros::title(page=page) }} - {{ page.content | safe }} - {% block page_before_footer %} - {% endblock page_before_footer %} - {% block page_footer %} - {{ macros::footer(page=page) }} - {% endblock page_footer %} - {% block page_after_footer %} - {% endblock page_after_footer %} -
-{% block toc %} - {% if page.extra.toc %} - {% set toc = page.toc %} - {% endif %} - {% if toc %} -
-
-

Index

- {% for h in toc %} -
- {{ h.title }} +
+ {{ macros::title(page=page) }} + {{ page.content | safe }} + {% block page_before_footer %} + {% endblock page_before_footer %} + {% block page_footer %} + {{ macros::footer(page=page) }} + {% endblock page_footer %} + {% block page_after_footer %} + {% endblock page_after_footer %} +
+ {% block toc %} + {% if page.extra.toc %} + {% set toc = page.toc %} + {% endif %} + {% if toc %} +
+
+

Index

+ {% for h in toc %} + + {% if h.children %} + {% for h2 in h.children %} + + {% endfor %} + {% endif %} + {% endfor %} +
- {% if h.children %} - {% for h2 in h.children %} - - {% endfor %} - {% endif %} - {% endfor %} -
-
- {% endif %} -{% endblock toc %} + {% endif %} + {% endblock toc %} {% endblock content %} diff --git a/templates/pages.html b/templates/pages.html index 30c95e9..3d2ca80 100644 --- a/templates/pages.html +++ b/templates/pages.html @@ -1,2 +1,4 @@ -{% extends "base.html" %}{% block content %} -
{{ page.content | safe }}
{% endblock content %} +{% extends "base.html" %} +{% block content %} +
{{ page.content | safe }}
+{% endblock content %} diff --git a/templates/posts.html b/templates/posts.html index 7aee3a7..f093e8e 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -1,5 +1,12 @@ -{% extends "base.html" %}{% block content %}{% set section_item = get_section(path="_index.md") %} -
{% for year, posts in section_item.pages | group_by(attribute="year") %} -

{{ year }}

- {% for post in posts %}

{{ post.title }} - {{ post.date | date(format="%F") }}

{% endfor %}{% endfor %} -
{% endblock content %} +{% extends "base.html" %} +{% block content %} + {% set section_item = get_section(path="_index.md") %} +
+ {% for year, posts in section_item.pages | group_by(attribute="year") %} +

{{ year }}

+ {% for post in posts %} +

{{ post.title }} - {{ post.date | date(format="%F") }}

+ {% endfor %} + {% endfor %} +
+{% endblock content %} diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index 94cb9fa..d003eeb 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -7,36 +7,39 @@ {% set figure_width = container_width - (40 * 2) %} {% if path is starting_with("./") %} - {% set relative_path = page.relative_path | split(pat="/") | slice(end=-1) | join(sep="/") %} - {% set img_path = path | trim_start_matches(pat="./") %} - {% set img_path = relative_path ~ "/" ~ img_path %} + {% set relative_path = page.relative_path | split(pat="/") | slice(end=-1) | join(sep="/") %} + {% set img_path = path | trim_start_matches(pat="./") %} + {% set img_path = relative_path ~ "/" ~ img_path %} {% else %} - {% set img_path = path %} + {% set img_path = path %} {% endif %} {% if path is not ending_with(".svg") %} - {% set resize = true %} - {% set image_quality = 90 %} - {% if quality %} - {% set image_quality = quality %} - {% endif %} - {% if extended_width_pct %} - {% if extended_width_pct == -1 %} - {# adjust extended width to container width #} - {% set extended_width_pct = 0.042 %} - {% endif %} - {% set _width = config.extra.images.max_width - figure_width %} - {% set extended_width = (extended_width_pct * _width + figure_width) | round | int %} - {% if extended_width > config.extra.images.max_width %} - {% set extended_width = config.extra.images.max_width %} - {% endif %} - {% set resized_image = resize_image(path=img_path, width=extended_width, op="fit_width", quality=image_quality) %} - {% else %} - {% set resized_image = resize_image(path=img_path, width=figure_width, op="fit_width", quality=image_quality) %} + {% set resize = true %} + {% set image_quality = 90 %} + {% if quality %} + {% set image_quality = quality %} + {% endif %} + + {% if extended_width_pct %} + + {% if extended_width_pct == -1 %} + {# adjust extended width to container width #} + {% set extended_width_pct = 0.042 %} {% endif %} + {% set _width = config.extra.images.max_width - figure_width %} + {% set extended_width = (extended_width_pct * _width + figure_width) | round | int %} + {% if extended_width > config.extra.images.max_width %} + {% set extended_width = config.extra.images.max_width %} + {% endif %} + {% set resized_image = resize_image(path=img_path, width=extended_width, op="fit_width", quality=image_quality) %} + + {% else %} + {% set resized_image = resize_image(path=img_path, width=figure_width, op="fit_width", quality=image_quality) %} + {% endif %} {% endif %}
- - {% if caption %}
{{ caption | safe }}
{% endif %} + + {% if caption %}
{{ caption | safe }}
{% endif %}
diff --git a/templates/tags/list.html b/templates/tags/list.html index e7a6b7d..56575df 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -2,10 +2,15 @@ {% block content %}
-
-

{{ terms | length }} Tags

-

{% for term in terms -%}#{{ term.name }}   {%- endfor %}

-
- {% for term in terms -%}

#{{ term.name }}

- {% for page in term.pages -%}

{{ page.title }} -

- {% endfor -%}{% endfor -%}
{% endblock content %} +
+

{{ terms | length }} Tags

+

{% for term in terms -%}#{{ term.name }}   {%- endfor %}

+
+ {% for term in terms -%} +

#{{ term.name }}

+ {% for page in term.pages -%} +

{{ page.title }} -

+ {% endfor -%} + {% endfor -%} +
+{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html index fd1a10f..2bddb8e 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -2,7 +2,12 @@ {% block content %}
-

{{ term.name }}

- {% for year, posts in term.pages | group_by(attribute="year") %}

{{ year }}

- {% for page in term.pages %}

{{ page.title }} -

- {% endfor %}{% endfor %}
{% endblock content %} +

{{ term.name }}

+ {% for year, posts in term.pages | group_by(attribute="year") %} +

{{ year }}

+ {% for page in term.pages %} +

{{ page.title }} -

+ {% endfor %} + {% endfor %} +
+{% endblock content %} -- cgit v1.3.1