From c458e1413a3cf03d2b13dbe831a25a2ea047f30f Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 23:51:06 +0530 Subject: [PATCH] Fix lapses in documentation of page variables (#9667) Merge pull request 9667 --- docs/_data/jekyll_variables.yml | 46 +++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/docs/_data/jekyll_variables.yml b/docs/_data/jekyll_variables.yml index a9e2ff0c..d909a350 100644 --- a/docs/_data/jekyll_variables.yml +++ b/docs/_data/jekyll_variables.yml @@ -98,38 +98,43 @@ site: page: - name: page.content description: >- - The content of the Page, rendered or un-rendered depending upon - what Liquid is being processed and what page is. + The content of the Page, rendered or un-rendered depending upon what Liquid is being processed + and what page is. - name: page.title description: >- - The title of the Page. + The title of the Page or Document resource. - name: page.excerpt description: >- - The un-rendered excerpt of a document. + The un-rendered excerpt of a Page or Document. Can be overridden in the + front matter and disabled atoomically by setting an empty + as excerpt_separator key either in the front matter of desired resource or + disable site-wide by setting the same as a top-level key in the config file. - name: page.url description: >- The URL of the Post without the domain, but with a leading slash, e.g. /2008/12/14/my-post.html - name: page.date description: >- - The Date assigned to the Post. This can be overridden in a Post’s front matter by specifying + The Date assigned to the Post. This can be overridden in a Post's front matter by specifying a new date/time in the format YYYY-MM-DD HH:MM:SS (assuming UTC), or YYYY-MM-DD HH:MM:SS +/-TTTT (to specify a time zone using an offset from UTC. - e.g. 2008-12-14 10:30:00 +0900). + e.g. 2008-12-14 10:30:00 +0900). Not applicable to Pages. - name: page.id description: >- An identifier unique to a document in a Collection or a Post (useful in RSS feeds). e.g. - /2008/12/14/my-post/my-collection/my-document + /2008/12/14/my-post/my-collection/my-document. Not applicable to + Pages. - name: page.categories description: >- The list of categories to which this post belongs. Categories are derived from the directory structure above the _posts directory. For example, a post at /work/code/_posts/2008-12-24-closures.md would have this field set to ['work', 'code']. These can also be specified in the - front matter. + front matter. Note: Path-based categories may not work for + documents in user-defined collections. - name: page.collection description: >- - The label of the collection to which this document belongs. e.g. posts for a post, or + The label of the collection to which a Document belongs. e.g. posts for a post, or puppies for a document at path _puppies/rover.md. If not part of a collection, an empty string is returned. - name: page.tags @@ -138,16 +143,29 @@ page: front matter. - name: page.dir description: >- - The path between the source directory and the file of the post or page, e.g. - /pages/. - This can be overridden by permalink in the front matter. + The path between the source directory and the file of a page, e.g. /pages/ when the page + is at path pages/about.md relative to the source directory. This is derived from the + url attribute of the page and can therefore be overridden via the permalink + key in the front matter. NOTE: This variable is not applicable to + posts and documents in user-defined collections. Use the categories variable to get similar + info for posts. - name: page.name description: >- The filename of the post or page, e.g. about.md - name: page.path description: >- - The path to the raw post or page. Example usage: Linking back to the page or post’s source - on GitHub. This can be overridden in the front matter. + The path to the raw post or page, relative to the source directory. Example usage: Using a combination + of the repository's blob URL and this page variable to get the full URL to the file in the repository. + This can be overridden in the front matter. + - name: page.slug + description: >- + The filename of a Document resource without its extension (or date prefixes for a post). For example, + slug for a post at URL /2017/02/22/my-new-post.html, would be my-new-post. + Can be overridden in the front matter. + - name: page.ext + description: >- + The file extension of a Document resource. For example, .html. Can be overridden in the + front matter. - name: page.next description: >- The next post relative to the position of the current post in site.posts.