Closed ghost closed 2 years ago
Note that this is an official plugin, see https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#plugins
Oh and you need to update your Gemfile if you are building/serving locally.
Add this line:
gem "jekyll-optional-front-matter", group: :jekyll_plugins
Run Bundle Install
Don't you still have the includes and excludes?
Don't you still have the includes and excludes?
No because, excludes in _config.yml are exclusion from being processed by jekyll
If I exclude MD files from there, those won't be converted and published. That's why they made this plugin for. Jekyll publishes HTML and MD. Then this plugin deletes the MDs from the site.
Then remove them from the includes?
Then remove them from the includes?
You mean #168 ?
Then remove them from the includes?
You mean #168 ?
I'm new to Jekyll so idk if this plugin will do anything especially since you're hard declaring in the _config.yml what's to be added to the website. And why is it 2 separate PRs?
Do a bundle exec jekyll build in the root, it will build an exportable version of the site in _site/
Then you'll see HTML and MD files are published ...As they are now. This plugin (test it locally) just removes the MD files from the publishing directory.
Then what is this doing?
include:
- LICENSE.md
- about.md
- legacy.md
- briar.md
- .well-known
Then what is this doing?
include: - LICENSE.md - about.md - legacy.md - briar.md - .well-known
I don't know. I didn't do that. But sometimes Jekyll skips MD files for no reason and then you have to include them to be sure they're published. I guess that's the reason.
The
include:
needs to be fixed to only explicitly include files excluded by the shortlist here. Optionally, to include without specifying it in the config, we can add YAML frontmatter to the header and it will be included.include: - LICENSE.md # is this necessary? - about.md # this is probably necessary - legacy.md # don't need this - briar.md # need this - .well-known # this is just for the spec really
plugins: - jekyll-optional-front-matter
This also requires to update the Gemfile to add:
group :jekyll_plugins do gem 'jekyll-optional-front-matter' end
I can't say this is complete without doing all that too; the plugin does nothing without those changes.
The plugin is installed on GitHub by default. No need to include it. No need for a Gemfile either. You just need to add this in your Gemfile locally if you want to build the site without the MDs in the _site directory.
As for
include:
Remove them and see if it builds correctly (meaning that corresponding HTML is present in _site or served correctly) and if yes then we should remove them yes. One by one and check.
Looks good, resolve conflicts?
Nothing more should be needed than this
Right now both HTML and MD files are published on the website:
Example: https://anonymousplanet-ng.org/about.md
This plugin will publish the HTML and then delete the MD from the published site (not from the repo)
See https://github.com/benbalter/jekyll-optional-front-matter/blob/main/README.md