From e13a4adb6a5088f251118eecae1cb2e30f9f401d Mon Sep 17 00:00:00 2001 From: Dillon Date: Sun, 5 Jun 2022 23:22:51 +0800 Subject: [PATCH] chore: update person shortcode docs --- .../index.en.md | 20 ++++---- .../index.zh-cn.md | 46 ++++++++++++++++++- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md index 4fea052..d06a7c8 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md @@ -385,28 +385,28 @@ Raw content using Markdown syntax: {{< raw >}}**Hello**{{< /raw >}} `person` is a shortcode to insert a link to a personal webpage marked up as [h-card](http://microformats.org/wiki/h-card). -The `person` shortcode takes the following parameters (all of these are optional, but it makes sense to have at least **url** and **name** and/or **nick**): +The `person` shortcode has the following named parameters: -* **url** (**first** positional parameter) +* **url** *[required]* (**first** positional parameter) URL of the personal page. -* **name** (**second** positional parameter) +* **name** *[required]* (**second** positional parameter) Name of the person. -* **nick** - - Nickame of the person. - -* **text** (**third** positional parameter) +* **text** *[optional]* (**third** positional parameter) Text to display as hover tooltip of the link. -* **picture** (**fourth** positional parameter) +* **picture** *[optional]* (**fourth** positional parameter) A picture to use as person's avatar. +* **nick** *[optional]* + + Nickame of the person. + Example `person` input: ```markdown @@ -420,3 +420,5 @@ Without an explicitly given picture, a generic icon is used. This input: ```markdown {{}} ``` + +This renders as {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}. diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md index 1b605ed..340553b 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md @@ -2,7 +2,7 @@ weight: 4 title: "主题文档 - 扩展 Shortcodes" date: 2020-03-03T16:29:59+08:00 -lastmod: 2020-03-03T16:29:59+08:00 +lastmod: 2020-06-12T10:10:13+03:00 draft: false author: "Dillon" authorLink: "https://dillonzq.com" @@ -249,7 +249,7 @@ This is a **right-aligned** paragraph. `admonition` shortcode 有以下命名参数: -* **type** *[必需]* (**第一个**位置参数) +* **type** *[可选]* (**第一个**位置参数) `admonition` 横幅的类型, 默认值是 `note`. @@ -375,3 +375,45 @@ console.log('Hello LoveIt!'); {{< /raw >}} 原始的带有 Markdown 语法的内容: {{< raw >}}**Hello**{{< /raw >}} + +## 13 person + +`person` shortcode 用来在你的文章中以 [h-card](http://microformats.org/wiki/h-card) 的格式插入个人网站链接. + +`person` shortcode 有以下命名参数: + +* **url** *[必需]* (**第一个**位置参数) + + URL of the personal page. + +* **name** *[必需]* (**第二个**位置参数) + + Name of the person. + +* **text** *[可选]* (**第三个**位置参数) + + Text to display as hover tooltip of the link. + +* **picture** *[可选]* (**第四个**位置参数) + + A picture to use as person's avatar. + +* **nick** *[可选]* + + Nickame of the person. + +一个 `person` 示例: + +```markdown +{{}} +``` + +呈现的输出效果为 {{< person url="https://evgenykuznetsov.org" name="Evgeny Kuznetsov" nick="nekr0z" text="author of this shortcode" picture="https://evgenykuznetsov.org/img/avatar.jpg" >}}. + +一个使用通用图标的 `person` 示例: + +```markdown +{{}} +``` + +呈现的输出效果为 {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}.