0
votes

I'm working on a Jekyll site with GitHub Pages and have found that {% include myinclude.html %} liquid works just fine inside _includes and _layout files. However, when adding elements to the _config.yml such as author : myusername and attempting to use them either in the _layouts/default.html or _includes/myinclude.html as {{ site.author }}, the resulting text is just blank. To note, these changes are not committed or pushed and I'm using a local jekyll instance installed on the Linux Subsystem for Windows.

Outside of _includes and _layout in my actual pages the site variables work just fine. Why would the site variables not be displayed? At the moment I have to place the actual values back into the page.

2
With no code, it will be difficult to debug.David Jacquel
Understandable, though I did just figure out that the problem was because I had not restarted the Jekyll instance. Changes to the config don't update like changes to every other file.Matthew Wright

2 Answers

1
votes

The above is the intended behaviour, every change to _config.yml needs the development server to be restarted to process new settings.

The configuration file can't be re-read when using watch, because it contains things like source and destination. It could only work if it were actually like running jekyll build multiple times

source

0
votes

With the assumption that edits to the _config.yml would update automatically, as Jekyll does for edits to other files, I had not restarted the jekyll instance I originally started. Simply closing the Jekyll instance and starting it back up, with bundle exec jekyll serve in my case, read the updated config file and the {{ site.variables }} appeared and showed correctly as I expected.

Any changes to the _config.yml require restarting the Jekyll instance.