[SPIP][PLUGINS] v3.0-->v3.2
[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 (On pose un cache a zero pour echapper au test _IS_BOT)
16
17 ]#HTTP_HEADER{Content-Type: text/xml; charset=utf-8}
18 <?xml version="1.0" encoding="UTF-8"?>
19 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
20
21 [(#REM) Accueil]
22 <url>
23 <loc>#URL_SITE_SPIP/</loc>
24 <changefreq>hourly</changefreq>
25 </url>
26
27 [(#REM) Rubriques ]
28 <BOUCLE_r(RUBRIQUES){!par date}{0,1000}>
29 <url>
30 [<loc>(#URL_RUBRIQUE|url_absolue)</loc>]
31 </url>
32 </BOUCLE_r>
33
34 [(#REM) Articles ]
35 [(#SET{recent,[(#VAL{Y-m-d H:i:s}|date{#VAL{"-1 day"}|strtotime})]})]
36 <BOUCLE_a(ARTICLES){!par date_modif}{!par date}{0,2000}>
37 <url>
38 [<loc>(#URL_ARTICLE|url_absolue)</loc>]
39 <BOUCLE_a_trad(ARTICLES){traduction}>
40 <xhtml:link rel="alternate" hreflang="[(#LANG)]" href="[(#URL_ARTICLE|url_absolue)]" />
41 </BOUCLE_a_trad>
42 [(#DATE_MODIF**|>{#GET{recent}}
43 |?{[<lastmod>(#DATE_MODIF**|date_iso)</lastmod>]})]
44 </url>
45 </BOUCLE_a>
46
47 [(#REM) Breves ]
48 <BOUCLE_b(BREVES){!par date}{0,1000}>[
49 <url><loc>(#URL_BREVE|url_absolue)</loc></url>]</BOUCLE_b>
50
51 [(#REM) Extensions de sitemap par des plugins ]
52 <BOUCLE_objets(DATA){source table,#REM|lister_tables_objets_sql}>
53 #SET{fond,#VAL{sitemap-}|concat{#VALEUR{table_objet}}}
54 [(#GET{fond}|trouver_fond|oui)#INCLURE*{fond=#GET{fond}}]
55 </BOUCLE_objets>
56
57 </urlset>