CONFIGURATION_DATA
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 havefoo: bar
in your configuration file, then it will be accessible in Liquid assite.foo
. Jekyll does not parse changes to_config.yml
inwatch
mode, you must restart Jekyll to see changes to variables.
URL
site.url
: Contains the url of your site as it is configured in the_config.yml
. For example, if you haveurl: http://mysite.com
in your configuration file, then it will be accessible in Liquid assite.url
. For the development environment there is an exception, if you are runningjekyll serve
in a development environmentsite.url
will be set to the value ofhost
,port
, and SSL-related options. This defaults tourl: http://localhost:4000
.
Pages and Posts
Pages
site.pages
: A list of all Pages.site.html_pages
: A subset ofsite.pages
listing those which end in.html
.
Posts
site.posts
: A reverse chronological list of all Posts.site.related_posts
: If the page being processed is a Post, this contains a list of up to ten related Posts. By default, these are the ten most recent posts. For high quality but slow to compute results, run thejekyll
command with the--lsi
(latent semantic indexing) option. Also note GitHub Pages does not support thelsi
option when generating sites.
Other
site.static_files
: A list of all static files (i.e. files not processed by Jekyll’s converters or the Liquid renderer). Each file has five properties:path
,modified_time
,name
,basename
andextname
.site.documents
: A list of all the documents in every collection.site.html_files
: A subset ofsite.static_files
listing those which end in.html
.
Collections
site.collections
: A list of all the collections (including posts).
Data
site.data
: A list containing the data loaded from the YAML files located in the_data
directory.
Time
site.time
: The current time (when you run thejekyll
command).
分类
site.categories.CATEGORY
: The list of all Posts in categoryCATEGORY
.site.tags.TAG
: The list of all Posts with tagTAG
.