-
Notifications
You must be signed in to change notification settings - Fork 4
/
generate_sitemap.sh
executable file
·50 lines (44 loc) · 1.31 KB
/
generate_sitemap.sh
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
#!/bin/bash
SITEMAP1="github-sitemap.xml"
SITEMAP2="24x7-sitemap.xml"
declare -A sitemap2URL
sitemap2URL[${SITEMAP1}]="https://singlepagebookproject.github.io/IT_notes"
sitemap2URL[${SITEMAP2}]="http://www.oficina24x7.com"
for SITEMAP in ${SITEMAP1} ${SITEMAP2} ; do
cat << __EOF > ${SITEMAP}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
__EOF
done
(
cat << EOF
index.html 1.0
Blockchain/ethereum_map.html 1.0
JAVA/java_map.html 1.0
General/cryptography_map.html 1.0
WebTechnologies/map.html 1.0
DevOps/devops_map.html 0.5
Architecture/architecture_map.html 0.5
Architecture/financial_arch_map.html 0.3
Cloud/cloud_map.html 0.5
EOF
) | while read FILE PRIORITY ; do
for SITEMAP in ${SITEMAP1} ${SITEMAP2} ; do
LASTMOD=$(stat --format=%y $FILE | sed "s/ .*//")
echo $LASTMOD
cat << ______EOF >> ${SITEMAP}
<url>
<loc>${sitemap2URL[${SITEMAP}]}/${FILE}?showSearchMenu=true</loc>
<lastmod>${LASTMOD}</lastmod>
<changefreq>monthly</changefreq>
<priority>${PRIORITY}</priority>
</url>
______EOF
done
done
for SITEMAP in ${SITEMAP1} ${SITEMAP2} ; do
cat << __EOF >> ${SITEMAP}
</urlset>
__EOF
done
wc -l ${SITEMAP1} ${SITEMAP2}