Styling updates and add social links

This commit is contained in:
cheddar 2025-04-18 11:28:28 -04:00
parent eafe6648cc
commit a2cb0960ab
No known key found for this signature in database
15 changed files with 135 additions and 23 deletions

View file

@ -1,10 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% if title %}{{ title }} - {% endif %}{{ metadata.title }}</title>
<link rel="stylesheet" href="/styles.css">
</head>
<body>
{{ content | safe }}
<footer>{% include "site_nav.njk" %}</footer>
<hr>
<footer>
{% include "site_nav.njk" %}
{% include "socials.njk" %}
</footer>
</body>
</html>

View file

@ -3,13 +3,15 @@ layout: layouts/base.njk
---
<article>
<h1>{{ title }}</h1>
<address>by <a href="{{ author.url or metadata.author.url }}">
{{ author.name or metadata.author.name }}
</a></address>
<time datetime="{{ page.date | htmlDateString }}">published {{ page.date | readableDate }}</time>
{% if series %}
<aside>This article is part of a series: <a href="#seriesNav">{{ series.name }}</a></aside>
{% endif %}
<div class="about">
<address>by <a href="{{ author.url or metadata.author.url }}">
{{ author.name or metadata.author.name }}
</a></address>
<time datetime="{{ page.date | htmlDateString }}">published {{ page.date | readableDate }}</time>
{% if series %}
<aside>This article is part of a series - <a href="#seriesNav">{{ series.name }}</a></aside>
{% endif %}
</div>
{{ content | safe }}
</article>
{% if collections.posts %}
@ -17,14 +19,15 @@ layout: layouts/base.njk
{% set nextPost = collections.posts | getNextCollectionItem %}
{% if nextPost or previousPost %}
<nav name="Article Navigation">
<ol>
{% if previousPost %}<li><a href="{{ previousPost.url}}">{{ previousPost.data.title }}</a></li>{% endif %}
{% if nextPost %}<li><a href="{{ nextPost.url}}">{{ nextPost.data.title }}</a></li>{% endif %}
<ol class="simple-list">
{% if previousPost %}<li>Previous: <a href="{{ previousPost.url}}">{{ previousPost.data.title }}</a></li>{% endif %}
{% if nextPost %}<li>Next: <a href="{{ nextPost.url}}">{{ nextPost.data.title }}</a></li>{% endif %}
</ol>
</nav>
{% endif %}
{% endif %}
{% if series %}
<hr>
{% set seriesName = series.name %}
<nav name="Series Name Directory" id="seriesNav">{% include "series_list.njk" %}</nav>
{% endif %}

View file

@ -1,4 +1,8 @@
<a {%if page.url == post.url %}class="current-page"{% endif %}
href="{{ post.url }}">{{ post.data.title }}</a>
<time datetime="{{ post.date | htmlDateString }}">{{ post.date | htmlDateString }}</time>
{% if post.data.description %}<p>{{ post.data.description }}</p>{% endif %}
<li class="post-link">
<a {%if page.url == post.url %}class="current-page"{% endif %}
href="{{ post.url }}">{{ post.data.title }}</a>
{% if post.data.description %}<p>{{ post.data.description }}</p>
{% elseif post.data.series %}<p>- {{ post.data.series.name }}</p>
{% endif %}
<p><time datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time></p>
</li>

View file

@ -1,6 +1,6 @@
<ol>
{%- for post in collections.posts %}
<li>{% include "post_link.njk" %}</li>
<ol reversed>
{%- for post in collections.posts | reverse %}
{% include "post_link.njk" %}
{%- endfor %}
</ol>

View file

@ -1,6 +1,6 @@
<h2>{{ seriesName }}</h2>
<ol>
{%- for post in collections.posts | seriesPosts(seriesName) %}
<li>{% include "post_link.njk" %}</li>
{% include "post_link.njk" %}
{%- endfor %}
</ol>

View file

@ -1,5 +1,5 @@
<nav name="Site Navigation">
<ul>
<nav name="Site Navigation" class="site-nav">
<ul class="simple-list">
{% for sitePage in collections.site_nav %}
<li><a href="{{ sitePage.url }}">{{ sitePage.data.title }}</a></li>
{% endfor %}

9
_includes/socials.njk Normal file
View file

@ -0,0 +1,9 @@
<nav name="Social Links" class="socials">
<ul class="simple-list">
<li><a href="#" title="Posts RSS Feed"><img src="/img/feed-icon.svg"></a></li>
<li><a href="https://forge.crispbyte.dev/cheddar" title="Git Profile"><img src="/img/git-icon.svg"></a></li>
<li><a href="https://hachyderm.io/@cheddarcrisp" rel="me" title="Mastodon Profile">
<img src="/img/mastodon-icon.svg">
</a></li>
</ul>
</nav>

76
_includes/styles/base.css Normal file
View file

@ -0,0 +1,76 @@
html,
body {
padding: 0;
margin: 0 auto;
}
html {
overflow-y: scroll;
}
body {
max-width: 660px;
}
h1 {
font-size: 32px;
}
h2 {
font-size: 24px;
}
ol {
margin: 0;
padding-left: 20px;
}
hr {
margin: 20px 0 0 0;
}
article > h1 {
margin-bottom: 0;
}
nav > h2 {
margin-bottom: 0;
}
nav > ul {
margin: 10px;
}
footer {
margin: 20px 0;
}
footer img {
height: 24px;
}
.about {
font-size: 14px;
margin-left: 12px;
}
.simple-list {
list-style: none;
padding: 0;
}
.site-nav > ul {
display: flex;
justify-content: space-between;
}
.socials > ul {
display: flex;
gap: 12px;
}
.post-link {
margin-bottom: 12px;
}
.post-link > p {
margin: 0;
}