SEO and Analytics

SEO and Analytics

Purpose

This document records the search, social preview, structured data, and analytics architecture for the Project Forge GitHub Pages site.

Implementation Inventory

The SEO and analytics foundation consists of:

Public Markdown files carry empty front matter so GitHub Pages processes them through the shared metadata layout. Their prose is unchanged.

Initial Audit Findings

The pre-implementation audit found:

Analytics Architecture

Project Forge uses Google Analytics 4 through the official Google tag with Measurement ID G-7PNR30M2QP.

The tag is kept in _includes/analytics.html and is included by _includes/seo-head.html, so GitHub Pages renders it into every page that uses the site metadata head. The script loads asynchronously and initializes gtag once per page.

Custom analytics helpers live in js/forge-analytics.js. The helper exposes:

Each helper checks whether gtag is available before sending. If analytics is blocked, unavailable, or still loading, the helper does nothing.

Custom GA4 events:

The helper also observes link clicks for downloads, external links, and optional data-analytics-document or data-analytics-module attributes.

SEO Architecture

Shared metadata is rendered by _includes/seo-head.html.

The head includes:

Markdown pages use _layouts/page.html. Page-specific metadata is stored in _data/page_metadata.yml so technical documents can receive accurate titles, descriptions, and canonical paths without changing the documents themselves.

Structured Data

Every page receives JSON-LD with:

Technical repository and module pages may additionally receive SoftwareSourceCode when their metadata marks them as source-code surfaces.

The structured data uses canonical https://projectforge.dk URLs and the default Open Graph image.

Sitemap

sitemap.xml lists public pages using canonical URLs. Dot-directories, Python caches, and local test artifacts are excluded.

The sitemap is static and dependency-free. When public pages are added or removed, update _data/page_metadata.yml and sitemap.xml together.

robots.txt

robots.txt allows crawling and points crawlers at the sitemap:

User-agent: *
Allow: /

Sitemap: https://projectforge.dk/sitemap.xml

Metadata Strategy

Metadata describes what each page actually contains. It avoids fabricated keywords, promotional language, and claims about runtime behavior that does not exist yet.

Descriptions should identify the page as part of Project Forge’s scientific software architecture and ecosystem for long-lived computational platforms only when that accurately describes the page.

Search Engine Verification

Verification tokens are configured in _data/seo.yml:

Add the token value there and GitHub Pages will render the corresponding meta tag across pages that use the shared SEO head.

GitHub Pages Notes

GitHub Pages supplies the HTTP cache and MIME headers for static files. This site does not add a service worker or client-side cache layer because that would increase JavaScript surface area without being necessary for the current static site.