I do not want the
welcome to Jekyll page that was generated when I created a new site, to appear in my site as it is irrelevant to my readers. I excluded it in the excludes section of my
config.yml and I am now getting the following error when I rebuild my site:
Error: could not read file /home/jgossage/gems/gems/jekyll-4.0.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'gems/gems/jekyll-4.0.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
ERROR: YOUR SITE COULD NOT BE BUILT:
Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'gems/gems/jekyll-4.0.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
What is the correct way of ensuring that this page does not appear on my site?
what is the name of the page? it looks like it was a post? why did you not just delete/edit it?
the error looks to be saying it is missing a date on the post - posts are required to have a date.
I have not built the default site in quite a while so I can’t remember what all is there, but you should be editing it not excluding it I would think.
The primary reason behind the error you’re seeing above is because you overrode the default excludes. i.e. by having the following in your config file:
vendor/ directory is no longer excluded.
The fix for this error is to ensure that you’ve
vendor/ listed in your
exclude: list if you’re customizing it. Depending on what version of Jekyll was used to create the boilerplate, there may or may not be a comment above the
exclude: key in your config file.
However, Jekyll 4.0 has a patch built-in so
vendor/ is always excluded even if users forget to exclude it explicitly.
Regarding the actual question this thread is about, the easiest solution is to just delete the welcome post.
This is not my file. It is provided by Jekyll when the jekyll new command is run to generate a new site. Since it contains nothing except information about Jekyll, it will not be interesting to my reaaders.
I was running Jekyll 22.214.171.124 so it appears that the patch you mentioned did not help. I will try modifying the
Changing the excludes as you suggested worked, thank you.
If you encountered this issue while using Jekyll 4.0, then it is a bug that has to be fixed.
Is your site’s source-code publicly available on GitHub or similar…? I’d like to confirm that you were indeed running Jekyll 4.0 and encountered the error nevertheless.
I am still developing and teaching myself so this is not code that will be deployed. I am just trying to figure out how things work. It is separate to anything else so I could create a new repository. Would this help? Would the output from any other command help you confirm that I was running 4.0.0? Here is the output from
gem list that shows Jekyll 4.0.0 installed.
bigdecimal (default: 1.3.4)
cmath (default: 1.0.0)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
etc (default: 1.0.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
gdbm (default: 2.0.0)
i18n (1.6.0, 0.9.5)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
jekyll (4.0.0, 3.8.5)
jekyll-feed (0.12.1, 0.11.0)
jekyll-sass-converter (2.0.0, 1.5.2)
jekyll-seo-tag (2.6.1, 2.5.0)
json (default: 2.1.0)
kramdown (2.1.0, 1.17.0)
liquid (4.0.3, 4.0.0)
minima (2.5.1, 2.5.0)
minitest (5.11.3, 5.10.3)
openssl (default: 2.1.1)
psych (default: 3.0.2)
public_suffix (4.0.1, 3.1.1)
rdoc (default: 6.0.1)
rouge (3.10.0, 3.9.0, 2.2.1)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
webrick (default: 1.4.2)
zlib (default: 1.0.0)
Is there anything else I can do to help?
I have uploaded a copy of the site to GitHub. It contains more than what you are looking for, but it does include the complete site.
@caolin Thank you for providing the link to the repository.
I cloned it locally and experimented with it.
The exact error that you mentioned in this thread (regarding
_posts/0000-00-00-welcome-to-jekyll.markdown.erb) couldn’t be reproduced.
So, there’s no bug in that patch…