w5isp.com/templates/base.html
Graham McIntire 47b49fba99
Some checks failed
Build and Deploy / deploy (push) Failing after 31s
Strip surrounding slashes from nav link labels
2026-05-23 17:47:01 -05:00

93 lines
4.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
{% if page %}
{% if page.description %}
<meta name="description" content="{{ page.description }}">
{% endif %}
{% if page.taxonomies.tags %}
<meta name="keywords" content="{% for tag in page.taxonomies.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}">
{% endif %}
{% elif section %}
{% if section.description %}
<meta name="description" content="{{ section.description }}">
{% endif %}
{% if section.taxonomies.tags %}
<meta name="keywords" content="{% for tag in section.taxonomies.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}">
{% endif %}
{% endif %}
{% if page %}<link rel="canonical" href="{{ page.permalink }}" />
{% elif section %}<link rel="canonical" href="{{ section.permalink }}" />
{% else %}<link rel="canonical" href="{{ config.base_url }}" />
{% endif %}
<link rel="stylesheet" href="{{ get_url(path="style.css") }}">
<link rel="stylesheet" href="{{ get_url(path="overrides.css") }}">
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} - Atom" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} - RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
<!-- Privacy-friendly analytics by Plausible -->
<script async src="https://a.w5isp.com/js/pa-1S9-SH5BaakmzQOLB5zQw.js"></script>
<script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
plausible.init()
</script>
{% if config.extra.zolanight.google_analytics_id %}
<!-- Delayed Google Analytics loading -->
<script>
const loadGtag = () => {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config.extra.zolanight.google_analytics_id }}');
const script = document.createElement('script');
script.src = "https://www.googletagmanager.com/gtag/js?id={{ config.extra.zolanight.google_analytics_id }}";
script.defer = true;
document.head.appendChild(script);
};
window.addEventListener('scroll', loadGtag, { once: true });
window.addEventListener('mousemove', loadGtag, { once: true });
window.addEventListener('touchstart', loadGtag, { once: true });
</script>
{% endif %}
</head>
<body class="theme-{{ config.extra.zolanight.theme | default(value="tokyonight") }}">
{% set root_section = get_section(path="_index.md") %}
<header>
<nav>
<a href="/">home</a>
{# Render subsections #}
{% for subsection_path in root_section.subsections %}
{% set subsection = get_section(path=subsection_path) %}
<a href="{{ subsection.permalink }}">{{ subsection.permalink | replace(from=config.base_url, to="") | trim_start_matches(pat="/") | trim_end_matches(pat="/") }}</a>
{% endfor %}
{# Render pages at the root #}
{% for page in root_section.pages %}
<a href="{{ page.permalink }}">{{ page.permalink | replace(from=config.base_url, to="") | trim_start_matches(pat="/") | trim_end_matches(pat="/") }}</a>
{% endfor %}
</nav>
</header>
<hr>
<main>
{% block content %}{% endblock content %}
</main>
<hr>
<footer style="margin-top: 3rem;">
<p>&copy; Copyright Graham McIntire {{ now() | date(format="%Y") }}</p>
</footer>
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<script>
kofiWidgetOverlay.draw('w5isp', {
'type': 'floating-chat',
'floating-chat.donateButton.text': 'Support me',
'floating-chat.donateButton.background-color': '#323842',
'floating-chat.donateButton.text-color': '#fff'
});
</script>
</body>
</html>