w5isp.com/templates/base.html
Graham McIntire f57d3d945d
Initial site setup with Zola and zolanight theme
- Zola static site with zolanight theme
- Blog section with sample posts
- Projects section for listing external projects
- Custom index template showing latest post and recent posts list
2026-02-17 09:51:14 -06:00

74 lines
2.8 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") }}">
{% 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="") }}</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="") }}</a>
{% endfor %}
</nav>
</header>
<hr>
<main>
{% block content %}{% endblock content %}
</main>
<hr>
<footer>
</footer>
</body>
</html>