Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add target config setting and front matter variables so one could create multiple outputs from a single site codebase with various target site included files"
This is a 🙋 feature or
script/cibuildto verify this)Happy to extend documentation further if you want to accept this feature, but if not (which totally fine!) and it's just a patch I'm maintaining, I might not get to that. So let me know what you think.
Summary
Not sure if the jekyll team wants this but here we go:
I host a jekyll site on my $domain.com and also mirror it as a tor onion service. So two nginx configs for two domains pointing at the same
_sitedir. I've recently thought of the idea if what if I could have some onion site only content. To do that I'd need to generate the site twice, no problem, and point the onion service address at the second site. Super season sincejekyll buildsupports configfile stacking and overriding so I just change thedestinationto_site_onionin it and easy, two duplicate sites.Now for the fun part, how to tag and filter content?
So with this MR I've added an optional (set to "default" by default) new
site.configurationdata calledtarget, and added a matching field to frontmatter for pages and documents.Then I updated
write?checks to make sure there was a match (with the frontmater check being a.fetch()with the site's target as the default. Which means if either or both are unset, it's included, it's only when thesite.targethas a set valuethat does not match the frontmatter
targetthat it won't get output.(I also had to actually wire in
page.write?in the filter code, since it was written to always returntrueit appears to have also been optimized to not even be called.)The result: I can now put
target: onionin the front patter of a post or other page and on a default site generation, it will not be included. Then addtarget: onionto my_config_onion.ymland do a second generation with it and the second site now has the onion targeted content!Context
Just an idea I had