From 06d16504ff6774388bc022ee986babde1caecc81 Mon Sep 17 00:00:00 2001 From: Natanael Arndt Date: Wed, 30 Aug 2017 14:48:15 +0200 Subject: [PATCH] Docs: `site.url` behavior on development and production environments (#6270) Merge pull request 6270 --- docs/_docs/variables.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/_docs/variables.md b/docs/_docs/variables.md index cec35196..5bb44e6b 100644 --- a/docs/_docs/variables.md +++ b/docs/_docs/variables.md @@ -185,17 +185,32 @@ following is a reference of the available data.

+ +

site.url

+

+ + Contains the url of your site as it is configured in the _config.yml. + For example, if you have url: http://mysite.com + in your configuration file, then it will be accessible in Liquid as + site.url. For the development environment there is + an exception, + if you are running jekyll serve in a development environment + site.url will be set to the value of host, + port, and SSL-related options. This defaults to + url: http://localhost:4000). + +

+

site.[CONFIGURATION_DATA]

All the variables set via the command line and your _config.yml are available through the site - variable. For example, if you have url: http://mysite.com - in your configuration file, then in your Posts and Pages it will be - stored in site.url. Jekyll does not parse changes to - _config.yml in watch mode, you must restart - Jekyll to see changes to variables. + variable. For example, if you have foo: bar + in your configuration file, then it will be accessible in Liquid as site.foo. + Jekyll does not parse changes to _config.yml in + watch mode, you must restart Jekyll to see changes to variables.