Is there a way to check whether a jekyll site is being served locally?
问题 I'd like to add the following line to my head.html solely when running jekyll serve locally: <script src="http://127.0.0.1:35729/livereload.js?snipver=1"></script> I'm thinking of using some simple liquid check if possible. 回答1: Alternative solution (for example, if you're hosting your Jekyll site on your own server and not on GitHub Pages) : You can set a value in the config file _config.yml like this: environment: prod Then, you can have another config file which overrides the same value, I