mirror of
https://git.ludikovsky.name/git/fugitive.git
synced 2024-09-28 22:25:27 +02:00
Sitemap generation
This commit is contained in:
parent
510916960c
commit
ddde688aa5
|
@ -5,7 +5,10 @@
|
||||||
<?fugitive foreach:article ?>
|
<?fugitive foreach:article ?>
|
||||||
<url>
|
<url>
|
||||||
<loc><?fugitive blog_url ?><?fugitive article_file ?>.html</loc>
|
<loc><?fugitive blog_url ?><?fugitive article_file ?>.html</loc>
|
||||||
|
<lastmod><?fugitive article_cdatetime ?></lastmod>
|
||||||
|
<?fugitive ifset:article_mdatetime ?>
|
||||||
<lastmod><?fugitive article_mdatetime ?></lastmod>
|
<lastmod><?fugitive article_mdatetime ?></lastmod>
|
||||||
|
<?fugitive endifset:article_mdatetime ?>
|
||||||
</url>
|
</url>
|
||||||
<?fugitive endforeach:article ?>
|
<?fugitive endforeach:article ?>
|
||||||
</urlset>
|
</urlset>
|
||||||
|
|
13
html-gen.sh
13
html-gen.sh
|
@ -418,6 +418,19 @@ if [ $modification -gt 0 ]; then
|
||||||
cp "$temp" "$public_dir/atom.xml"
|
cp "$temp" "$public_dir/atom.xml"
|
||||||
gzip -9kfn "$public_dir/atom.xml"
|
gzip -9kfn "$public_dir/atom.xml"
|
||||||
echo "done."
|
echo "done."
|
||||||
|
echo -n "[fugitive] Generating $public_dir/sitemap.xml... "
|
||||||
|
cat "$templates_dir/sitemap.xml" | \
|
||||||
|
replace_includes | \
|
||||||
|
replace_foreach "article" "$articles_sorted" | \
|
||||||
|
replace_foreach "commit" "$commits" | \
|
||||||
|
replace_empty_article_info | \
|
||||||
|
replace_str "page_title" "archives" | \
|
||||||
|
replace_str "blog_url" "$blog_url" | \
|
||||||
|
replace_commit_info "-1" | \
|
||||||
|
sed "/^[[:space:]]*$/d" > "$temp"
|
||||||
|
cp "$temp" "$public_dir/sitemap.xml"
|
||||||
|
gzip -9kfn "$public_dir/sitemap.xml"
|
||||||
|
echo "done."
|
||||||
rm "$last_5_articles" "$last_5_commits" "$temp"
|
rm "$last_5_articles" "$last_5_commits" "$temp"
|
||||||
echo -n "[fugitive] Using last published article as index page... "
|
echo -n "[fugitive] Using last published article as index page... "
|
||||||
cp "$public_dir/`head -1 $articles_sorted`.html" "$public_dir/index.html"
|
cp "$public_dir/`head -1 $articles_sorted`.html" "$public_dir/index.html"
|
||||||
|
|
|
@ -71,10 +71,12 @@ _public/index.html
|
||||||
_public/archives.html
|
_public/archives.html
|
||||||
_public/rss.xml
|
_public/rss.xml
|
||||||
_public/atom.xml
|
_public/atom.xml
|
||||||
|
_public/sitemap.xml
|
||||||
_public/index.html.gz
|
_public/index.html.gz
|
||||||
_public/archives.html.gz
|
_public/archives.html.gz
|
||||||
_public/rss.xml.gz
|
_public/rss.xml.gz
|
||||||
_public/atom.xml.gz
|
_public/atom.xml.gz
|
||||||
|
_public/sitemap.xml.gz
|
||||||
EOF
|
EOF
|
||||||
echo "done."
|
echo "done."
|
||||||
if [ "$1" = "local" ]; then
|
if [ "$1" = "local" ]; then
|
||||||
|
@ -99,6 +101,9 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
fugitive_write_template > _templates/atom.xml <<EOF
|
fugitive_write_template > _templates/atom.xml <<EOF
|
||||||
#INCLUDE:default-files/atom.xml#
|
#INCLUDE:default-files/atom.xml#
|
||||||
|
EOF
|
||||||
|
fugitive_write_template > _templates/sitemap.xml <<EOF
|
||||||
|
#INCLUDE:default-files/sitemap.xml#
|
||||||
EOF
|
EOF
|
||||||
echo "done."
|
echo "done."
|
||||||
echo -n "Writing default css files... "
|
echo -n "Writing default css files... "
|
||||||
|
|
Loading…
Reference in a new issue