Server : Apache System : Linux webd348.cluster026.gra.hosting.ovh.net 5.15.148-ovh-vps-grsec-zfs-classid #1 SMP Thu Feb 8 09:41:04 UTC 2024 x86_64 User : hednacluml ( 122243) PHP Version : 8.3.9 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/hednacluml/ecrire/squelettes-dist/ |
[(#REM) Exemple tres simple de sitemap.xml accessible via URL_SITE_SPIP/sitemap.xml (copier htaccess.txt en .htaccess pour en beneficier) Ce sitemap affiche la liste des rubriques, breves et articles, en se limitant a 1000 rubriques, 1000 breves et 2000 articles pour des raisons de performances. Duree de reindexation et priorite ne sont pas precisees, sauf pour l'accueil. Mais si date_modif est recente (1 jour) on l'indique, pour que ce soit reindexe en priorite un critère annee permet de lister les articles d'une année pour contourner la limite de 2000 items du sitemap general sitemap.xml?annee=1981 (On pose un cache a zero pour echapper au test _IS_BOT) ]#HTTP_HEADER{Content-Type: text/xml; charset=utf-8} <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> [(#REM) Accueil] <url> <loc>#URL_SITE_SPIP/</loc> <changefreq>hourly</changefreq> </url> [(#REM) Rubriques] <BOUCLE_r(RUBRIQUES){!par date}{0,1000}{si #ENV{annee}|non}> <url> [<loc>(#URL_RUBRIQUE|url_absolue)</loc>] </url> </BOUCLE_r> [(#REM) Articles] [(#SET{recent,[(#VAL{Y-m-d H:i:s}|date{#VAL{"-1 day"}|strtotime})]})] <BOUCLE_a(ARTICLES){annee?}{!par date_modif}{!par date}{0,2000}> <url> [<loc>(#URL_ARTICLE|url_absolue)</loc>] <BOUCLE_a_trad(ARTICLES){traduction}> <xhtml:link rel="alternate" hreflang="[(#LANG)]" href="[(#URL_ARTICLE|url_absolue)]" /> </BOUCLE_a_trad> [(#DATE_MODIF**|>{#GET{recent}} |?{[<lastmod>(#DATE_MODIF**|date_iso)</lastmod>]})] </url> </BOUCLE_a> [(#REM) Breves] <BOUCLE_b(BREVES?){annee?}{!par date}{0,1000}>[ <url><loc>(#URL_BREVE|url_absolue)</loc></url>]</BOUCLE_b> [(#REM) Extensions de sitemap par des plugins] <BOUCLE_objets(DATA){source table,#REM|lister_tables_objets_sql}{si #ENV{annee}|non}> #SET{fond,#VAL{sitemap-}|concat{#VALEUR{table_objet}}} [(#GET{fond}|trouver_fond|oui)#INCLURE*{fond=#GET{fond}}] </BOUCLE_objets> </urlset>