feat(breadcrumbs): add to posts and other pages

This commit is contained in:
taco 2026-04-10 19:20:08 -04:00
parent ab2e16865d
commit ab9618665e
No known key found for this signature in database
10 changed files with 122 additions and 28 deletions

22
_includes/_og.njk Normal file
View file

@ -0,0 +1,22 @@
{% if tags == "post" %}
<meta property="og:type" content="article" />
<meta property="og:url" content="https://mestizo.monster/{{ url }}" />
<meta property="article:author" content="https://mestizo.monster/about" />
<meta property="article:section" content="{{ section }}" />
{% for tag in keywords %}
<meta property="article:tag" content="{{ tag }}" />
{% endfor %}
<meta property="og:locale" content="en_US" />
<meta property="og:title" content="{{ title }} - mestizo.monster" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:image" content="https://mestizo.monster/img/taco.svg" />
<meta property="og:image:alt" content="a vector image of a smiling cartoon taco." />
{% else %}
<meta property="og:type" content="website" />
<meta property="og:url" content="https://mestizo.monster{{ page.url }}" />
<meta property="og:locale" content="en_US" />
<meta property="og:title" content="{{ title }} - mestizo.monster" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:image" content="https://mestizo.monster/img/taco.svg" />
<meta property="og:image:alt" content="a vector image of a smiling cartoon taco." />
{% endif %}

View file

@ -1,14 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" prefix="og: https://ogp.me/ns#">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% include "_og.njk" %}
<title>{{ title }} - mestizo.monster</title> <title>{{ title }} - mestizo.monster</title>
<link href="/css/main.css" rel="stylesheet" /> <link href="/css/main.css" rel="stylesheet" />
</head> </head>
<body> <body>
{% include "_header.njk" %} {% include "_header.njk" %}
<main>{{ content | safe }}</main> {{ content | safe }}
{% include "_footer.njk" %} {% include "_footer.njk" %}
</body> </body>
</html> </html>

11
_includes/main.njk Normal file
View file

@ -0,0 +1,11 @@
---
layout: base.njk
---
{% if title != "home" %}
<section>
<nav><a href="/">home</a> > <a href="{{ page.url }}">{{ title }}</a></nav>
</section>
{% endif %}
<main>{{ content | safe }}</main>

View file

@ -2,13 +2,19 @@
layout: base.njk layout: base.njk
--- ---
{{ content | safe }} <section>
<ul> <nav><a href="/">home</a> > <a href="{{ page.url }}">{{ title }}</a></nav>
{%- for post in ( collections.post | sortByDate ) -%} </section>
<li>
<a href="{{ post.url }}">{{ post.data.date }} - {{ post.data.title }}</a> <main>
({{ post.content | readingTime }})<br /> {{ content | safe }}
<em>{{ post.data.description }}</em> <ul>
</li> {%- for post in ( collections.post | sortByDate ) -%}
{%- endfor -%} <li>
</ul> <a href="{{ post.url }}">{{ post.data.date }} - {{ post.data.title }}</a>
({{ post.content | readingTime }})<br />
<em>{{ post.data.description }}</em>
</li>
{%- endfor -%}
</ul>
</main>

View file

@ -2,15 +2,44 @@
layout: base.njk layout: base.njk
--- ---
<article> {% set previousPost = collections.post | getPreviousCollectionItem %}
<hgroup> {% set nextPost = collections.post | getNextCollectionItem %}
<h1>{{ title }}</h1>
<p>{{ description }}</p> <section>
<ul> <nav>
<li><strong>author:</strong> <a href="/about">daniel a. gallegos (taco)</a></li> <a href="/">home</a> > <a href="/posts">posts</a> > <a href="{{ page.url }}">{{ title }}</a>
<li><strong>reading time:</strong> about {{ content | readingTime }}</li> </nav>
<li><strong>published:</strong> {{ date }}</li> </section>
</ul>
</hgroup> <main>
<section>{{ content | safe }}</section> <article>
</article> <hgroup>
<h1>{{ title }}</h1>
<p>{{ description }}</p>
<ul>
<li><strong>author:</strong> <a href="/about">daniel a. gallegos (taco)</a></li>
<li><strong>reading time:</strong> about {{ content | readingTime }}</li>
<li><strong>published:</strong> {{ date }}</li>
</ul>
</hgroup>
<section>{{ content | safe }}</section>
<nav>
<ol>
<li>
previously... <br />{% if previousPost %}
<a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a>
{% else %}
...not much.
{% endif %}
</li>
<li>
...up next<br />{% if nextPost %}
<a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a>
{% else %}
...who knows?
{% endif %}
</li>
</ol>
</nav>
</article>
</main>

View file

@ -1,7 +1,6 @@
--- ---
title: "about" title: "about"
layout: base.njk layout: main.njk
images: ["about/taco.png"]
description: "but who is taco? and how much does it weigh?" description: "but who is taco? and how much does it weigh?"
--- ---

View file

@ -64,6 +64,7 @@ a:visited {
nav { nav {
background-color: var(--color-dark-brown); background-color: var(--color-dark-brown);
color: var(--color-gray);
} }
h1, h1,
@ -90,7 +91,7 @@ a:visited {
footer { footer {
p { p {
font-size: 1.1em; font-size: 1.1em;
color: var(--color-dark-purple); color: var(--color-gray);
} }
} }
} }

View file

@ -66,6 +66,14 @@ article {
} }
} }
section {
nav {
margin-top: 1em;
padding: 1em;
border-radius: 0.42em;
}
}
article { article {
padding: 0.5em; padding: 0.5em;
hgroup { hgroup {
@ -75,7 +83,23 @@ article {
text-align: justify; text-align: justify;
} }
} }
nav {
ol {
list-style: none;
padding: 0;
margin: 0;
display: flex;
justify-content: space-between;
li:first-of-type {
text-align: left;
}
li:last-of-type {
text-align: right;
}
}
}
} }
blockquote { blockquote {
margin: 1em; margin: 1em;
padding: 1em; padding: 1em;

View file

@ -1,6 +1,6 @@
--- ---
title: "home" title: "home"
layout: base.njk layout: main.njk
description: "words by taco, the mestizo monster." description: "words by taco, the mestizo monster."
--- ---

View file

@ -22,6 +22,7 @@ keywords:
"life", "life",
"technology", "technology",
] ]
section: technology
images: ["posts/moving-on-from-freenom/header.png"] images: ["posts/moving-on-from-freenom/header.png"]
description: "what's the harm in a free domain name?" description: "what's the harm in a free domain name?"
aliases: ["../2023/10/06/moving-on-from-freenom/"] aliases: ["../2023/10/06/moving-on-from-freenom/"]