docs: update "adding new post" tutorial with...

...info about canonical URLs
This commit is contained in:
Nahuel Garbezza
2023-07-21 20:39:39 -03:00
committed by Sat Naing
parent 606203d034
commit 08383093d1
+13 -11
View File
@@ -23,17 +23,18 @@ Frontmatter is the main place to store some important information about the post
Here is the list of frontmatter property for each post. Here is the list of frontmatter property for each post.
| Property | Description | Remark | | Property | Description | Remark |
| ----------------- | ------------------------------------------------------------------------------- | --------------------------------------------- | | ------------------ | ------------------------------------------------------------------------------- | --------------------------------------------- |
| **_title_** | Title of the post. (h1) | required<sup>\*</sup> | | **_title_** | Title of the post. (h1) | required<sup>\*</sup> |
| **_description_** | Description of the post. Used in post excerpt and site description of the post. | required<sup>\*</sup> | | **_description_** | Description of the post. Used in post excerpt and site description of the post. | required<sup>\*</sup> |
| **_pubDatetime_** | Published datetime in ISO 8601 format. | required<sup>\*</sup> | | **_pubDatetime_** | Published datetime in ISO 8601 format. | required<sup>\*</sup> |
| **_author_** | Author of the post. | default = SITE.author | | **_author_** | Author of the post. | default = SITE.author |
| **_postSlug_** | Slug for the post. Will automatically be slugified. | default = slugified title | | **_postSlug_** | Slug for the post. Will automatically be slugified. | default = slugified title |
| **_featured_** | Whether or not display this post in featured section of home page | default = false | | **_featured_** | Whether or not display this post in featured section of home page | default = false |
| **_draft_** | Mark this post 'unpublished'. | default = false | | **_draft_** | Mark this post 'unpublished'. | default = false |
| **_tags_** | Related keywords for this post. Written in array yaml format. | default = others | | **_tags_** | Related keywords for this post. Written in array yaml format. | default = others |
| **_ogImage_** | OG image of the post. Useful for social media sharing and SEO. | default = SITE.ogImage or generated SVG image | | **_ogImage_** | OG image of the post. Useful for social media sharing and SEO. | default = SITE.ogImage or generated SVG image |
| **_canonicalUrl_** | Canonical URL (absolute), in case the article already exists on other source. | default = `Astro.site` + `Astro.url.pathname` |
Only `title`, `description` and `pubDatetime` fields in frontmatter must be specified. Only `title`, `description` and `pubDatetime` fields in frontmatter must be specified.
@@ -73,6 +74,7 @@ tags:
- tags - tags
ogImage: "" ogImage: ""
description: This is the example description of the example post. description: This is the example description of the example post.
canonicalUrl: https://example.org/my-article-was-already-posted-here
--- ---
``` ```