Docs: `site.url` behavior on development and production environments (#6270)

Merge pull request 6270
This commit is contained in:
Natanael Arndt 2017-08-30 14:48:15 +02:00 committed by jekyllbot
parent 0aa55dbffb
commit 06d16504ff
1 changed files with 20 additions and 5 deletions

View File

@ -185,17 +185,32 @@ following is a reference of the available data.
</p></td> </p></td>
</tr> </tr>
<tr>
<td><p><code>site.url</code></p></td>
<td><p>
Contains the url of your site as it is configured in the <code>_config.yml</code>.
For example, if you have <code>url: http://mysite.com</code>
in your configuration file, then it will be accessible in Liquid as
<code>site.url</code>. For the development environment there is
<a href="/news/#3-siteurl-is-set-by-the-development-server">an exception</a>,
if you are running <code>jekyll serve</code> in a development environment
<code>site.url</code> will be set to the value of <code>host</code>,
<code>port</code>, and SSL-related options. This defaults to
<code>url: http://localhost:4000)</code>.
</p></td>
</tr>
<tr> <tr>
<td><p><code>site.[CONFIGURATION_DATA]</code></p></td> <td><p><code>site.[CONFIGURATION_DATA]</code></p></td>
<td><p> <td><p>
All the variables set via the command line and your All the variables set via the command line and your
<code>_config.yml</code> are available through the <code>site</code> <code>_config.yml</code> are available through the <code>site</code>
variable. For example, if you have <code>url: http://mysite.com</code> variable. For example, if you have <code>foo: bar</code>
in your configuration file, then in your Posts and Pages it will be in your configuration file, then it will be accessible in Liquid as <code>site.foo</code>.
stored in <code>site.url</code>. Jekyll does not parse changes to Jekyll does not parse changes to <code>_config.yml</code> in
<code>_config.yml</code> in <code>watch</code> mode, you must restart <code>watch</code> mode, you must restart Jekyll to see changes to variables.
Jekyll to see changes to variables.
</p></td> </p></td>
</tr> </tr>