1 | [(#REM) |
---|
2 | |
---|
3 | Surcharge du Sitemap fournit en défaut par SPIP pour integrer les images |
---|
4 | |
---|
5 | Intégration des images |
---|
6 | https://support.google.com/webmasters/answer/178636?hl=fr |
---|
7 | |
---|
8 | Inspire du travail d'orsal |
---|
9 | https://www.orsal.fr/Sitemap-avec-images-pour-SPIP |
---|
10 | |
---|
11 | Exemple tres simple de sitemap.xml accessible via URL_SITE_SPIP/sitemap.xml |
---|
12 | (copier htaccess.txt en .htaccess pour en beneficier) |
---|
13 | |
---|
14 | Parametre |
---|
15 | - annee (facultatif) permet de lister les items par annee |
---|
16 | |
---|
17 | (On pose un cache a zero pour echapper au test _IS_BOT) |
---|
18 | |
---|
19 | |
---|
20 | ]#CACHE{0} |
---|
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" |
---|
24 | xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"> |
---|
25 | [(#REM) Accueil] |
---|
26 | <url> |
---|
27 | <loc>#URL_SITE_SPIP</loc> |
---|
28 | <BOUCLE_maj(ARTICLES){tout}{par date_modif}{inverse}{0,1}>[(#DATE_MODIF|?{[<lastmod>(#DATE_MODIF|date_iso)</lastmod>]})]</BOUCLE_maj> |
---|
29 | <changefreq>hourly</changefreq> |
---|
30 | <priority>1.0</priority> |
---|
31 | </url> |
---|
32 | |
---|
33 | [(#REM) Rubriques] |
---|
34 | <BOUCLE_r(RUBRIQUES){si #ENV{annee}|non}{!par date}{0,1000}> |
---|
35 | <url> |
---|
36 | [<loc>(#URL_RUBRIQUE|url_absolue)</loc>] |
---|
37 | [<image:image> |
---|
38 | <image:loc>#URL_SITE_SPIP/(#LOGO_RUBRIQUE|extraire_attribut{src}|supprimer_timestamp)</image:loc> |
---|
39 | [<image:title>(#TITRE|trim|textebrut)</image:title>] |
---|
40 | </image:image>] |
---|
41 | </url> |
---|
42 | </BOUCLE_r> |
---|
43 | |
---|
44 | [(#REM) Articles] |
---|
45 | <BOUCLE_a(ARTICLES){annee?}{!par date_modif}{!par date}{0,2000}> |
---|
46 | <url> |
---|
47 | <loc>[(#URL_ARTICLE|url_absolue)]</loc> |
---|
48 | <lastmod>[(#DATE_MODIF|date_iso)]</lastmod> |
---|
49 | <changefreq>weekly</changefreq> |
---|
50 | <priority>[(#POPULARITE|div{100})]</priority> |
---|
51 | [<image:image> |
---|
52 | <image:loc>#URL_SITE_SPIP/(#LOGO_ARTICLE|extraire_attribut{src}|supprimer_timestamp)</image:loc> |
---|
53 | [<image:title>(#TITRE|trim|textebrut)</image:title>] |
---|
54 | </image:image>] |
---|
55 | <BOUCLE_mesimages(DOCUMENTS){id_article}{doublons}{extension IN jpg,gif,png}{0,1000}><image:image> |
---|
56 | <image:loc>[(#URL_DOCUMENT|url_absolue)]</image:loc> |
---|
57 | [<image:caption>(#DESCRIPTIF|trim|textebrut)</image:caption>] |
---|
58 | [<image:title>(#TITRE|trim|sinon{#FICHIER|basename|titre_naturel}|textebrut)</image:title>] |
---|
59 | </image:image></BOUCLE_mesimages> |
---|
60 | </url> |
---|
61 | </BOUCLE_a> |
---|
62 | |
---|
63 | [(#REM) Breves] |
---|
64 | <BOUCLE_b(BREVES){annee?}{!par date}{0,1000}>[ |
---|
65 | <url><loc>(#URL_BREVE|url_absolue)</loc></url>]</BOUCLE_b> |
---|
66 | |
---|
67 | [(#REM) Extensions de sitemap par des plugins ] |
---|
68 | <BOUCLE_objets(DATA){source table,#REM|lister_tables_objets_sql}{si #ENV{annee}|non}> |
---|
69 | #SET{fond,#VAL{sitemap-}|concat{#VALEUR{table_objet}}} |
---|
70 | [(#GET{fond}|trouver_fond|oui)#INCLURE*{fond=#GET{fond}}] |
---|
71 | </BOUCLE_objets> |
---|
72 | |
---|
73 | </urlset> |
---|