Files
pwnforfunandprofit.xyz/templates/base.html
T

254 lines
9.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<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 }}{% 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 }}{% 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">
<meta property="og:image" content="{% block og_image %}{{ config.base_url }}/images/og-image.png{% endblock og_image %}">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="{{ config.title }} — {{ config.description }}">
{% block og_extra %}{% endblock og_extra %}
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@andwati">
<meta name="twitter:title" content="{% block twitter_title %}{{ config.title }}{% endblock twitter_title %}">
<meta name="twitter:description" content="{% block twitter_description %}{{ config.description }}{% endblock twitter_description %}">
<meta name="twitter:image" content="{% block twitter_image %}{{ config.base_url }}/images/og-image.png{% endblock twitter_image %}">
{% block twitter_extra %}{% endblock twitter_extra %}
<!-- Theme initializer (runs before paint to avoid flash) -->
<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 (sitewide graph) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ config.base_url }}/#website",
"url": "{{ config.base_url }}/",
"name": "{{ config.title }}",
"description": "{{ config.description }}",
"inLanguage": "en-US"
},
{
"@type": "Person",
"@id": "{{ config.base_url }}/#author",
"name": "{{ config.extra.author | default(value="mockingspectre") }}",
"url": "{{ config.base_url }}/about/",
"sameAs": [
{% if config.extra.github_url %}"{{ config.extra.github_url }}"{% if config.extra.twitter_url %},{% endif %}{% endif %}
{% if config.extra.twitter_url %}"{{ config.extra.twitter_url }}"{% endif %}
]
}
]
}
</script>
{% if config.extra.google_analytics %}
<!-- Google Analytics — loaded only after cookie consent -->
<script>
// GA loader called by cookieconsent on consent
function loadGoogleAnalytics() {
if (window._gaLoaded) return;
window._gaLoaded = true;
var s = document.createElement('script');
s.async = true;
s.src = 'https://www.googletagmanager.com/gtag/js?id={{ config.extra.google_analytics }}';
document.head.appendChild(s);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
window.gtag = gtag;
gtag('js', new Date());
gtag('config', '{{ config.extra.google_analytics }}', { anonymize_ip: true });
}
</script>
{% endif %}
<!-- CookieConsent v3 (self-hosted) -->
<link rel="stylesheet" href="{{ get_url(path="css/cookieconsent.css") }}">
<script defer src="{{ get_url(path="js/cookieconsent.umd.js") }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (typeof CookieConsent === 'undefined') return;
CookieConsent.run({
cookie: { name: 'cc_cookie' },
// Mirror the site's html.dark class — banner switches with the theme toggle
darkMode: ['class', 'dark'],
guiOptions: {
consentModal: {
layout: 'bar inline',
position: 'bottom',
flipButtons: false,
equalWeightButtons: false
},
preferencesModal: {
layout: 'box',
position: 'right'
}
},
onConsent: function() {
if (CookieConsent.acceptedCategory('analytics')) {
if (typeof loadGoogleAnalytics === 'function') loadGoogleAnalytics();
}
},
onChange: function() {
if (CookieConsent.acceptedCategory('analytics')) {
if (typeof loadGoogleAnalytics === 'function') loadGoogleAnalytics();
}
},
categories: {
necessary: { enabled: true, readOnly: true },
analytics: {
enabled: false,
readOnly: false,
autoClear: { cookies: [{ name: /^(_ga|_gid|_gat)/ }] }
}
},
language: {
default: 'en',
translations: {
en: {
consentModal: {
title: 'We use cookies',
description: 'This site uses Google Analytics to understand how visitors interact with content. No personal data is sold or shared.',
acceptAllBtn: 'Accept',
acceptNecessaryBtn: 'Reject',
showPreferencesBtn: 'Manage preferences'
},
preferencesModal: {
title: 'Cookie preferences',
acceptAllBtn: 'Accept all',
acceptNecessaryBtn: 'Reject all',
savePreferencesBtn: 'Save preferences',
closeIconLabel: 'Close',
sections: [
{
title: 'Strictly necessary',
description: 'Required for the site to function. Cannot be disabled.',
linkedCategory: 'necessary'
},
{
title: 'Analytics',
description: 'Google Analytics — helps understand which content is most useful. No personal data sold.',
linkedCategory: 'analytics'
}
]
}
}
}
}
});
});
</script>
<!-- CookieConsent: emerald accent for both light and dark modes -->
<style>
/* Light mode */
#cc-main {
--cc-btn-primary-bg: #10b981;
--cc-btn-primary-color: #ffffff;
--cc-btn-primary-border-color: #10b981;
--cc-btn-primary-hover-bg: #059669;
--cc-btn-primary-hover-border-color: #059669;
--cc-toggle-on-bg: #10b981;
--cc-font-family: 'Outfit', sans-serif;
--cc-btn-border-radius: 6px;
--cc-modal-border-radius: 10px;
}
/* Dark mode — synced with html.dark via darkMode: ['class', 'dark'] */
#cc-main.cc--darkmode {
--cc-bg: #111111;
--cc-primary-color: #f4f4f5;
--cc-secondary-color: #a1a1aa;
--cc-btn-primary-bg: #10b981;
--cc-btn-primary-color: #ffffff;
--cc-btn-primary-border-color: #10b981;
--cc-btn-primary-hover-bg: #059669;
--cc-btn-primary-hover-border-color: #059669;
--cc-btn-secondary-bg: rgba(255,255,255,0.06);
--cc-btn-secondary-color: #a1a1aa;
--cc-btn-secondary-border-color: rgba(255,255,255,0.1);
--cc-btn-secondary-hover-bg: rgba(255,255,255,0.12);
--cc-btn-secondary-hover-color: #f4f4f5;
--cc-separator-border-color: rgba(255,255,255,0.1);
--cc-cookie-category-block-bg: rgba(255,255,255,0.04);
--cc-cookie-category-block-border: rgba(255,255,255,0.08);
--cc-toggle-on-bg: #10b981;
--cc-footer-bg: #0a0a0a;
--cc-footer-border-color: rgba(255,255,255,0.08);
}
/* Emerald top border, no default box-shadow */
#cc-main .cm,
#cc-main .pm { box-shadow: none !important; }
#cc-main .cm { border-top: 2px solid #10b981 !important; }
</style>
{% block head %}{% endblock head %}
<!-- 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") }}">
</head>
<body class="smooth-scroll">
<div class="site-container">
{% include "partials/header.html" %}
<main class="main-content">
{% block content %}{% endblock content %}
</main>
{% include "partials/footer.html" %}
</div>
<script src="{{ get_url(path="js/theme.js") }}"></script>
<script src="{{ get_url(path="js/copy-code.js") }}"></script>
{% block scripts %}{% endblock scripts %}
</body>
</html>