statiqdev / Discussions

Discussions related to Statiq Framework, Statiq Web, and other Statiq projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostSources (in theme settings.yml) seems to imply it's a list, but a list doesn't work

godefroi opened this issue · comments

I'm running a quick test using the CleanBlog theme, and I have in the settings.yml file this block:

PostSources:
  - posts/*
  - posts/2011/*
  - posts/2012/*
  - posts/2013/*

Only the files in posts/* actually show up, though. Am I doing something wrong, or does this not actually work?

I'm pretty sure it's just a single globbing pattern. Without looking too deep at the theme, the readme says:

PostSources: A globbing pattern where to find blog posts (defaults to posts/*).

And the default settings.yml has it as a scalar:

PostSources: posts/*

Likewise I see in the places where that setting is used to drive archives and feeds, it's fetched with GetString() which treats it as a single value (Statiq is smart enough to grab the first value in a collection when asking for a string representation). I.e., in the feed.yml file I see:

FeedSources: => GetString("PostSources")

I think the confusion might be over the pluralization of the setting name PostSources (as opposed to something like PostSource). That's good feedback. I think the reason I ended up with that name is because even though the settings value is a scalar, a globbing pattern can define many sources with the use of expansions. For example, that same set of four paths above could be expressed with a globbing pattern like "posts/{2011,2012,2013,}/*".

So I guess the real question here is whether that's sufficient (unless you were just testing and didn't really need multiple post source paths). For example, another simplified globbing pattern that would pick up all the files above would use multiple depths: "posts/**" (instead of "posts/*" which just picks up the first level child items). If there's a need for multiple post source paths instead of a single globbing pattern, we can add that as a feature enhancement for the theme (though not sure how soon it'll be before I get to it).

That was a lot - does it all make sense?

I'm also going to move this issue to the discussions board since it might help others with the same question.