3 Exemple tres simple de sitemap.xml accessible via URL_SITE_SPIP/sitemap.xml
4 (copier htaccess.txt en .htaccess pour en beneficier)
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
9 Duree de reindexation et priorite ne sont pas precisees,
12 Mais si date_modif est recente (
1 jour) on l'indique, pour que ce
13 soit reindexe en priorite
15 (On pose un cache a zero pour echapper au test _IS_BOT)
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">
23 <loc>#URL_SITE_SPIP/
</loc>
24 <changefreq>hourly
</changefreq>
28 <BOUCLE_r(RUBRIQUES){!par date}{
0,
1000}
>
30 [
<loc>(#URL_RUBRIQUE|url_absolue)
</loc>]
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}
>
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)]" />
42 [(#DATE_MODIF**|
>{#GET{recent}}
43 |?{[
<lastmod>(#DATE_MODIF**|date_iso)
</lastmod>]})]
48 <BOUCLE_b(BREVES){!par date}{
0,
1000}
>[
49 <url><loc>(#URL_BREVE|url_absolue)
</loc></url>]
</BOUCLE_b>
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}}]