Get a list of pages by pattern
holic opened this issue · comments
Kevin Ingersoll commented
I'm creating an RSS feed for my posts and it'd be great to be able to get all posts under a specific pattern, e.g.
{{ range .Site.Pages.WithPattern "*.md" }}
{{ .Content }}
{{ end }}
Alexander Solovyov commented
I thought about name a bit and here you go - .Pages.GlobSource "*.md"
should work now. Not tested though. :)
Kevin Ingersoll commented
Sweet! I was thinking more along the lines of just grabbing the pages under a specific pattern in the config. Using my example above, it would match the files that were defined in this config line:
*.md:
markdown
template post
But the way you've implemented it is a bit more powerful :)
Alexander Solovyov commented
Oh well, if it's works, then cool. :) I don't think it should check rule definitions, seems a bit orthogonal here.
Kevin Ingersoll commented
Just tested and it works great 👍