mirror of
https://github.com/max-sixty/worktrunk.git
synced 2026-09-14 20:00:38 +08:00
56d7bb825d
Search Console flagged two indexing issues on worktrunk.dev: **"Alternate page with proper canonical tag"**: the sitemap listed `/worktrunk/`, which canonicalizes to `/` (its content is rendered on the homepage via `templates/index.html`). Only canonicals belong in a sitemap. Skip sitemap entries whose frontmatter declares a canonical. **"Page with redirect"**: the `extra_menu` links `/worktrunk` and `/tips-patterns` had no trailing slash, so every page's nav triggered a 301 on GitHub Pages. Added the trailing slashes. Verified locally with `zola build`: sitemap goes from 14 to 13 entries (no more `/worktrunk/`), `/worktrunk/` page still served with canonical = `/`, and built nav hrefs now have trailing slashes. Search Console also reported "Not found (404)" — those are old renamed URLs (`/why-worktrunk/`, `/quickstart/`, `/advanced/`) that no longer exist. Left alone here: a static 404 is correct, and adding meta-refresh redirect stubs would just create new "Page with redirect" entries. > _This was written by Claude Code on behalf of @max-sixty_ Co-authored-by: Claude <noreply@anthropic.com>
17 lines
564 B
XML
17 lines
564 B
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
{%- for sitemap_entry in entries %}
|
|
{#- Skip pages that declare a non-self canonical — only canonical URLs belong in the sitemap. #}
|
|
{%- if not sitemap_entry.extra.canonical %}
|
|
<url>
|
|
<loc>{{ sitemap_entry.permalink | escape_xml | safe }}</loc>
|
|
{%- if sitemap_entry.updated %}
|
|
<lastmod>{{ sitemap_entry.updated }}</lastmod>
|
|
{%- else %}
|
|
<lastmod>{{ now() | date(format="%Y-%m-%d") }}</lastmod>
|
|
{%- endif %}
|
|
</url>
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
</urlset>
|