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

zennを書くのに便利なツールを追加 #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: reviewdog
on: [pull_request]
jobs:
textlint:
name: runner / textlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: textlint-github-pr-review
uses: tsuyoshicho/action-textlint@v3
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: warning
textlint_flags: 'articles/**'
39 changes: 39 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"plugins": {
"@textlint/markdown": {
"extensions": [
".md"
]
}
},
"rules": {
"preset-ja-technical-writing": {
"no-exclamation-question-mark": {
"allowFullWidthExclamation": true,
"allowFullWidthQuestion": true
},
"no-doubled-joshi": {
"strict": false,
"allow": [
"か"
]
}
},
"preset-ja-spacing": {
"ja-space-between-half-and-full-width": {
"space": "always",
"exceptPunctuation": true
},
"ja-space-around-code": {
"before": true,
"after": true
}
},
"ja-technical-writing/ja-no-mixed-period": {
"allowPeriodMarks": [
":"
]
},
"ja-technical-writing/sentence-length": false
}
}
6 changes: 4 additions & 2 deletions articles/33f452bb53f2d6aee956.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ type: "tech" # tech: 技術記事 / idea: アイデア
topics: ["nextjs", "firebase", "typescript", "react"]
published: true
---

備忘録としてまとめます。
※ 2021/11/05 追記
:::message alert
FireBase v8 時点でのやり方ですFireBase v9で使うと正しく動作しない可能性があります
:::

# 完成したもの

Expand Down
15 changes: 15 additions & 0 deletions articles/72893137792f27.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "Next.jsでのLintルールまとめ"
emoji: "📦"
type: "tech" # tech: 技術記事 / idea: アイデア
topics: ["nextjs", "eslint"]
published: false
---

# Next.js × TypeScript のプロジェクトで使っている ESLint などの Lint ツールとその設定のまとめです

# ESlint

# 参考にしたサイト

https://zenn.dev/yoshiko/articles/0994f518015c04
10 changes: 6 additions & 4 deletions articles/cc930e4f0ee080.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ type: "tech" # tech: 技術記事 / idea: アイデア
topics: ["mac", "safari", "ios"]
published: true
---
## ※ 初期のbeta版の情報です。製品版が出た時には仕様が変わっている可能性があります。

## ※ 初期の beta 版の情報です。製品版が出た時には仕様が変わっている可能性があります。

# Mac 版を試す

こんにちは Safari 15 で色々な点で変更されました。今回はその Safari 15 の Beta 版が使えるようになったのでいくつか試してみようと思います。
Expand All @@ -16,7 +18,7 @@ https://developer.apple.com/videos/play/wwdc2021/10029/
Beta 版のインストールはこちらから、対応 OS は Big Sur と Monterey です
https://developer.apple.com/safari/download/

試しに [Apple.com](https://www.apple.com) を開いてみるとこんな感じ
試しに [Apple.com](https://www.apple.com) を開いてみるとこんな感じ

![](https://storage.googleapis.com/zenn-user-upload/ed0e7f5263002aed2baf3555.png)

Expand All @@ -37,7 +39,7 @@ https://developer.apple.com/documentation/safari-release-notes/safari-15-beta-re

https://new-safari-test.vercel.app

ライトモードではモードではほぼすべての色に変わるようなんですが、ダークモードだと,下の画像のようにメニューバーを`#fefefe`などの明るい色になるようにしたときに、メニューバーが黒くなるようです。
ライトモードではモードではほぼすべての色に変わるようなんですが、ダークモードだと,下の画像のようにメニューバーを `#fefefe` などの明るい色になるようにしたときに、メニューバーが黒くなるようです。

![](https://storage.googleapis.com/zenn-user-upload/2884249820624ed2a6f5df09.png)

Expand All @@ -61,7 +63,7 @@ https://new-safari-test.vercel.app
下のはそのソースコードです。
@[codesandbox](https://codesandbox.io/embed/nextjs-theme-color-test-h10cq?fontsize=14&hidenavigation=1)

実機に iOS15 を入れるか https://developer.apple.com/download/ から Xcode のベータ版をインストールして iOS 15 の Simulator を起動して試してみてください
実機で試したい場合は iOS15 を入れるか https://developer.apple.com/download/ から Xcode のベータ版をインストールして iOS 15 の Simulator を起動して https://csb-h10cq-hd3y2mu6e-mochi3.vercel.app/ を開いてみてください

# 感想

Expand Down
14 changes: 7 additions & 7 deletions articles/dc0cd0d6567f21f98377.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "Next jsをGitHub Pageにデプロイしたときにnext/linkが正しく遷移するようにする"
emoji: "📄"
type: "tech" # tech: 技術記事 / idea: アイデア
topics: ["nextjs", "github", "githubactions", "githubpages"]
title: 'Next jsをGitHub Pageにデプロイしたときにnext/linkが正しく遷移するようにする'
emoji: '📄'
type: 'tech' # tech: 技術記事 / idea: アイデア
topics: ['nextjs', 'github', 'githubactions', 'githubpages']
published: true
---

# 状況

Nextjs のプロジェクトで GitHub Pages にデプロイし 下のようなコードを書いた時に `https://aaaaaaaaaaaaaa.github.io/bbbbbbbbbbbb/page1`に遷移してほしいのに `https://aaaaaaaaaaaaaa.github.io/page1`に遷移してしまう。
Nextjs のプロジェクトで GitHub Pages にデプロイし下のようなコードを書いた時に `https://aaaaaaaaaaaaaa.github.io/bbbbbbbbbbbb/page1` へ遷移してほしいが `https://aaaaaaaaaaaaaa.github.io/page1` に遷移してしまう。

```tsx
<Link href="/page1">
Expand All @@ -20,11 +20,11 @@ Nextjs のプロジェクトで GitHub Pages にデプロイし 下のような

## GitHub 側

GitHub の`Settings > Environments`から `github-pages`を選んで 環境変数名には`BASE_PATH`、`value`には`/<Github Pagesのリポジトリ名>`を入力する
GitHub の `Settings > Environments` から `github-pages` を選んで環境変数名には `BASE_PATH`、`value` には `/<Github Pagesのリポジトリ名>` を入力する

## Next.js 側

`next.config.js`でこのように trailingSlash を true にすることで html ファイルが `pagepath/index.html` のように生成されるようにした生成されるようにし、basePath と assetPrefix を GitHub Pages のベース URL 設定します。これを入力してから、もう一度ビルドすると正しくページが遷移するようになります。
`next.config.js` でこのように trailingSlash を true にすることで html ファイルが `pagepath/index.html` のように生成されるようにした生成されるよう、 basePath と assetPrefix を GitHub Pages のベース URL 設定します。これを入力してから、もう一度ビルドすると正しくページが遷移するようになります。

```js:next.config.js
module.exports = {
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
"author": "mochi-sann <44772513+mochi-sann@users.noreply.github.com>",
"license": "MIT",
"dependencies": {
"zenn-cli": "^0.1.89"
"zenn-cli": "^0.1.98"
},
"scripts": {
"start": "zenn preview"
},
"devDependencies": {
"textlint": "^12.0.2",
"textlint-rule-preset-ja-spacing": "^2.2.0",
"textlint-rule-preset-ja-technical-writing": "^7.0.0"
}
}