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

fix: date format for posts list, chore: create Japanese template #647

Merged
merged 4 commits into from
Aug 7, 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
2 changes: 2 additions & 0 deletions exampleSite/config/_default/config.ja.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title = "Hugo Bootstrap"
hasCJKLanguage = true
2 changes: 1 addition & 1 deletion exampleSite/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ copyright = "Copyright © 2016-{year} Razon Yang. All Rights Reserved."
# Multilingual mode
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true # If you use only one language comment this option
# disableLanguages = ["fr", "zh-cn" ,"zh-tw", "ar"] # Uncomment in order to disable one or more language
# disableLanguages = ["fr", "zh-cn" ,"zh-tw", "ar", "ja"] # Uncomment in order to disable one or more language

# Pagination
paginate = 10
Expand Down
9 changes: 9 additions & 0 deletions exampleSite/config/_default/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@
weight = 5
[ar.params]
description = "ثيم مدونة مصمم لـ هوجو سريع وغني بالميزات"

[ja]
languageName = "日本語"
weight = 6
[ja.params]
description = "Hugo向けにカスタマイズされた非常に高速で応答性の高い、機能豊富なブログテーマ"
keywords = "Hugo, Bootstrap, ブログテーマ"
[ja.params.archive]
dateFormat = "1/2"
3 changes: 3 additions & 0 deletions exampleSite/content/archives/2019/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "2019"
+++
3 changes: 3 additions & 0 deletions exampleSite/content/archives/2020/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "2020"
+++
3 changes: 3 additions & 0 deletions exampleSite/content/archives/2021/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "2021"
+++
3 changes: 3 additions & 0 deletions exampleSite/content/archives/2022/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "2022"
+++
7 changes: 7 additions & 0 deletions exampleSite/content/archives/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "アーカイブ"
[menu.main]
parent = "blog"
weight = 1
pre = '<i class="fas fa-fw fa-archive me-1"></i>'
+++
7 changes: 7 additions & 0 deletions exampleSite/content/authors/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "著者"
[menu.main]
parent = "blog"
weight = 5
pre = '<i class="fas fa-fw fa-user me-1"></i>'
+++
8 changes: 8 additions & 0 deletions exampleSite/content/authors/hugo/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Hugoの著者
description: Hugoは、最も人気のあるオープンソースの静的サイトジェネレータの1つです。驚異的なスピードと柔軟性で、Hugoはウェブサイトを作る楽しみを再び与えてくれます。
social:
github: gohugoio
twitter: GoHugoIO
website: https://gohugo.io/
---
11 changes: 11 additions & 0 deletions exampleSite/content/authors/razonyang/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Razon Yang
description: Gopher、PHPer、フルスタックエンジニア。
social:
github: razonyang
twitter: razonyang
email: razonyang@gmail.com
website: https://razonyang.com/
patreon: razonyang
paypal: razonyang
---
7 changes: 7 additions & 0 deletions exampleSite/content/categories/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "カテゴリ"
[menu.main]
parent = "blog"
weight = 3
pre = '<i class="fas fa-fw fa-folder me-1"></i>'
+++
8 changes: 8 additions & 0 deletions exampleSite/content/contact/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "お問い合わせ"
layout = "contact"
[menu.footer]
parent = "support"
weight = 6
pre = '<i class="fas fa-fw fa-info-circle me-1"></i>'
+++
3 changes: 3 additions & 0 deletions exampleSite/content/docs/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "文書"
+++
70 changes: 70 additions & 0 deletions exampleSite/content/docs/layouts/faq/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
+++
title = "FAQレイアウト"
date = 2021-12-07T21:46:43+08:00
featured = false
comment = true
toc = true
reward = true
categories = [
"FAQ"
]
tags = [
]
series = [
"Docs"
]
images = []
aliases = [
"/ja/posts/faq",
"/ja/docs/faq"
]
authors = ["RazonYang"]
+++

よくある質問を集めた「[FAQ]({{< ref "/faq" >}})」ページです。

<!--more-->

## 前提条件

`content` ディレクトリに `faq/index.md` というページを作成する必要があります。

```toml
+++
title = "よくある質問"
layout = "faq"
+++
```

## データ

データは `data` ディレクトリに格納され、ディレクトリ構造は以下の通りである。

```text
data
/ja
/faq
foo.json
bar.json
/en
/faq
foo.json
bar.json
```

ご覧のように、私たちは質問を言語によって分類しています。そして、各ファイルは以下のような同じ形式の質問のグループを表します。

```json
{
"title": "グループの件名",
"weight": 1,
"questions": [
{
"question": "質問",
"answer": "回答"
}
]
}
```

- `weight` パラメータは、グループを昇順にソートするために使用されます。
12 changes: 12 additions & 0 deletions exampleSite/content/faq/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+++
title = "よくある質問"
layout = "faq"
[menu.main]
parent = "support"
weight = 6
pre = '<i class="fas fa-fw fa-question-circle me-1"></i>'
[menu.footer]
parent = "support"
weight = 6
pre = '<i class="fas fa-fw fa-question-circle me-1"></i>'
+++
3 changes: 3 additions & 0 deletions exampleSite/content/offline/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = 'オフライン'
+++
3 changes: 3 additions & 0 deletions exampleSite/content/posts/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "投稿"
+++
3 changes: 3 additions & 0 deletions exampleSite/content/search/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
title = "検索"
+++
7 changes: 7 additions & 0 deletions exampleSite/content/series/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "シリーズ"
[menu.main]
parent = "blog"
weight = 2
pre = '<i class="fas fa-fw fa-columns me-1"></i>'
+++
7 changes: 7 additions & 0 deletions exampleSite/content/tags/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "タグ"
[menu.main]
parent = "blog"
weight = 4
pre = '<i class="fas fa-fw fa-tags me-1"></i>'
+++
10 changes: 10 additions & 0 deletions exampleSite/data/ja/faq/hugo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"title": "Hugo",
"weight": 2,
"questions": [
{
"question": "Hugoとは何?",
"answer": "HugoはGoで書かれた高速でモダンな静的サイトジェネレータで、ウェブサイト制作を再び楽しくするために設計されています。"
}
]
}
26 changes: 26 additions & 0 deletions exampleSite/data/ja/faq/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "テーマ",
"weight": 1,
"questions": [
{
"question": "FAQページの設置方法は?",
"answer": "こちらもご覧下さい [FAQ Page](/ja/posts/faq)."
},
{
"question": "FAQページはMarkdown構文に対応していますか?",
"answer": "もちろん、次のような有効なMarkdown構文を入力することができます。 `code`, *italic*, **bold text** etc.\n#### Table\n| Foo |\n|:---|\n| Bar |\n#### List\n- One\n- Two\n"
},
{
"question": "アイコンを増やすには?",
"answer": "こちらもご覧下さい [Look and Feel](/ja/posts/look-and-feel#icons)."
},
{
"question": "言語を削除するには?",
"answer": "zh-cn`を例にとって考えてみよう。\n- `config/_default/languages.toml`から言語を削除\n- コマンドによるコンテンツの削除 `find . -type f -name \"*.zh-cn.*\" -delete`."
},
{
"question": "新しい言語を追加するには?",
"answer": "- 新しい言語を `config/_default/languages.toml`に追加\n- [Write Articles](/en/docs/content/)."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| German | `de` |
| French | `fr` |
| Indonesian | `id` |
| Japanese | `ja` |
| Polish | `pl` |
| Portuguese | `pt` |
| Russian | `ru` |
Expand Down
Loading