Search code examples
rbuildjekyllblogdown

How can I fix the Jekyll error "Liquid Exception: Invalid Date:..." when building my hugo-apero website using blogdown?


When I build my hugo-apero website in GitHub, I get the following error:

  Liquid Exception: Invalid Date: '{}' is not a valid datetime. in /_layouts/default.html
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    Invalid Date: '{}' is not a valid datetime.

Despite this error, I still can get my website deployed but I would like to understand how to fix this error because it is really annoying. I don't understand why this error message suddenly appears, since I never had any /_layouts/default.html file in my repo.

I had a look to similar examples (https://talk.jekyllrb.com/t/jekyll-on-mac-could-not-read-file-and-invalid-date-error-using-bundle-exec-jekyll-serve/7664/6, https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/troubleshooting-jekyll-build-errors-for-github-pages-sites,...) but did not find any answer that matches my problem.


Solution

  • The solution is to add the empty file .nojekyll to the root of the project. Thank you @Matt Bannert for your advice. See Deploying static site to GitHub pages needs .nojekyll file.