jandecaluwe / urubu

A micro CMS for static websites, with a focus on good navigation practices.
urubu.jandecaluwe.com
GNU Affero General Public License v3.0
180 stars 36 forks source link

RFE: automatic sitemap.xml generation #39

Open wallclimber21 opened 8 years ago

wallclimber21 commented 8 years ago

The subject says it all: it's be nice if urubu could generate a sitemap.

jandecaluwe commented 8 years ago

After looking around it seems that a template-based generation may be the easiest. There is a jekyll solution around that works like that (to avoid a plug-in). Urubu could recognize a dedicated sitemap.xml template in the _layouts directory, and use it to generate a sitemap.xml file in the build. An additional advantage would be that users can tweak the sitemap as they wish.

Not a priority for me, but a good pull requests will be accepted (the doc subdir with the Urubu documentation can be used to test this.)

wallclimber21 commented 8 years ago

I decided to add the following line to 'build' rule in the Makefile:

( cd _build && find . -name "*html" | grep -v "./google" | sed -e "s/^./http:\/\/mysite.com/" > sitemap.txt )

The 'grep -v' is to avoid google property tracker cookies.

Not the most advanced, and it doesn't include images or anything, but it's good enough for to get Google going.