diff --git a/flake.nix b/flake.nix index 398edbd..ef22132 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ optimize-images ${ifStaging "BASE_URL=https://staging--mat-services.netlify.app"} zola build --drafts ${ifStaging "--base-url $BASE_URL"} - # ${ifStaging "cp headers/staging public/_headers"} + ${ifStaging "cp headers/staging public/_headers"} # zola's ignored_content setting doesn't work in static/ rm -rf public/image/_favicon.svg ''; diff --git a/templates/base.html b/templates/base.html index 9d17ba1..f58629d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,20 +6,16 @@
- {% include "partials/nav.html" %} - - {# Post page is the default #} + {% include "partials/nav.html" -%} + {#- Post page is the default #}
- {% block main_content %} + {%- block main_content -%} Nothing here?! - {% endblock main_content %} + {%- endblock main_content -%}
- - {% block trailing_content %} - - {% endblock trailing_content %} - - {% include "partials/footer.html" %} + {% block trailing_content -%} + {%- endblock trailing_content %} + {%- include "partials/footer.html" %}
diff --git a/templates/index.html b/templates/index.html index f93d74f..db483f0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,18 +1,14 @@ {% extends "base.html" %} - -{% block main_content %} +{%- block main_content -%} {{ post_macros::page_header(title="a sadware company")}} - -also on -{% for me in config.extra.me_links %} -{%- if loop.last -%} -and +also on + {%- for me in config.extra.me_links -%} + {%- if loop.last -%} + and + {%- endif %} + {{ me.name }} + {%- if not loop.last -%},{%- else %} + {%- endif -%} -{{ me.name }} -{%- if not loop.last -%} -, -{%- else -%} -. -{%- endif -%} -{% endfor %} +{% endfor -%} {% endblock main_content %} \ No newline at end of file diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 9da61a3..887b4c0 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,149 +1,129 @@ -{% macro list_posts(pages) %} +{% macro list_posts(pages) -%} -{% endmacro list_posts %} +{% endmacro list_posts -%} -{% macro tags(page) %} +{%- macro tags(page) %} {%- if page.taxonomies and page.taxonomies.tags %} tagged with {%- for tag in page.taxonomies.tags %} #{{ tag }} {%- if not loop.last %},{% endif -%} - {% endfor -%} + {% endfor %} {% endif -%} -{% endmacro tags %} +{% endmacro tags -%} -{% macro page_header(title) %} -

- {{ title }}. -

-{% endmacro content %} +{%- macro page_header(title) -%} +

{{ title }}.

+{%- endmacro content %} {% macro content(page) %}
{{ post_macros::page_header(title=page.title) }} - - {% if page.date %} + {%- if page.date %}
Posted on - - {% if page.draft %} + {%- if page.draft %} DRAFT - {% endif %} + {% endif -%}
{% if page.updated %}
Updated on
- {% endif %} + {% endif -%}
{{ page.word_count }} words, {{ page.reading_time }} minute read
- {% endif %} + {% endif -%}
- - {% if page.extra.hero %} + {%- if page.extra.hero %}
- {{ page.extra.heroPrompt }} - generated using Stable Diffusion + {{ page.extra.heroPrompt }} - generated using Stable Diffusion

{{ page.extra.heroPrompt }} - generated using Stable Diffusion

- {% endif %} - - {% if page.extra.tldr %} + {% endif -%} + {%- if page.extra.tldr %}
tl;dr: {{ page.extra.tldr }}
- {% endif %} - + {% endif -%} {# Optional table of contents #} - {% if page.extra.toc | default(value=false) %} - {% if page.toc %} + {%- if page.extra.toc | default(value=false) %} + {%- if page.toc -%}

Table of Contents

- {% endif %} - {% endif %} - + {%- endif -%} + {% endif -%}
- {{ page.content | safe }} + {{ page.content | safe -}}
- - {% if page.taxonomies and page.taxonomies.tags %} + {%- if page.taxonomies and page.taxonomies.tags %}
this post is tagged with
- {% endif %} + {% endif -%}
-{% endmacro content %} \ No newline at end of file +{% endmacro content -%} \ No newline at end of file diff --git a/templates/page.html b/templates/page.html index 56cf252..d69b521 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,4 @@ {% extends "base.html" %} - -{% block main_content %} -{{ post_macros::content(page=page)}} -{% endblock main_content %} \ No newline at end of file +{%- block main_content -%} +{{- post_macros::content(page=page) -}} +{%- endblock main_content -%} \ No newline at end of file diff --git a/templates/partials/footer.html b/templates/partials/footer.html index fabfbf5..c2edfca 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -1,8 +1,7 @@ \ No newline at end of file diff --git a/templates/partials/header.html b/templates/partials/header.html index afdaf07..fa936e3 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -3,74 +3,58 @@ - - {% set current_path = current_path | default(value="/") %} - + {%- set current_path = current_path | default(value="/") -%} {# Favicon #} - {% if config.extra.favicon %} - {% set favicon_ext = config.extra.favicon | split(pat=".") | last %} + {%- if config.extra.favicon -%} + {%- set favicon_ext = config.extra.favicon | split(pat=".") | last -%} - {% endif %} - - {% for font in config.extra.fonts %} - {% for style in ["Bold", "BoldItalic", "Italic", "Regular"] %} + {%- endif -%} + {% for font in config.extra.fonts -%} + {% for style in ["Bold", "BoldItalic", "Italic", "Regular"] -%} {% set font_path = '/font/' ~ font.path ~ '/' ~ font.name ~ '-' ~ style ~ '.woff2' %} - - {% endfor %} - {% endfor %} + + {%- endfor %} + {%- endfor %} - {# RSS #} - {% block rss %} - - {% endblock %} - + {%- block rss -%} + + {%- endblock -%} {# Theme #} - - - - - - {% if config.extra.stylesheets %} - {% for stylesheet in config.extra.stylesheets %} + + + + {%- if config.extra.stylesheets -%} + {%- for stylesheet in config.extra.stylesheets -%} - {% endfor %} - {% endif %} - - {% if current_path == "/" %} - {% set current_title = config.title | default(value="home") %} - {% set current_description = "the personal site of mat ess" %} - {% set hero = false %} - {% else %} - {% set current_title = page.title | default(value=config.title) | default(value="post") %} - {% set current_description = page.description | default(value="from the personal site of mat ess") %} - {% set hero = page.extra.hero | default(value=false) %} - {% endif %} - + {%- endfor -%} + {%- endif -%} + {%- if current_path == "/" -%} + {%- set current_title = config.title | default(value="home") -%} + {%- set current_description = "the personal site of mat ess" -%} + {%- set hero = false -%} + {%- else -%} + {%- set current_title = page.title | default(value=config.title) | default(value="post") -%} + {%- set current_description = page.description | default(value="from the personal site of mat ess") -%} + {%- set hero = page.extra.hero | default(value=false) -%} + {%- endif -%} {# Meta links #} {{ current_title }} - - {# Open Graph / Facebook #} + {#- Open Graph / Facebook #} - {% if hero %} + {%- if hero -%} - {% endif %} - - {# Twitter #} + {%- endif -%} + {#- Twitter #} - {% if hero %} + {%- if hero -%} - {% endif %} + {%- endif %} \ No newline at end of file diff --git a/templates/partials/nav.html b/templates/partials/nav.html index f514ee5..8e986a2 100644 --- a/templates/partials/nav.html +++ b/templates/partials/nav.html @@ -1,11 +1,12 @@
- {{ config.title }} + + + {{ config.title }} +
-