By Brad Lazaruk, Sun 11 September 2022, modified Sun 11 September 2022, in category Development
Finally with some more time on my hands I fixed up the last bit of the site migration from Wordpress to Pelican: adding the sitemap and robots.txt file.
The robots.txt file was easy, as this is a static file in the first place. Just create the file in /content/extra and on the next build it will be available in the output.
The sitemap is a bit more involved. Fortunately, there’s a plugin for that.
python -m pip install pelican-sitemap
pip freeze > requirements.txt
SITEMAP = {
"format": "xml",
"priorities": {
"articles": 0.5,
"indexes": 0.5,
"pages": 0.5
},
"changefreqs": {
"articles": "monthly",
"indexes": "daily",
"pages": "monthly"
},
"exclude": ["tag/", "category/", "author/"]
}
And … that’s that. Super easy. Pelican is great.