1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-16 18:23:16 +00:00

SEO: richer titles for 230 reference pages, categorized hub, cross-linking

Function pages ranked at pos 7-9 with 1.2% CTR (6.2k impressions/90d) and
the version pages sat at pos 22-24 with almost no internal links.

- Function/element pages: SERP title now "name — XPath function: syntax &
  examples" (one layout change, applies to all 230 pages)
- Reference hub: own title, intro copy, category sections with anchor nav
  (was a flat 230-item list ranking at pos 29.7)
- Cross-linking: version badge on every reference page links to its
  /xslt-2-0/ / /xslt-3-0/ page (~160 new internal links); version pages
  link back to the hub + 6 popular entries each; homepage links the hub

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgybX3QbAWVzb9ZnroCA79
This commit is contained in:
2026-07-02 21:06:01 +00:00
parent d42d22e168
commit e24ab01956
5 changed files with 60 additions and 7 deletions
+22 -6
View File
@@ -1,14 +1,30 @@
{{ define "title" }}XSLT &amp; XPath Function Reference — {{ len .Pages }}+ functions with runnable examples | {{ .Site.Title }}{{ end }}
{{ define "main" }}
<div class="page-header">
<h1>XSLT &amp; XPath Function Reference</h1>
<p class="lead">Complete reference for XSLT elements and XPath functions, organized by version. Each entry includes syntax, parameters, and runnable examples.</p>
<p class="lead">Complete reference for {{ len .Pages }}+ XSLT elements and XPath functions across XSLT 1.0, 2.0 and 3.0. Every entry includes the syntax, a plain-English description, and a runnable example you can open directly in the <a href="https://xsltplayground.com/">online XSLT editor</a> — no install needed.</p>
</div>
{{ $elements := where .Pages "Params.category" "element" }}
{{ $functions := where .Pages "Params.category" "ne" "element" }}
{{ $cats := slice }}
{{ range $functions }}{{ with .Params.category }}{{ $cats = $cats | append . }}{{ end }}{{ end }}
{{ $cats = uniq $cats | sort }}
<nav class="ref-toc" aria-label="Reference categories">
<strong>Jump to:</strong>
<a href="#xslt-elements">XSLT Elements ({{ len $elements }})</a>
{{ range $cats }}
<a href="#{{ . | urlize }}">{{ humanize . }}s ({{ len (where $functions "Params.category" .) }})</a>
{{ end }}
</nav>
<div class="content ref-intro">
<p>Looking for how a specific XSLT instruction or XPath function works? This reference covers the <strong>string, numeric, boolean, date, node, sequence, map, array, JSON and higher-order functions</strong> available in each XSLT version, plus every <strong>XSLT element</strong> from <code>xsl:template</code> to <code>xsl:accumulator</code>. Entries marked <em>XSLT 2.0</em> or <em>XSLT 3.0</em> require a processor such as Saxon — exactly what <a href="https://xsltplayground.com/">XSLT Playground</a> runs, so you can verify behaviour before shipping.</p>
</div>
{{ if $elements }}
<section class="ref-section">
<section class="ref-section" id="xslt-elements">
<h2>XSLT Elements</h2>
<ul class="ref-index-list">
{{ range $elements }}
@@ -22,11 +38,11 @@
</section>
{{ end }}
{{ if $functions }}
<section class="ref-section">
<h2>XPath Functions</h2>
{{ range $cat := $cats }}
<section class="ref-section" id="{{ $cat | urlize }}">
<h2>{{ humanize $cat }}s</h2>
<ul class="ref-index-list">
{{ range $functions }}
{{ range where $functions "Params.category" $cat }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ with .Params.versionLabel }}<span class="ref-badge ref-badge--sm">{{ . }}</span>{{ end }}
+7 -1
View File
@@ -1,9 +1,15 @@
{{ define "title" }}{{ .Title }} — {{ if eq .Params.category "element" }}XSLT element{{ else }}XPath function{{ end }}: syntax &amp; examples | {{ .Site.Title }}{{ end }}
{{ define "main" }}
<article class="post ref-page">
<p class="eyebrow">XSLT Reference</p>
<h1>{{ .Title }}</h1>
<div class="ref-meta">
{{ with .Params.versionLabel }}<span class="ref-badge">{{ . }}</span>{{ end }}
{{ with .Params.versionLabel }}
{{ $verUrl := "https://xsltplayground.com/" }}
{{ if eq . "XSLT 2.0" }}{{ $verUrl = "https://xsltplayground.com/xslt-2-0/" }}{{ end }}
{{ if eq . "XSLT 3.0" }}{{ $verUrl = "https://xsltplayground.com/xslt-3-0/" }}{{ end }}
<a class="ref-badge" href="{{ $verUrl }}" title="Test {{ . }} online">{{ . }}</a>
{{ end }}
{{ with .Params.category }}<span class="ref-badge ref-badge--cat">{{ . }}</span>{{ end }}
</div>
{{ with .Description }}<p class="lead">{{ . }}</p>{{ end }}