more tweaks
This commit is contained in:
parent
382fff5be3
commit
0dff2a250c
7 changed files with 36 additions and 14 deletions
src/handlers
static
templates
|
@ -79,6 +79,7 @@ pub async fn view(
|
||||||
|
|
||||||
let mut c = tera::Context::new();
|
let mut c = tera::Context::new();
|
||||||
c.insert("base_url", &state.base_url.to_string());
|
c.insert("base_url", &state.base_url.to_string());
|
||||||
|
c.insert("site_title", &state.settings.title);
|
||||||
c.insert("tag_slug", &tag);
|
c.insert("tag_slug", &tag);
|
||||||
c.insert("page", &ctx);
|
c.insert("page", &ctx);
|
||||||
c.insert("posts", &posts);
|
c.insert("posts", &posts);
|
||||||
|
|
|
@ -22,6 +22,7 @@ img {
|
||||||
pre {
|
pre {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
|
|
|
@ -3,8 +3,21 @@
|
||||||
<title>{{ site_title }}
|
<title>{{ site_title }}
|
||||||
{%- if tag %} - #{{ tag.slug }}{% endif -%}
|
{%- if tag %} - #{{ tag.slug }}{% endif -%}
|
||||||
</title>
|
</title>
|
||||||
|
<link href="{{ base_url | safe }}" type="text/html" />
|
||||||
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
|
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
|
||||||
<generator uri="{{ base_url | safe }}">tlxite</generator>
|
{%- if first_url %}
|
||||||
|
<link href="{{ first_url | safe }}" rel="first" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if last_url %}
|
||||||
|
<link href="{{ last_url | safe }}" rel="last" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if next_url %}
|
||||||
|
<link href="{{ next_url | safe }}" rel="next" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if previous_url %}
|
||||||
|
<link href="{{ previous_url | safe }}" rel="previous" />
|
||||||
|
{%- endif %}
|
||||||
|
<generator uri="{{ base_url | safe }}">tlxsite</generator>
|
||||||
<updated>{{ last_updated | date(format="%+") }}</updated>
|
<updated>{{ last_updated | date(format="%+") }}</updated>
|
||||||
<id>{{ feed_url | safe }}</id>
|
<id>{{ feed_url | safe }}</id>
|
||||||
{%- for post in posts %}
|
{%- for post in posts %}
|
||||||
|
|
|
@ -1,20 +1,25 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block main -%}
|
{% block main -%}
|
||||||
<article>
|
<article>
|
||||||
|
<header>
|
||||||
{% if page.title -%}
|
{% if page.title -%}
|
||||||
<h1>{{ page.title }}</h1>
|
<h1>{{ page.title }}</h1>
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% if page.date -%}
|
{% if page.date -%}
|
||||||
<small>
|
<small>
|
||||||
{%- if page.draft %}Draft {% endif -%}
|
{%- if page.draft %}Draft {% endif -%}
|
||||||
Published <time datetime="{{ page.date }}">{{ page.date | date(format="%F %R%:::z") }}</time>
|
Published <time datetime="{{ page.date }}">{{ page.date | date(format="%F %R%:::z") }}</time>
|
||||||
{%- if page.updated -%}
|
{%- if page.updated -%}
|
||||||
, Updated <time datetime="{{ page.updated }}">{{ page.updated | date(format="%F %R%:::z") }}</time>
|
, Updated <time datetime="{{ page.updated }}">{{ page.updated | date(format="%F %R%:::z") }}</time>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</small>
|
</small>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
{{ page.content | safe }}
|
{{ page.content | safe }}
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
{% if page.tags -%}
|
{% if page.tags -%}
|
||||||
<small>
|
<small>
|
||||||
<ul class="tags">
|
<ul class="tags">
|
||||||
|
@ -22,5 +27,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</small>
|
</small>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</article>
|
</footer>
|
||||||
{% endblock main -%}
|
</article>
|
||||||
|
{% endblock main -%}
|
|
@ -3,10 +3,10 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="color-scheme" content="light dark">
|
<meta name="color-scheme" content="light dark">
|
||||||
<link rel="alternate" type="application/rss+xml" href="{{base_url | safe}}atom.xml" title="{{ site_title }}">
|
<link rel="alternate" type="application/atom+xml" href="{{base_url | safe}}atom.xml" title="Sitewide feed">
|
||||||
{% if tag_slug -%}
|
{% if tag_slug -%}
|
||||||
<link rel="alternate" type="application/rss+xml" href="{{base_url | safe}}tags/{{ tag_slug }}/atom.xml"
|
<link rel="alternate" type="application/atom+xml" href="{{base_url | safe}}tags/{{ tag_slug }}/atom.xml"
|
||||||
title="{{ site_title }}: Posts tagged #{{ tag_slug }}">
|
title="Posts tagged #{{ tag_slug }}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<link rel="stylesheet" href="{{base_url | safe}}static/site.css">
|
<link rel="stylesheet" href="{{base_url | safe}}static/site.css">
|
||||||
<link rel="icon" type="image/png" href="{{base_url | safe}}static/avatar.png" />
|
<link rel="icon" type="image/png" href="{{base_url | safe}}static/avatar.png" />
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
<a href="{{base_url | safe}}"><img src="{{base_url | safe}}static/avatar.png" class="avatar" /></a>
|
<a href="{{base_url | safe}}"><img src="{{base_url | safe}}static/avatar.png" class="avatar" /></a>
|
||||||
<b><a href="{{base_url | safe}}">{{ site_title }}</a></b> - <a href="{{base_url | safe}}posts/">posts</a>
|
<b><a href="{{base_url | safe}}">{{ site_title }}</a></b> - <a href="{{base_url | safe}}posts/">posts</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
<hr style="border-style: dashed;">
|
||||||
</header>
|
</header>
|
|
@ -6,7 +6,7 @@
|
||||||
{% for child in page.children | filter(attribute="draft", value=false) | sort(attribute="date") | reverse -%}
|
{% for child in page.children | filter(attribute="draft", value=false) | sort(attribute="date") | reverse -%}
|
||||||
{% if child.title -%}
|
{% if child.title -%}
|
||||||
<li><a href="{{base_url | trim_end_matches(pat='/') | safe}}{{child.absolute_path | safe}}">{% if child.date -%}
|
<li><a href="{{base_url | trim_end_matches(pat='/') | safe}}{{child.absolute_path | safe}}">{% if child.date -%}
|
||||||
<time datetime="{{ child.date }}">{{ child.date | date(format="%Y-%m-%d") }}</time> – {{ child.title
|
<time datetime="{{ child.date }}">{{ child.date | date(format="%F") }}</time> – {{ child.title
|
||||||
-}}
|
-}}
|
||||||
{% else -%}
|
{% else -%}
|
||||||
{{ child.title -}}
|
{{ child.title -}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue