piranha / gostatic

Fast static site generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get a list of pages by pattern

holic opened this issue · comments

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 }}

I thought about name a bit and here you go - .Pages.GlobSource "*.md" should work now. Not tested though. :)

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 :)

Oh well, if it's works, then cool. :) I don't think it should check rule definitions, seems a bit orthogonal here.

Just tested and it works great 👍