Add sitemap v5.2.0 and social-meta-tags v0.3.0 plugins

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-18 23:44:37 +02:00
parent 2dc1790e47
commit cb5377c152
41 changed files with 3741 additions and 0 deletions
@@ -0,0 +1,17 @@
<image:image>
{% if image.loc %}
<image:loc>{{ url(image.loc, true) }}</image:loc>
{% endif %}
{% if image.caption %}
<image:caption>{{ image.caption }}</image:caption>
{% endif %}
{% if image.geoloc %}
<image:geo_location>{{ image.geoloc }}</image:geo_location>
{% endif %}
{% if image.title %}
<image:title>{{ image.title }}</image:title>
{% endif %}
{% if image.license %}
<image:license>{{ image.license }}</image:license>
{% endif %}
</image:image>
@@ -0,0 +1,8 @@
<news:news>
<news:publication>
<news:name>{{ site.title }}</news:name>
<news:language>{{ entry.lang }}</news:language>
</news:publication>
<news:publication_date>{{ entry.longdate }}</news:publication_date>
<news:title>{{ entry.title }}</news:title>
</news:news>
@@ -0,0 +1,19 @@
{% set sitemap_config = page.header.sitemap %}
<?xml version="1.0" encoding="UTF-8"?>
{% if config.plugins.sitemap.xsl_transform %}
<?xml-stylesheet type="text/xsl" href="{{ uri.rootUrl }}/user/plugins/sitemap/sitemap-news.xsl"?>
{% endif %}
<urlset
xmlns="{{ config.plugins.sitemap.urlset }}"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:news="{{ config.plugins.sitemap.urlnewsset }}">
{% for entry in sitemap %}
{% if timestamp_within_days(entry.timestamp, config.plugin.sitemap.news_max_age_days|default(2)) and
entry.rawroute|starts_with(sitemap_config.news_route ~ '/') %}
<url>
<loc>{{ entry.location|e }}</loc>
{% include 'sitemap-extensions/news.xml.twig' %}
</url>
{% endif %}
{% endfor %}
</urlset>
@@ -0,0 +1,31 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{% set language = grav.language %}
{% set lang = language.enabled ? (language.active ?: language.default) : null %}
{% set count = 1 %}
<table class="sitemap">
<thead>
<tr>
<th>#</th>
<th>{{ 'PLUGIN_SITEMAP.TITLE_TITLE'|t }}</th>
<th>{{ 'PLUGIN_SITEMAP.TITLE_LOCATION'|t }}</th>
<th>{{ 'PLUGIN_SITEMAP.TITLE_LASTMOD'|t }}</th>
</tr>
</thead>
<tbody>
{% for entry in sitemap %}
{% if lang is null or entry.lang == lang %}
<tr>
<td>{{ count }}</td>
<td><a href="{{ entry.location }}">{{ entry.title ?: 'PLUGIN_SITEMAP.UNTITLED'|t }}</a></td>
<td><a href="{{ entry.location }}">{{ entry.location }}</a></td>
<td>{{ entry.lastmod }}</td>
</tr>
{% set count = count + 1 %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% endblock %}
@@ -0,0 +1 @@
{{ (sort_sitemap_entries_by_language()|json_encode|raw) }}
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
{% if config.plugins.sitemap.xsl_transform %}
<?xml-stylesheet type="text/xsl" href="{{ uri.rootUrl }}/user/plugins/sitemap/sitemap.xsl"?>
{% endif %}
<urlset
xmlns="{{ config.plugins.sitemap.urlset }}"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:image="{{ config.plugins.sitemap.urlimageset }}"
{% if config.plugins.sitemap.include_news_tags %}
xmlns:news="{{ config.plugins.sitemap.urlnewsset }}"
{% endif %}>
{% for entry in sitemap %}
<url>
<loc>{{ entry.location|e }}</loc>
{% if config.plugins.sitemap.include_news_tags and
config.plugins.sitemap.standalone_sitemap_news == false and
timestamp_within_days(entry.timestamp, config.plugin.sitemap.news_max_age_days|default(2)) and
entry.rawroute|starts_with(config.plugins.sitemap.news_enabled_paths)
%}
{% include 'sitemap-extensions/news.xml.twig' %}
{% endif %}
{% for hreflang in entry.hreflangs %}
<xhtml:link rel="alternate" hreflang="{{ hreflang.hreflang }}" href="{{ hreflang.href }}" />
{% endfor %}
{% if entry.lastmod %}
<lastmod>{{ entry.lastmod }}</lastmod>
{% endif %}
{% if entry.changefreq %}
<changefreq>{{ entry.changefreq }}</changefreq>
{% endif %}
{% if entry.priority %}
<priority>{{ entry.priority|number_format(1) }}</priority>
{% endif %}
{% for image in entry.images %}
{% include 'sitemap-extensions/image.xml.twig' %}
{% endfor %}
</url>
{% endfor %}
</urlset>