Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: page/post variable #1272

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Variable | Description | Type

Variable | Description | Type
--- | --- | ---
`page.published` | True if the post is not a draft | `boolean`
`page.categories` | All categories of the post | `array` of ???
`page.tags` | All tags of the post | `array` of ???
`post.published` | True if the post is not a draft | `boolean`
`post.categories` | All categories of the post | `array` of ???
`post.tags` | All tags of the post | `array` of ???
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those variables mentioned here is used in template when the layout is post and should access via page..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SukkaW ok so this is the right fix #1273

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leme know so I make the change in other languages too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the theme developers, they may need to reuse the same article template for both home page and post page. So, a post variable will be used, in home page post = page.posts.toArray()[0], in post page post = page.


**Home (`index`)**

Expand Down