[SPIP] ~spip v3.2.0-->v3.2.1
[lhc/web/www.git] / www / squelettes-dist / sitemap.xml.html
1 [(#REM)
2
3 Exemple tres simple de sitemap.xml accessible via URL_SITE_SPIP/sitemap.xml
4 (copier htaccess.txt en .htaccess pour en beneficier)
5
6 Ce sitemap affiche la liste des rubriques, breves et articles, en se limitant a 1000 rubriques, 1000 breves et 2000 articles pour des raisons
7 de performances.
8
9 Duree de reindexation et priorite ne sont pas precisees,
10 sauf pour l'accueil.
11
12 Mais si date_modif est recente (1 jour) on l'indique, pour que ce
13 soit reindexe en priorite
14
15 un critère annee permet de lister les articles d'une année pour contourner la limite de 2000 items du sitemap general
16 sitemap.xml?annee=1981
17
18
19 (On pose un cache a zero pour echapper au test _IS_BOT)
20
21 ]#HTTP_HEADER{Content-Type: text/xml; charset=utf-8}
22 <?xml version="1.0" encoding="UTF-8"?>
23 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
24
25 [(#REM) Accueil]
26 <url>
27 <loc>#URL_SITE_SPIP/</loc>
28 <changefreq>hourly</changefreq>
29 </url>
30
31 [(#REM) Rubriques]
32 <BOUCLE_r(RUBRIQUES){!par date}{0,1000}{si #ENV{annee}|non}>
33 <url>
34 [<loc>(#URL_RUBRIQUE|url_absolue)</loc>]
35 </url>
36 </BOUCLE_r>
37
38 [(#REM) Articles]
39 [(#SET{recent,[(#VAL{Y-m-d H:i:s}|date{#VAL{"-1 day"}|strtotime})]})]
40 <BOUCLE_a(ARTICLES){annee?}{!par date_modif}{!par date}{0,2000}>
41 <url>
42 [<loc>(#URL_ARTICLE|url_absolue)</loc>]
43 <BOUCLE_a_trad(ARTICLES){traduction}>
44 <xhtml:link rel="alternate" hreflang="[(#LANG)]" href="[(#URL_ARTICLE|url_absolue)]" />
45 </BOUCLE_a_trad>
46 [(#DATE_MODIF**|>{#GET{recent}}
47 |?{[<lastmod>(#DATE_MODIF**|date_iso)</lastmod>]})]
48 </url>
49 </BOUCLE_a>
50
51 [(#REM) Breves]
52 <BOUCLE_b(BREVES){annee?}{!par date}{0,1000}>[
53 <url><loc>(#URL_BREVE|url_absolue)</loc></url>]</BOUCLE_b>
54
55 [(#REM) Extensions de sitemap par des plugins]
56 <BOUCLE_objets(DATA){source table,#REM|lister_tables_objets_sql}{si #ENV{annee}|non}>
57 #SET{fond,#VAL{sitemap-}|concat{#VALEUR{table_objet}}}
58 [(#GET{fond}|trouver_fond|oui)#INCLURE*{fond=#GET{fond}}]
59 </BOUCLE_objets>
60
61 </urlset>