Skip to content

Commit

Permalink
typoの修正・lintの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaji255 committed Dec 3, 2023
1 parent 012460b commit ab4262f
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- run: npm run typecheck

validate-blog:
if: startsWith(github.head_ref, 'blog/')
if: startsWith(github.head_ref, 'blog/') && !startsWith(github.head_ref, 'blog/admin/')
needs: [build, lint, typecheck]
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.update_blogmeta.outputs.UPDATE_RESULT != '1' && steps.update_blogmeta.outputs.UPDATE_RESULT != '0'
- name: Git Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "[Bot] Update blog meta"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/content/blogs/
87 changes: 44 additions & 43 deletions README_BLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

OUCC BLOG の仕様について記載しています。何もわからない場合はサーバー係に投稿したい Markdown ファイルを渡してください。

ブログの投稿を行う際は `blog/` から始まるブランチで作業してください。ブログの投稿に関する作業以外は禁止されていますが、CIによる支援が得られます。
ブログの投稿を行う際はブランチ名が `blog/` で始まるブランチを作成し作業してください。このブランチではブログの投稿に関する作業以外は禁止されていますが、後述するようにCIによる支援が得られます。

ブログに関して作業することを明示しつつこの制約を受けたくない場合は、ブランチ名が `blog/admin/` で始まるブランチで作業してください。

## 記事の投稿

Expand All @@ -14,15 +16,15 @@ title: タイトル
description: 説明
author: 著者
tags:
- タグ1
- タグ2
- タグ3
- タグ1
- タグ2
- タグ3
---
```

画像ファイル`src/content/blogs` に新しいディレクトリを作成してそこに配置する、または外部においてURLで指定してください。
画像ファイルは `src/content/blogs` に新しいディレクトリを作成してそこに配置するか、または外部においてURLで指定してください。

※ ファイル名には`#`含めることができません
※ ファイル名には `#` を含めることができません

## 記事のメタ情報

Expand All @@ -31,7 +33,7 @@ tags:
以下のようにコマンドを使うことで手動で更新することもできます。

```bash
$ npm run update-blogmeta -- src/content/blogs/NEW-POST1.md src/content/blogs/NEW-POST2.md
$ npm run update-blogmeta -- src/content/blogs/NEW-POST1.md src/content/blogs/NEW-POST2.md
```

## 著者
Expand All @@ -48,17 +50,18 @@ $ npm run update-blogmeta -- src/content/blogs/NEW-POST1.md src/content/blogs/NE

```ts
interface Author {
name: string,
description?: string,
github?: string,
image?:
({
type: "svg",
name: string,
} | {
type: "external-url"
url: string,
})
name: string
description?: string
github?: string
image?:
| {
type: 'svg'
name: string
}
| {
type: 'external-url'
url: string
}
}
```

Expand All @@ -84,30 +87,28 @@ interface Author {

```ts
interface Tag {
name: string,
description?: string,
image?:
({
type: "svg",
name: string,
} | {
type: "external-url"
url: string,
})
site?:
{
url: string,
text?: string
},
document?:
{
url: string,
text?: string
},
github?:
{
url: string,
text?: string
},
name: string
description?: string
image?:
| {
type: 'svg'
name: string
}
| {
type: 'external-url'
url: string
}
site?: {
url: string
text?: string
}
document?: {
url: string
text?: string
}
github?: {
url: string
text?: string
}
}
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "astro preview",
"astro": "astro",
"typecheck": "astro check && tsc --noEmit",
"lint": "prettier --check \"./**/*.{ts,tsx,astro,json}\"",
"format": "prettier --write \"./**/*.{ts,tsx,astro,json}\"",
"lint": "prettier --check .",
"format": "prettier --write .",
"validate-blog": "ts-node --esm tools/validate-blog.ts",
"update-blogmeta": "ts-node --esm tools/update-blogmeta.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/blog/BlogListItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tags = await getEntries(blog.tags)
{blog.title}
</h2>
</a>
{(<TagList tags={tags} />)}
<TagList tags={tags} />
<div class="px-2 flex gap-3 text-gray-600">
<div class="hover:underline">
<a href={`/blog/authors/${author.id}`} class="flex gap-2 items-center"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/blog/[slug]/ogp.png.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createOgImage } from '@/components/blog/OgImage'
import { createOgImage } from '@/pages/blog/[slug]/_OgImageGenerator'
import type { APIContext } from 'astro'
import { getCollection, getEntry } from 'astro:content'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/authors/[slug]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ogpPath =
author.data.github
? `https://github.com/${author.data.github}.png`
: author.data.image.type === 'svg'
? `/author/${author.id}/ogp.png`
? `/authors/${author.id}/ogp.png`
: author.data.image.type === 'external-url'
? author.data.image.url
: unreachable(author.data.image)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/tags/[slug]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const isShowAbout = tag.description || tag.site || tag.document || tag.github
title={`${tag.name}の記事一覧`}
description={tag.description ?? `${tag.name}に関する記事が集まっています`}
image={tag.image.type === 'svg'
? `/blog/tag/${id}/ogp.png`
? `/blog/tags/${id}/ogp.png`
: tag.image.type === 'external-url'
? tag.image.url
: unreachable(tag.image)}
Expand Down

0 comments on commit ab4262f

Please sign in to comment.