Files
andwati.com/templates/partials/head.html
T
andwati 3e1c643283 fix zola.toml config table scoping bug and JSON-LD safety
[[extra.menu]] silently swallowed ~20 later extra.* keys (posts_page_title,
search_placeholder, show_rss_link, notfound_*, etc.) into the last menu
entry/tag_descriptions table, since TOML absorbs bare keys into the last
open table until a new header appears. show_rss_link was the only visibly
broken one (RSS link missing from homepage); the rest were masked by
matching template defaults.

Also replaced Tera's default() filter with explicit if/else where values
feed into JSON-LD, since default()'s fallback gets escaped in a way `safe`
can't undo. Added author/dateModified to BlogPosting list entries.
2026-07-17 15:59:27 +03:00

101 lines
4.3 KiB
HTML

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<meta name="description" content="{% block description %}{{ config.description | default(value="Binary exploitation, reverse engineering, and offensive security blog.") }}{% endblock description %}">
<!-- Canonical URL -->
<link rel="canonical" href="{% block canonical %}{{ config.base_url }}{% endblock canonical %}">
<!-- Open Graph -->
<meta property="og:site_name" content="{{ config.title }}">
<meta property="og:title" content="{% block og_title %}{{ config.title }}{% endblock og_title %}">
<meta property="og:description" content="{% block og_description %}{{ config.description | default(value="Binary exploitation, reverse engineering, and offensive security blog.") }}{% endblock og_description %}">
<meta property="og:url" content="{% block og_url %}{{ config.base_url }}{% endblock og_url %}">
<meta property="og:type" content="{% block og_type %}website{% endblock og_type %}">
<meta property="og:locale" content="en_US">
{% block og_extra %}{% endblock og_extra %}
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="{{ config.extra.twitter_handle | default(value="@andwati_") }}">
<meta name="twitter:title" content="{% block twitter_title %}{{ config.title }}{% endblock twitter_title %}">
<meta name="twitter:description" content="{% block twitter_description %}{{ config.description | default(value="Binary exploitation, reverse engineering, and offensive security blog.") }}{% endblock twitter_description %}">
{% block twitter_extra %}{% endblock twitter_extra %}
<script>
(function() {
try {
var storedTheme = localStorage.getItem('theme');
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
var shouldUseDark = storedTheme ? storedTheme === 'dark' : prefersDark;
if (shouldUseDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
} catch (e) {
document.documentElement.classList.add('dark');
}
})();
</script>
<!-- SEO: WebSite + Person JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ config.base_url | safe }}/#website",
"url": "{{ config.base_url | safe }}/",
"name": {{ config.title | json_encode | safe }},
"description": {{ config.description | json_encode | safe }},
"inLanguage": "en-US",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "{{ config.base_url | safe }}/posts?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
},
{
"@type": "Person",
"@id": "{{ config.base_url | safe }}/#author",
"name": {{ config.extra.author | json_encode | safe }},
"url": "{{ config.base_url | safe }}/about/",
"sameAs": [
{% if config.extra.github_url %}"{{ config.extra.github_url | safe }}"{% if config.extra.twitter_url or config.extra.youtube_url %},{% endif %}{% endif %}
{% if config.extra.twitter_url %}"{{ config.extra.twitter_url | safe }}"{% if config.extra.youtube_url %},{% endif %}{% endif %}
{% if config.extra.youtube_url %}"{{ config.extra.youtube_url | safe }}"{% endif %}
]
}
]
}
</script>
{% if config.extra.google_analytics %}
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.extra.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config.extra.google_analytics }}');
</script>
{% endif %}
<!-- CSS -->
<link rel="stylesheet" href="{{ get_url(path="main.css") }}">
<link rel="stylesheet" href="{{ get_url(path="css/syntax.css") }}">
<!-- Fonts (self-hosted) -->
<link rel="stylesheet" href="{{ get_url(path="css/fonts.css") }}">
<!-- RSS Feed -->
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path="rss.xml") }}">
{% block head %}{% endblock head %}