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

ソーシャルカードプラグインを導入する #1117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
93e7f86
Azure AD B2C サンプルのReadMeの誤字修正とcspellの除外設定追加 (#1051)
fkoyama Apr 9, 2024
04d33ae
アプリケーションアーキテクチャ概要編からコンソールアプリの要件別サンプルにリンクを張る (#1057)
KentaHizume Apr 9, 2024
379efaf
documentsのreadmeを最新化する (#1062)
fkoyama Apr 9, 2024
42feb0e
Merge branch 'main' of https://github.com/AlesInfiny/maris
fkoyama Apr 17, 2024
45a2fb9
mkdocs.ymlとドキュメントリリース用のYAMLに設定を追加。
fkoyama Apr 18, 2024
e26eb00
pngquantをsudoでインストールするよう修正。
fkoyama Apr 18, 2024
88d2f0d
enabledの設定を削除。
fkoyama Apr 18, 2024
e033638
プラグインの記載位置を変更。
fkoyama Apr 18, 2024
f15cce2
lintエラーに対応。
fkoyama Apr 18, 2024
f80e295
BUILD_DOCUMENTS=trueの時にソーシャルカードを生成するよう修正。
fkoyama Apr 18, 2024
4ead06a
不要な設定を削除。
fkoyama Apr 18, 2024
1d2ef17
タイトルとロゴのみのソーシャルカードを生成。
fkoyama Apr 18, 2024
0685f50
インデントを修正。
fkoyama Apr 18, 2024
9be613b
不要なスペースを削除。
fkoyama Apr 18, 2024
17e1e6b
タイトルのみを表示する。
fkoyama Apr 18, 2024
fe648fa
アイコンの設定を修正。
fkoyama Apr 18, 2024
1a268db
アイコンの設定を削除。
fkoyama Apr 18, 2024
e5793ee
デフォルトのソーシャルカードのdescriptionを非表示にする。
fkoyama Apr 18, 2024
96e69b1
不要なファイルを削除。
fkoyama Apr 18, 2024
752f9de
ソーシャルカード内にtitleとdescriptionが入るきるよう修正。
fkoyama Apr 19, 2024
95c7971
titleが付いていないページにtitle追加。
fkoyama Apr 19, 2024
db5ff09
descriptionの文字数を調整。
fkoyama Apr 19, 2024
05dc3a4
descriptionのスペースを調整。
fkoyama Apr 19, 2024
2f4b022
「.NET Fw」の表記を修正。
fkoyama Apr 23, 2024
b0445e3
READMEにソーシャルカードについての説明を追加。
fkoyama Apr 23, 2024
b3abb53
descriptionが抜けている部分に追記。
fkoyama Apr 24, 2024
4428993
titleとdescriptionを設定するようmarkdownlintのルールを追加。
fkoyama Apr 25, 2024
3308d0e
Merge branch 'main' into feature/ソーシャルカードプラグインを導入する
fkoyama Apr 25, 2024
fa42ed8
Merge branch 'main' of https://github.com/AlesInfiny/maris
fkoyama Apr 25, 2024
d42f57b
商標ページのdescriptionを修正。
fkoyama Apr 26, 2024
706c512
Merge branch 'main' of https://github.com/AlesInfiny/maris
fkoyama Apr 26, 2024
ec17a8f
Merge branch 'main' into feature/ソーシャルカードプラグインを導入する
fkoyama Apr 26, 2024
d592b76
Merge branch 'feature/ソーシャルカードプラグインを導入する' of https://github.com/AlesI…
fkoyama Apr 26, 2024
a49597f
ソーシャルカードの確認方法を修正。
fkoyama Apr 26, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/build-and-release-documents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: ドキュメントのビルドとリリース

on:
push:
branches: [main]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-Beta[0-9]+'
workflow_dispatch:

permissions:
id-token: write
contents: write

env:
APP_ALESINFINY_MARIS_WEBAPP_NAME: app-alesinfiny-maris-docs-prod
Expand Down Expand Up @@ -52,6 +52,7 @@ jobs:
uses: ./.github/workflows/compress-sample-source
with:
compressed-source-path: ${{ env.DOCUMENT_BASE_PATH }}/${{ env.COMPRESSED_SOURCE_PATH }}

- name: ドキュメントのビルド
uses: ./.github/workflows/build-documents
with:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build-documents/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: "ドキュメントのビルド"
description: "ドキュメントをビルドします。"
inputs:
document-base-path:
desctiption: "ドキュメントのベースフォルダパス"
description: "ドキュメントのベースフォルダパス"
required: true
output-folder-name:
desctiption: "ビルドしたドキュメントの出力先フォルダ名"
description: "ビルドしたドキュメントの出力先フォルダ名"
required: true
runs:
using: "composite"
Expand All @@ -21,6 +21,12 @@ runs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

- name: ソーシャルカードプラグイン用のパッケージインストール
shell: bash
run: |
python -m pip install "mkdocs-material[imaging]"
sudo apt-get install pngquant

- id: setup-version
name: ドキュメントのバージョン設定
shell: bash
Expand All @@ -37,6 +43,7 @@ runs:
continue-on-error: true
shell: bash
run: |
export BUILD_DOCUMENTS=true
cd "${{ inputs.document-base-path }}"
echo '# Mkdocs Build Result :factory:' >> $GITHUB_STEP_SUMMARY
mkdocs build --verbose --clean --strict --site-dir "${{ inputs.output-folder-name }}" > mkdocs_build_log.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compress-sample-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "サンプルアプリケーションのソースコード圧縮"
description: "サンプルアプリケーションのソースコードを圧縮します。"
inputs:
compressed-source-path:
desctiption: "圧縮したソースコードを配置するフォルダのGITHUB_WORKSPACEからの相対パス"
description: "圧縮したソースコードを配置するフォルダのGITHUB_WORKSPACEからの相対パス"
required: true

runs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-documents/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
shell: bash
run: |
echo '## Markdownlint Result' >> $GITHUB_STEP_SUMMARY
npx markdownlint --config .markdownlint.yaml --ignore **/node_modules/** --output markdownlint-result.txt .
npx markdownlint --config .markdownlint.yaml --rules custom-lint-rules --ignore **/node_modules/** --output markdownlint-result.txt .
echo ':heavy_check_mark: Markdownlint に成功しました。' >> $GITHUB_STEP_SUMMARY

- name: Markdownlint 失敗時の結果表示
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pack-and-upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "ビルドアーティファクトのパッケージングとアップロ
description: "ドキュメントをzip化してアップロードします。"
inputs:
packaging-folder-path:
desctiption: "パッケージングする対象のGITHUB_WORKSPACEからの相対パス"
description: "パッケージングする対象のGITHUB_WORKSPACEからの相対パス"
required: true
document-artifact-path:
description: "zipファイルのGITHUB_WORKSPACEからの相対パス"
Expand Down
37 changes: 37 additions & 0 deletions custom-lint-rules/requires-title-and-description.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

const hasTitleAndDescription = (params, onError) => {
const title_line = params.frontMatterLines.filter((line) =>
line.startsWith("title: ")
);
const description_line = params.frontMatterLines.filter((line) =>
line.startsWith("description: ")
);
if (title_line.length < 1) {
onError({
lineNumber: 1,
detail: "Title is not specified",
});
} else if (title_line.length > 1) {
onError({
lineNumber: 1,
detail: "Document files are not allowed to specify multiple lists of title",
});
} else if (description_line.length < 1) {
onError({
lineNumber: 1,
detail: "Description is not specified",
});
} else if (description_line.length > 1) {
onError({
lineNumber: 1,
detail: "Document files are not allowed to specify multiple lists of description",
});
}
};

module.exports = {
names: ["CMD001", "requires-title-and-description"],
description: "All documents should specify title and description",
tags: ["custom"],
function: hasTitleAndDescription,
};
39 changes: 39 additions & 0 deletions documents/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<!-- textlint-disable @textlint-rule/require-header-id -->
<!-- markdownlint-disable-file CMD001 -->

# AlesInfiny Maris OSS Edition ドキュメントについて

<!-- cSpell:ignore hoge hogehoge dotnetfw pymdown -->
Expand Down Expand Up @@ -218,6 +220,43 @@ cSpell の拡張機能をインストールしていると、 [問題] ウィン

<https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell#ignore>

### 各ページの title/description の設定

以下のように、各 markdown ファイルの上部に `title` と `description` を設定しています。

``` text
---
title: CSR 編
description: クライアントサイドレンダリングを行う Web アプリケーションの アーキテクチャについて解説します。
---
```

ここで設定した `title` と `description` を元にソーシャルカードが生成されるため、以下の文字数を守って設定します。
( `description` を省略すると、 mkdocs.yml の `site_description` の値が設定されます。)

- カード上に表示できる文字数
- `title`:全角 9 文字×3 行まで
- `description`: 半角 59 文字(全角だと 30 文字目が半分途切れる)× 2 行まで

※スペースを空けないと 1 単語とみなされ、同じ行に詰め込もうとして文章が途切れるので適宜スペースで区切ってください。

- 例:

- `title: .NETアプリケーションの処理方式` の場合
![ソーシャルカード失敗例](readme-images/social-card-example-error.png)
- `title: .NET アプリケーションの 処理方式` の場合
![ソーシャルカード](readme-images/social-card-example.png)

文字が途切れていないか等を適宜確認してください。
ソーシャルカードはローカルでは生成せず、 CI 上でのドキュメントビルド時に生成されるよう設定しています。
生成されたソーシャルカードは以下の手順で確認してください。

1. GitHub Actions の「ドキュメントのビルド(CI 用)」を開き、対象のブランチを選択してワークフローを実行します。

1. 実行したワークフローの Summary の Artifacts から documents をダウンロードします。

1. ダウンロードした documents.zip 内の docs.zip を解凍し、`assets/images/social` に生成されたソーシャルカードを確認します。

### 修正内容のコミット

記事の作成と体裁の修正が完了したら、 Feature ブランチにコミットします。
Expand Down
1 change: 1 addition & 0 deletions documents/contents/about-maris/credits.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: クレジット表記
description: AlesInfiny Maris OSS Edition ポータルサイトのクレジット表記です。
---

<!-- textlint-disable @textlint-rule/require-header-id -->
Expand Down
1 change: 1 addition & 0 deletions documents/contents/about-maris/terms.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 利用規約
description: AlesInfiny Maris OSS Edition ポータルサイトの利用規約です。
---

# 利用規約 {#top}
Expand Down
1 change: 1 addition & 0 deletions documents/contents/about-maris/trademarks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 商標
description: AlesInfiny Maris OSS Edition の商標について説明します。
---

# 商標 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CSR 編
description: クライアントサイドレンダリングを行う Web アプリケーションのアーキテクチャについて解説します
description: クライアントサイドレンダリングを行う Web アプリケーションの アーキテクチャについて解説します
---

# CSR アーキテクチャ概要 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CSR 編
description: クライアントサイドレンダリングを行う Web アプリケーションのアーキテクチャについて解説します
description: クライアントサイドレンダリングを行う Web アプリケーションの アーキテクチャについて解説します
---

# フロントエンドアーキテクチャ {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CSR 編
description: クライアントサイドレンダリングを行う Web アプリケーションのアーキテクチャについて解説します
description: クライアントサイドレンダリングを行う Web アプリケーションの アーキテクチャについて解説します
---

# 全体処理方式 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CSR 編
description: クライアントサイドレンダリングを行う Web アプリケーションのアーキテクチャについて解説します
description: クライアントサイドレンダリングを行う Web アプリケーションの アーキテクチャについて解説します
---

# クライアントサイドレンダリング編 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
---
title: CSR 編 - テスト
description: バックエンドアプリケーションのテスト方針について解説します。
---

# 単体テスト ( UT0 ) {#top}
5 changes: 5 additions & 0 deletions documents/contents/app-architecture/console-app/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
---
title: コンソール アプリケーション編
description: コンソールアプリケーションの アーキテクチャについて解説します。
---

# コンソールアプリケーション編 {#top}
5 changes: 5 additions & 0 deletions documents/contents/app-architecture/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: アプリケーション アーキテクチャ
description: AlesInfiny Maris OSS Edition を利用することで構築できる アプリケーションについて説明します。
---
tsuna-can-se marked this conversation as resolved.
Show resolved Hide resolved

# アプリケーションアーキテクチャ {#top}

- [概要編](./overview/index.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 概要編
description: AlesInfiny Maris OSS Edition を利用することで構築できるアプリケーションの概要を、アプリケーション形態ごとに説明します
description: AlesInfiny Maris OSS Edition を利用することで構築できる アプリケーションの概要を説明します
---

# 構築できるアプリケーション形態 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 概要編
description: AlesInfiny Maris OSS Edition を利用することで構築できるアプリケーションの概要を、アプリケーション形態ごとに説明します
description: AlesInfiny Maris OSS Edition を利用することで構築できる アプリケーションの概要を説明します
---

# アプリケーション構成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 概要編
description: AlesInfiny Maris OSS Edition のアプリケーションアーキテクチャ概要を解説します
description: AlesInfiny Maris OSS Edition を利用することで構築できる アプリケーションの概要を説明します
---

# 構成管理 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: .NETアプリケーションの処理方式
title: .NET アプリケーションの 処理方式
description: AlesInfiny Maris OSS Edition で構築する .NET アプリケーションの共通的な処理方式を解説します。
---

Expand Down
2 changes: 1 addition & 1 deletion documents/contents/app-architecture/overview/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 概要編
description: AlesInfiny Maris OSS Edition を利用することで構築できるアプリケーションの概要を、アプリケーション形態ごとに説明します
description: AlesInfiny Maris OSS Edition を利用することで構築できる アプリケーションの概要を説明します
---

# 概要編 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# ASP.NET Core Web API プロジェクトの構成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# ASP.NET Core with Vite プロジェクトの構成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# 結合テストプロジェクトの構成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# プロジェクト構造の作成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# プロジェクトの作成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# ソリューション構造の作成 {#top}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: .NET 編
description: バックエンドで動作する .NET アプリケーションの開発手順を解説します
description: バックエンドで動作する .NET アプリケーションの 開発手順を解説します
---

# ヘルスチェック API の実装 {#top}
Expand Down
Loading