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

Add text shortcodes #605

Merged
merged 2 commits into from
Jul 15, 2022
Merged
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
52 changes: 52 additions & 0 deletions exampleSite/content/docs/shortcodes/text/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
+++
# type = "docs"
title = "Text Shortcodes"
linkTitle = "Text"
date = 2022-07-15T01:00:43+08:00
# description = "" # Used by description meta tag, summary will be used instead if not set or empty.
featured = false
draft = false
comment = true
toc = true
reward = true
pinned = false
carousel = false
categories = ["Shortcode"]
tags = ["Text", "Text Alignment", "Text Transform", "Text Selection"]
series = ["Docs"]
images = []
+++

In this article, we will explore some shortcodes for text, such as alignment, transform and selection.

<!--more-->

## Text Transform

{{< text/lowercase >}}Lowercased text.{{< /text/lowercase >}}
{{< text/uppercase >}}Uppercased text.{{< /text/uppercase >}}
{{< text/capitalize >}}CapiTaliZed text.{{< /text/capitalize >}}

## Text Alignment

{{< text/align-start >}}
Align text to the start.
{{< /text/align-start >}}

{{< text/align-center >}}
Align text to the center.
{{< /text/align-center >}}

{{< text/align-end >}}
Align text to the end.
{{< /text/align-end >}}

## Text Selection

{{< text/user-select-all >}}
This paragraph will be entirely selected when clicked by the user.
{{< /text/user-select-all >}}

{{< text/user-select-none >}}
This paragraph will not be selectable when clicked by the user.
{{< /text/user-select-none >}}
52 changes: 52 additions & 0 deletions exampleSite/content/docs/shortcodes/text/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
+++
# type = "docs"
title = "文本 Shortcodes"
linkTitle = "文本"
date = 2022-07-15T01:00:43+08:00
# description = "" # Used by description meta tag, summary will be used instead if not set or empty.
featured = false
draft = false
comment = true
toc = true
reward = true
pinned = false
carousel = false
categories = ["Shortcode"]
tags = ["文本", "文本对齐", "文本转换", "文本选择"]
series = ["文档"]
images = []
+++

在本文中,我们将探讨文本的一些短代码,例如文本的对齐、转换和选择。

<!--more-->

## 文本转换

{{< text/lowercase >}}Lowercased text.{{< /text/lowercase >}}
{{< text/uppercase >}}Uppercased text.{{< /text/uppercase >}}
{{< text/capitalize >}}CapiTaliZed text.{{< /text/capitalize >}}

## 文本对齐

{{< text/align-start >}}
Align text to the start.
{{< /text/align-start >}}

{{< text/align-center >}}
Align text to the center.
{{< /text/align-center >}}

{{< text/align-end >}}
Align text to the end.
{{< /text/align-end >}}

## 文本选择

{{< text/user-select-all >}}
This paragraph will be entirely selected when clicked by the user.
{{< /text/user-select-all >}}

{{< text/user-select-none >}}
This paragraph will not be selectable when clicked by the user.
{{< /text/user-select-none >}}
52 changes: 52 additions & 0 deletions exampleSite/content/docs/shortcodes/text/index.zh-tw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
+++
# type = "docs"
title = "文本 Shortcodes"
linkTitle = "文本"
date = 2022-07-15T01:00:43+08:00
# description = "" # Used by description meta tag, summary will be used instead if not set or empty.
featured = false
draft = false
comment = true
toc = true
reward = true
pinned = false
carousel = false
categories = ["Shortcode"]
tags = ["文本", "文本對齊", "文本轉換", "文本選擇"]
series = ["文檔"]
images = []
+++

在本文中,我們將探討文本的一些短代碼,例如文本的對齊、轉換和選擇。

<!--more-->

## 文本轉換

{{< text/lowercase >}}Lowercased text.{{< /text/lowercase >}}
{{< text/uppercase >}}Uppercased text.{{< /text/uppercase >}}
{{< text/capitalize >}}CapiTaliZed text.{{< /text/capitalize >}}

## 文本對齊

{{< text/align-start >}}
Align text to the start.
{{< /text/align-start >}}

{{< text/align-center >}}
Align text to the center.
{{< /text/align-center >}}

{{< text/align-end >}}
Align text to the end.
{{< /text/align-end >}}

## 文本選擇

{{< text/user-select-all >}}
This paragraph will be entirely selected when clicked by the user.
{{< /text/user-select-all >}}

{{< text/user-select-none >}}
This paragraph will not be selectable when clicked by the user.
{{< /text/user-select-none >}}
1 change: 1 addition & 0 deletions layouts/shortcodes/text/align-center.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="text-center">{{ .Inner }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/align-end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="text-end">{{ .Inner }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/align-start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="text-start">{{ .Inner }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/capitalize.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="text-capitalize">{{ .Inner }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/lowercase.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>{{ .Inner | lower }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/uppercase.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>{{ .Inner | upper }}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/user-select-all.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="user-select-all">{{- .Inner -}}</p>
1 change: 1 addition & 0 deletions layouts/shortcodes/text/user-select-none.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="user-select-none">{{- .Inner -}}</p>
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const stats = './hugo_stats.json';
const fs = require('fs');
fs.access(stats, fs.F_OK, (err) => {
if (err) {
throw new Error('Hugo stats file not found, please turn on the build.writeStats.\n\n# /config/_default/config.toml\n[build]\n writeStats = true\n')
throw new Error('Hugo stats file not found, please turn on the "build.writeStats". See also https://hbs.razonyang.com/v1/en/docs/getting-started/prerequisites/#configuration.')
}
});

Expand Down