everything seems to be cool

This commit is contained in:
Joe Ardent 2023-01-07 19:13:01 -08:00
parent 121fc6981e
commit f5782a384d
15 changed files with 41 additions and 336 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.jpg
public/

View File

@ -12,9 +12,11 @@ build_search_index = true
generate_feed = true
taxonomies = [
{name = "tags"},
{name = "tags", feed = true},
]
theme = "apollo"
[markdown]
# Whether to do syntax highlighting
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
@ -31,11 +33,11 @@ socials = [
toc = true
use_cdn = false
favicon = "/icon/favicon.png"
theme = "auto"
menu = [
{ name = "R&D", url = "/rnd", weight = 1 },
{ name = "sundries", url = "/sundries", weight = 2 },
{ name = "about", url = "/about", weight = 3 },
{ name = "home", url = "/", weight = 4 },
{ name = "tags", url = "/tags", weight = 5 }
]

View File

@ -1,7 +1,10 @@
+++
toc = true
title = "From the Desk of the Head of R&D and Chief Sundries Officer"
sort_by = "date"
generate_feed = true
toc = true
[extra]
toc = true
+++

View File

@ -1,4 +1,7 @@
+++
title = "Speculative Work, by NebCorp HIAS"
sort_by = "date"
toc = true
[extra]
#section_path = "posts/_index.md"
toc = true
+++

View File

@ -2,4 +2,7 @@
title = "Sundries, by NebCorp HIAS"
sort_by = "date"
path = "sundries"
toc = true
[extra]
toc = true
+++

View File

@ -2,8 +2,8 @@
title = "A Very Digital Artifact"
slug = "a-very-digital-artifact"
date = "2022-11-11"
#[taxonomies]
#tags = ["3dprinting", "CAD", "GIS", "CNC", "art", "sundries"]
[taxonomies]
tags = ["3dprinting", "CAD", "GIS", "CNC", "art", "sundries"]
+++
![a CNC-carved exaggerated relief of California made of plywood](PXL_20220723_214758454.jpg)

View File

@ -1,8 +0,0 @@
{% extends "page.html" %}
{% block main_content %}
<main class="centered-header">
{{ post_macros::page_header(title="404")}}
<span>Page not found :(</span>
</main>
{% endblock main_content %}

View File

@ -1,35 +0,0 @@
{% extends "base.html" %}
{% block main_content %}
{% if section.extra.section_path -%}
{% set section = get_section(path=section.extra.section_path) %}
{% endif -%}
{{ post_macros::page_header(title=section.title) }}
<main>
{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{%- set show_pages = section.pages -%}
{% endif -%}
{{ post_macros::cards_posts(pages=show_pages) }}
</main>
{% if paginator %}
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}
{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
{% endif %}
{% endblock main_content %}

View File

@ -1,180 +0,0 @@
{% macro list_posts(pages) %}
<ul>
{%- for page in pages %}
<section class="list-item">
<h1 class="title">
<a href={{ page.permalink }}>{{page.title}}</a>
</h1>
<div class="meta">
{%- if page.date %}
<time>{{ page.date | date(format="%Y-%m-%d") }}</time>
{% endif -%}
{% if page.draft %}
<span class="draft-label">DRAFT</span>
{% endif %}
</div>
<br />
<div class="description">
{% if page.description %}
{{ page.description }}
{% elif page.summary %}
{{ page.summary | safe }}&hellip;
{% else %}
{% set hide_read_more = true %}
{% endif %}
</div>
{% if not hide_read_more %}
<a class="readmore" href={{ page.permalink }}>Read more ⟶</a>
{% endif %}
</section>
{% endfor -%}
</ul>
{% endmacro list_posts %}
{% macro tags(page, short=false) %}
{%- if page.taxonomies and page.taxonomies.tags %}
<span class="post-tags-inline">
{%- if short %}
::
{%- set sep = "," -%}
{% else %}
:: tags:&nbsp;
{%- set sep = "&nbsp;" -%}
{% endif -%}
{%- for tag in page.taxonomies.tags %}
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}">#{{ tag }}</a>
{%- if not loop.last %}{{ sep | safe }}{% endif -%}
{% endfor -%}
</span>
{% endif -%}
{% endmacro tags %}
{% macro page_header(title) %}
<div class="page-header">
{{ title }}<span class="primary-color" style="font-size: 1.6em">.</span>
</div>
{% endmacro content %}
{% macro content(page) %}
<main>
<article>
<div class="title">
{#<h1 class="title">{{ page.title }}</h1>#}
{{ post_macros::page_header(title=page.title) }}
<div class="meta">
{% if page.date %}
Posted on <time>{{ page.date | date(format="%Y-%m-%d") }}</time>
{% endif %}
{% if page.draft %}
<span class="draft-label">DRAFT</span>
{% endif %}
</div>
</div>
{% if page.extra.tldr %}
<div class="tldr">
<strong>tl;dr:</strong>
{{ page.extra.tldr }}
</div>
{% endif %}
{# Optional table of contents #}
{% if config.extra.toc | default(value=false) %}
{% if page.toc %}
<h1>Table of Contents</h1>
<ul>
{% for h1 in page.toc %}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{% if h1.children %}
<ul>
{% for h2 in h1.children %}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{% if h2.children %}
<ul>
{% for h3 in h2.children %}
<li>
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
<section class="body">
{{ page.content | safe }}
</section>
{% if page.taxonomies and page.taxonomies.tags %}
<div class="post-tags">
<nav class="nav tags">
<ul class="tags">
{% for tag in page.taxonomies.tags %}
<li><a href={{ get_taxonomy_url(kind='tags', name=tag) | safe }}>{{ tag }}</a></li>
{% endfor %}
</ul>
</nav>
</div>
{% endif %}
</article>
</main>
{% endmacro content %}
{% macro cards_posts(pages) %}
<div class="cards">
{%- for page in pages %}
<div class="card">
{% if page.extra.local_image %}
<img class="card-image" alt={{ page.extra.local_image }} src="{{ get_url(path=page.extra.local_image) }}">
{% elif page.extra.remote_image %}
<img class="card-image" alt={{ page.extra.remote_image }} src="{{ page.extra.remote_image }}">
{% else %}
<div class="card-image-placeholder"></div>
{% endif %}
<div class="card-info">
<h1 class="card-title">
{% if page.extra.link_to %}
<a href={{ page.extra.link_to }}>{{page.title}}</a>
{% else %}
<a href={{ page.permalink }}>{{page.title}}</a>
{% endif %}
</h1>
<div class="meta">
{%- if page.date %}
<time>{{ page.date | date(format="%Y-%m-%d") }}</time>
{% endif -%}
{% if page.draft %}
<span class="draft-label">DRAFT</span>
{% endif %}
</div>
<div class="card-description">
{% if page.description %}
{{ page.description }}
{% endif %}
</div>
</div>
</div>
{% endfor -%}
</div>
{% endmacro cards_posts %}

View File

@ -1,5 +0,0 @@
{% extends "base.html" %}
{% block main_content %}
{{ post_macros::content(page=page)}}
{% endblock main_content %}

View File

@ -1,67 +0,0 @@
{% import "macros/macros.html" as post_macros %}
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# Site title #}
{% set current_path = current_path | default(value="/") %}
{% if current_path == "/" %}
<title>
{{ config.title | default(value="Home") }}
</title>
{% else %}
<title>
{{ page.title | default(value=config.title) | default(value="Post") }}
</title>
{% endif %}
{# Favicon #}
{% if config.extra.favicon %}
<link rel="icon" type="image/png" href={{ config.extra.favicon }} />
{% endif %}
{# Font from cdn or disk #}
{% if config.extra.use_cdn | default(value=false) %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jetbrains-mono@1.0.6/css/jetbrains-mono.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/space-grotesk@4.5.8/index.min.css">
{% else %}
<link href={{ get_url(path="fonts.css") }} rel="stylesheet" />
{% endif %}
{# Analytics #}
{% if config.extra.analytics.enabled and config.extra.analytics.goatcounter_user %}
{% set user = config.extra.analytics.goatcounter_user %}
{% set host = config.extra.analytics.goatcounter_host | default(value="goatcounter.com") %}
<script data-goatcounter="https://{{ user }}.{{ host }}/count" async src="{{ get_url(path="js/count.js") }}"></script>
<noscript>
{# EasyList blocks '.com/count?', so we have to use '.com//count' #}
<img src="https://{{ user }}.{{ host }}//count?p={{ current_path }}&t={{ page.title | default(value=config.title) }}">
</noscript>
{% endif %}
{# RSS #}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
{# Theme #}
{% set theme = config.extra.theme | default(value="light") %}
{% if theme == "dark" %}
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/dark.css") }}"/>
{% elif theme == "light" %}
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/light.css") }}"/>
{% elif theme == "auto" %}
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/light.css") }}"/>
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/dark.css") }}" media="(prefers-color-scheme: dark)"/>
{% endif %}
<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css") }} />
{% if config.extra.stylesheets %}
{% for stylesheet in config.extra.stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
{% endfor %}
{% endif %}
</head>

View File

@ -1,35 +0,0 @@
{% extends "base.html" %}
{% block main_content %}
{% if section.extra.section_path -%}
{% set section = get_section(path=section.extra.section_path) %}
{% endif -%}
{{ post_macros::page_header(title=section.title) }}
<main class="list">
{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{%- set show_pages = section.pages -%}
{% endif -%}
{{ post_macros::list_posts(pages=show_pages) }}
</main>
{% if paginator %}
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}
{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
{% endif %}
{% endblock main_content %}

15
templates/tags/list.html Normal file
View File

@ -0,0 +1,15 @@
{% extends "index.html" %}
{% block main_content %}
{%- set title = "Tags" %}
<ul>
{% for tag in terms %}
<h2>
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag.name) | safe }}">#{{ tag.name }}</a> <sup>{{ tag.pages | length }}</sup>
</h2>
{% endfor %}
</ul>
{% endblock main_content %}

View File

@ -0,0 +1,8 @@
{% extends "index.html" %}
{% block main_content %}
{{ post_macros::list_posts(pages = term.pages) }}
{% endblock main_content %}