-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.py
62 lines (58 loc) · 1.71 KB
/
template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
ROBOTS="""
User-agent: *
Disallow: /catalogue/
Disallow: /search/
Disallow: /geoserver/
Disallow: /uploaded/
Disallow: /groups/
Disallow: /security/
Disallow: /account/
Disallow: /h_keywords_api
Disallow: /api/
Disallow: /?DeepZoom
Disallow: /maps/
Allow: /
Sitemap: {url}/sitemap.xml
"""
HEADER="""<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>{url_site}</loc>
<lastmod>{date}</lastmod>
<priority>1.0</priority>
<changefreq>always</changefreq>
</url>
"""
MAP="""<url>
<loc>{url_site}/layers/geonode:{layer}</loc>
<lastmod>{date}</lastmod>
<changefreq>always</changefreq>
<priority>0.9</priority>
<PageMap xmlns="http://www.google.com/schemas/sitemap-pagemap/1.0">
<DataObject type="document" id="{id}">
<Attribute name="title">{title}</Attribute>
<Attribute name="description">{caption}</Attribute>
</DataObject>
</PageMap>
<image:image>
<image:loc>{url_iiif}/?IIIF={layer}.tif/full/,1500/0/default.jpg</image:loc>
<image:title>{title}</image:title>
<image:caption>{caption}</image:caption>
<image:license>https://creativecommons.org/licenses/by/4.0/</image:license>
</image:image>
</url>
<url>
<loc>{url_site}/layers/geonode:{layer}/metadata_detail</loc>
<lastmod>{date}</lastmod>
<changefreq>always</changefreq>
<priority>0.1</priority>
</url>
"""
FOOTER="""
</urlset>
"""