upgrade to 3.0

This commit is contained in:
Kathleen Fitzpatrick
2024-10-14 19:27:15 -04:00
parent e8f8a543de
commit 655ad0ded8
1988 changed files with 47081 additions and 263 deletions

13
_includes/archive.njk Normal file
View File

@@ -0,0 +1,13 @@
<ul reversed>
{% for year, yearPosts in collections.postsByYear %}
<details><summary>{{ year }}</summary>
<ol reversed class="archivelist">
{% for post in yearPosts | reverse %}
<li class="archivelist-item{% if post.url == url %} archivelist-item-active{% endif %}">
<a href="{{ post.url }}" class="archivelist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a><br />
<time class="archivelist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("dd LLLL yyyy") }}</time>
</li>
{% endfor %}
</ol></details>
{% endfor %}
</ul>

View File

@@ -7,6 +7,13 @@
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
{#- Hyvor Talk #}
<script async src="https://talk.hyvor.com/embed/embed.js" type="module"></script>
{#- Webmentions #}
<link rel="webmention" href="https://webmention.io/kfitz.info/webmention" />
<link rel="pingback" href="https://webmention.io/kfitz.info/xmlrpc" />
{#- Uncomment this if youd like folks to know that you used Eleventy to build your site! #}
{#- <meta name="generator" content="{{ eleventy.generator }}"> #}
@@ -53,6 +60,15 @@
</nav>
</header>
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search", showSubResults: true });
});
</script>
<main id="skip">
<heading-anchors>
{{ content | safe }}
@@ -60,7 +76,7 @@
</main>
<footer>
<p><em>Built with <a href="https://www.11ty.dev/">{{ eleventy.generator }}</a></em></p>
<p><em>Built with <a href="https://www.11ty.dev/">{{ eleventy.generator }}</a></em>. All content <a href="https://creativecommons.org/licenses/by/4.0/deed.en">CC BY 4.0</a> if you're human.</p></p>
</footer>
<!-- This page `{{ page.url | htmlBaseUrl }}` was built on {% currentBuildDate %} -->

View File

@@ -1,16 +1,5 @@
---
layout: layouts/base.njk
---
<!-- Delete this block, which will also remove the component CSS from the bundle -->
{%- css %}{% include "public/css/message-box.css" %}{% endcss %}
<div class="message-box">
<ol>
<li>Edit <code>_data/metadata.js</code> with your blogs information.</li>
<li>(Optional) Edit <code>eleventy.config.js</code> with your <a href="https://www.11ty.dev/docs/config/">configuration preferences</a>.</li>
<li>Delete this message from <code>_includes/layouts/home.njk</code>.</li>
</ol>
<p><em>This is an <a href="https://www.11ty.dev/">Eleventy project</a> created from the <a href="https://github.com/11ty/eleventy-base-blog"><code>eleventy-base-blog</code> repo</a>.</em></p>
</div>
<!-- Stop deleting -->
{{ content | safe }}

View File

@@ -24,5 +24,10 @@ layout: layouts/base.njk
{%- if previousPost %}<li class="links-nextprev-prev">← Previous<br> <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}
{%- if nextPost %}<li class="links-nextprev-next">Next →<br><a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
</ul>
<hyvor-talk-comments website-id="9100" page-id="{{ permalink }}"></hyvor-talk-comments>
{% include 'webmentionlist.njk' %}
{%- endif %}
{%- endif %}

47
_includes/likes.njk Normal file
View File

@@ -0,0 +1,47 @@
{%- set likes = webmentions.children | likesForUrl(absoluteUrl) -%}
{%- set reposts = webmentions.children | repostsForUrl(absoluteUrl) -%}
{% if likes.length > 0 %}
<h4>{{ likes.length }} Like{% if likes.length != 1 %}s{% endif %}</h4>
<div class="webmentions__facepile">
{% for webmention in likes %}
{% if webmention.url != "" %}
<a class="h-card u-url link-u-exempt" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
{% endif %}
{% if webmention.author.photo %}
<img src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" loading="lazy" />
{% else %}
<img class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" />
{% endif %}
{% if webmention.url != "" %}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if reposts.length > 0 %}
<h4>{{ reposts.length }} Repost{% if reposts.length != 1 %}s{% endif %}</h4>
<div class="webmentions__facepile">
{% for webmention in reposts %}
{% if webmention.url != "" %}
<a class="h-card u-url link-u-exempt" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
{% endif %}
{% if webmention.author.photo %}
<img src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" loading="lazy" />
{% else %}
<img class="webmention__author__photo" src="{{ '/img/default_avatar.png' | url }}" alt="{{ webmention.author.name }}" title="{{ webmention.author.name }}" alt="" class="webmentions__face" />
{% endif %}
{% if webmention.url != "" %}
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}

26
_includes/webmention.njk Normal file
View File

@@ -0,0 +1,26 @@
<article class="webmention h-cite" id="webmention-{{ webmention['wm-id'] }}">
<div class="webmention__meta">
{% if webmention.author %}
<a class="webmention__author p-author h-card u-url" href="{{ webmention.url }}" target="_blank" rel="noopener noreferrer">
{% if webmention.author.photo %}
<img class="webmention__author__photo u-photo" src="{{ webmention.author.photo }}" alt="{{ webmention.author.name }}">
{% else %}
<img class="webmention__author__photo" src="{{ '/img/webmention-avatar-default.svg' | url }}" alt="">
{% endif %}
<strong class="p-name">{{ webmention.author.name }}</strong>
</a>
{% else %}
<span class="webmention__author">
<img class="webmention__author__photo" src="{{ '/img/webmention-avatar-default.svg' | url }}" alt="">
<strong>Anonymous</strong>
</span>
{% endif %}
{% if webmention.published %}
<time class="webmention__pubdate dt-published" datetime="{{ webmention.published }}">{{ webmention.published | dateFromTimestamp | readableDate("dd LLL yyyy - HH:mm") }}</time>
{% endif %}
</div>
<div class="webmention__content p-content">
{{ webmention.content.text | safe }}
</div>
</article>

View File

@@ -0,0 +1,22 @@
{%- set absoluteUrl -%}{{ page.url | url | absoluteUrl(metadata.url) }}{%- endset -%}
{%- set mentions = webmentions.children | mentionsForUrl(absoluteUrl) -%}
<div class="webmentions" id="webmentions">
<h3>Webmentions</h3>
{% if mentions | length %}
<h4>{{ mentions.length }} {% if mentions.length == "1" %}Reply{% else %}Replies{% endif %}</h4>
<ol class="webmentions__list">
{% for webmention in mentions | reverse %}
<li class="webmentions__item">
{% include 'webmention.njk' %}
</li>
{% endfor %}
</ol>
{% else %}
<p>No replies yet.</p>
{% endif %}
{% include 'likes.njk' %}
</div>