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
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions source/ko/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ title: Variables

변수 | 설명
--- | ---
`page.published` | Post가 draft상태가 아니라면 true를 반환합니다.
`page.categories` | Post의 모든 카테고리
`page.tags` | Post의 모든 태그
`post.published` | Post가 draft상태가 아니라면 true를 반환합니다.
`post.categories` | Post의 모든 카테고리
`post.tags` | Post의 모든 태그

**Home (index)**

Expand All @@ -74,7 +74,7 @@ title: Variables

변수 | 설명
--- | ---
`page.archive` | `true`와 동일합니다.
`page.published` | `true`와 동일합니다.
`page.year` | 아카이브 연도 (4자리 숫자)
`page.month` | 아카이브 월 (0을 제외한 2자리 숫자)

Expand Down
6 changes: 3 additions & 3 deletions source/pt-br/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Variável | Descrição | Tipo

Variável | Descrição | Tipo
--- | --- | ---
`page.published` | Verdadeiro se a postagem não for um rascunho | `boolean`
`page.categories` | Todas as categorias da postagem | `array` de ???
`page.tags` | Todas as tags da postagem | `array` de ???
`post.published` | Verdadeiro se a postagem não for um rascunho | `boolean`
`post.categories` | Todas as categorias da postagem | `array` de ???
`post.tags` | Todas as tags da postagem | `array` de ???

**Home (`index`)**

Expand Down
6 changes: 3 additions & 3 deletions source/ru/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ title: Переменные

Переменные | Описание
--- | ---
`page.published` | `true`, если пост не проект
`page.categories` | Все категории поста
`page.tags` | Все теги поста
`post.published` | `true`, если пост не проект
`post.categories` | Все категории поста
`post.tags` | Все теги поста

**Главная страница (index)**

Expand Down
6 changes: 3 additions & 3 deletions source/th/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 ???

**หน้าหลัก (`index`)**

Expand Down
6 changes: 3 additions & 3 deletions source/zh-cn/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ title: 变量

变量 | 描述 | 类型
--- | --- | ---
`page.published` | 如果该文章已发布则为 true | `boolean`
`page.categories` | 该文章的所有分类 | `array` of ???
`page.tags` | 该文章的所有标签 | `array` of ???
`post.published` | 如果该文章已发布则为 true | `boolean`
`post.categories` | 该文章的所有分类 | `array` of ???
`post.tags` | 该文章的所有标签 | `array` of ???

**首页(`index`)**

Expand Down
10 changes: 9 additions & 1 deletion source/zh-tw/docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ title: 變數
`page.photos` | 文章的照片(用於相簿)
`page.link` | 文章的外連連結(用於連結文章)

**Post (`post`):** Same as `page` layout but add the following variables.

Variable | Description | Type
--- | --- | ---
`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 ???

**首頁(index)**

變數 | 描述
Expand Down Expand Up @@ -85,4 +93,4 @@ title: 變數
`tag` | 標籤名稱

[Lodash]: http://lodash.com/
[Moment.js]: http://momentjs.com/
[Moment.js]: http://momentjs.com/