- Editorial web platform built with Node.js, Express, EJS, and Vanilla CSS - Markdown content engine with YAML frontmatter, bilingual variants, and hot-reload watcher - Unified SQLite with FTS5 search indexing, query logging, and schema filters - Centered editorial post layout with margin-docked left TOC and mobile bottom sheet - WordPress-grade comment system with moderation dashboard and bulk operations under /guanli - Complete SEO suite (JSON-LD structured data, RSS/Atom feeds, XML sitemap, robots.txt) - CI/CD workflows for linting, security audits (Gitleaks), automated tests, and Docker releases
18 lines
495 B
JavaScript
18 lines
495 B
JavaScript
module.exports = {
|
|
injectHead({ pluginConfig }) {
|
|
const trackingId = pluginConfig.tracking_id;
|
|
if (!trackingId) return '';
|
|
|
|
return `
|
|
<!-- Google Analytics (GA4 via Plugin) -->
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=${trackingId}"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', '${trackingId}');
|
|
</script>
|
|
`;
|
|
}
|
|
};
|