gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 121 forks source link

sitemap_excludes #137

Closed jmervine closed 11 years ago

jmervine commented 11 years ago

Adding ability to exclude pages from sitemap via config.yml.

gma commented 11 years ago

Hi Joshua. Thanks for this – I've been having a think about it. It's a nice feature; I like it.

I suspect the most natural way to configure which pages to leave out of the sitemap would be to add a flag to a page's metadata to indicate that it doesn't belong in the sitemap. Something like this:

Date: ...
Flags: no-sitemap

What do you think?

jmervine commented 11 years ago

That seems much more "nesta-y" for sure. Also, it wouldn't be that difficult to make that change if I remember the metadata code correctly, although I haven't played with it myself.

gma commented 11 years ago

Yeah, you'd just be able to put something like next if page.flagged_as?('no-sitemap') inside the loop (from memory, might not be perfect).

gma commented 11 years ago

Damned good idea, this. I just found a need for it myself.