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
179 stars 36 forks source link

add posibility to override output filename #51

Closed gregersn closed 8 years ago

gregersn commented 8 years ago

With this change it will be easy to make sitemaps as discussed in #39 .

By having a template called sitemap.html like so: `<?xml version="1.0" encoding="UTF-8"?>

{% for t in site.reflinks %} {% if site.reflinks[t].fn and not site.reflinks[t].hidden %} {{ site.hostname }}{{ site.reflinks[t].url }} {{ this.changefreq }} {{ this.priority }} {% endif %} {% endfor %} ` and then a file called sitemap.md like this: ``` --- title: sitemap layout: sitemap changefreq: daily priority: 1.0 xmlns: http://www.google.com/schemas/sitemap/0.84 saveas: sitemap.xml --- ```
jandecaluwe commented 8 years ago

Thank you. I would appreciate it if you would also update the documentation. (i.e. describe the special saveas attribute of a content file.) And perhaps add a FAQ to describe usage?

isacdaavid commented 7 years ago

I was fooled to believe that by using the saveas in my content files (beyond sitemap.md) links to those files would also resolve to the new destination path; allowing me to, for instance, name my .md files according to dates without worrying that final URLs will look ugly. At least that was the impression I got from reading the manual.

Are users of saveas supposed to change all their templates to test for {{this.saveas}} as opposed to just {{this.id}} or {{this.url}}?

I prepared a small patch in case the answer is no; it's doing the job for me. Otherwise I would like to start changing my layouts and keep using mainstream Urubu.