Create partials files

This commit is contained in:
TheThomaas 2023-11-13 21:20:55 +01:00
parent 7006a93819
commit 4cdf7bc064
7 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,5 @@
<time datetime="{{ definedDate | getDatetime }}">
{{
definedDate | toFullDate
}}
</time>

View file

@ -0,0 +1,40 @@
{% set activePage = page.url | url %}
<footer>
<nav id="footernav" aria-label="Footer">
{% year %} <a href="/" {% if activePage === '/' %} aria-current="page" {% endif %}>{{ meta.siteName }}</a>
{% for item in navigation.bottom %}
<a
href="{{ item.url }}"
{{
helpers.getLinkActiveState(item.url,
page.url)
|
safe
}}
>{{ item.text }}</a
>
{% endfor %}
</nav>
<nav id="social" aria-label="Social links">
{% for item in social %}
{% if item.platform == "rss" %}
<a href="{{ meta.url }}/{{ locale }}{{ item.url }}" rel="alternate" type="application/rss+xml">
{% else %}
<a href="{{ item.url }}" rel="me">
{% endif %}
<span class="sr-only">{{ item.platform }}</span>
<div aria-hidden="true">{% include 'icons/social-' + item.icon %}</div>
</a
>
{% endfor %}
</nav>
</footer>

View file

@ -0,0 +1,5 @@
<a href="#main" class="skip-link">{{ meta.skipContent }}</a>
<header>
{% include "partials/menu.njk" %}
</header>

View file

@ -0,0 +1,19 @@
<nav id="mainnav" aria-label="Main">
<ul>
{% for item in navigation.top %}
<li>
<a
class="nav"
href="{{ item.url }}"
{{
helpers.getLinkActiveState(item.url,
page.url)
|
safe
}}
>{{ item.text }}</a
>
</li>
{% endfor %}
</ul>
</nav>

View file

@ -0,0 +1,32 @@
<base href="{{ page.url }}" />
<meta
name="description"
content="
{% if description %}
{{ description }}
{% else %}
{{ meta.siteDescription }}
{% endif %}
"
/>
<meta name="theme-color" content="{{ meta.themeColor }}" />
<meta name="robots" content="index,follow" /><!-- All Search Engines -->
<meta name="googlebot" content="index,follow" /><!-- Google Specific -->
<meta name="generator" content="{{ eleventy.generator }}" /><!-- thank you, Zach -->
<!-- Disable automatic detection and formatting of possible phone numbers -->
<meta name="format-detection" content="telephone=no" />
<!-- Helps prevent duplicate content issues -->
<link rel="canonical" href="{{ meta.url }}{{ page.url }}" />
<!-- Links to information about the author(s) of the document -->
<link rel="author" href="humans.txt" />
<!-- Favicon -->
<link rel="icon" href="{{ '/favicon.ico' | url }}" sizes="any" />
<link rel="icon" href="{{ '/favicon.svg' | url }}" type="image/svg+xml" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ '/apple-touch-icon.png' | url }}" />
<link rel="icon" type="image/png" href="{{ '/favicon-32x32.png' | url }}" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ '/favicon-16x16.png' | url }}" sizes="16x16" />
<link rel="manifest" href="{{ '/site.webmanifest' | url }}" />

View file

@ -0,0 +1,14 @@
{% if postslist %}
<ul role="list">
{% asyncEach post in postslist %}
<li>
<h2>
<a href="{{ post.url | url }}">{{ post.data.title }}</a>
</h2>
{% set definedDate = post.date %} {% include "partials/date.njk" %}
{% set definedTags = post.data.tags %} {% include "partials/tags.njk" %}
<p>{{ post.data.description }}</p>
</li>
{% endeach %}
</ul>
{% endif %}

View file

@ -0,0 +1,7 @@
{% if definedTags %}
<ul>{% for tag in definedTags %}<li>
<a href="/tags/{{ tag | slug }}/">{{ tag | title }}</a>
</li>{% endfor %}</ul>
{% endif %}