Skip to content

Commit

Permalink
Merge pull request #1244 from tubone24/fix-textlint
Browse files Browse the repository at this point in the history
Fix textlint
  • Loading branch information
tubone24 committed Jan 14, 2023
2 parents 7f6e255 + ec64499 commit cb39ddc
Show file tree
Hide file tree
Showing 30 changed files with 270 additions and 351 deletions.
1 change: 0 additions & 1 deletion .textlintignore

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"browserslist:update": "npx browserslist --update-db",
"textlint": "npx textlint \"src/content/*.md\"",
"textlint:fix": "npx textlint --fix \"src/content/*.md\"",
"textlint:fix-ls": "npx textlint --fix",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"prepare": "husky install",
Expand Down Expand Up @@ -265,7 +266,7 @@
"yarn format-style:fix"
],
"src/content/*.md": [
"yarn textlint:fix"
"yarn textlint:fix-ls"
],
"*.md": [
"yarn format-md:fix"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ templateKey: blog-post
```

## なぜこんなことを・・・
## なぜこんなことを・・・

今更にはなりますがNetlify CMSを使ってみたくなったのでGatsbyを使ってブログ作ってみました。
いまさらにはなりますがNetlify CMSを使ってみたくなったのでGatsbyを使ってブログ作ってみました。

## 登場人物

### Netlify

<https://www.netlify.com/>


Netlifyとは静的ホスティングサービスですが、S3とは違いGithubのpush契機にBuildが走るCI機能などが充実していてこれでOK感ある。
Netlifyとは静的ホスティングサービスですが、S3とは違いGitHubのpush契機にBuildが走るCI機能などが充実していてこれでOK感ある。

Identityという認証も用意されているのでCMSサイトも作れちゃう。

Expand All @@ -44,7 +43,7 @@ Identityという認証も用意されているのでCMSサイトも作れちゃ
<https://www.netlifycms.org/>

NetlifyにGithubへのアクセスキーを持たせることで、CMS上でコンテンツを編集、GithubへのPushを一気にやってしまうことができます。
さらに記事のWorkflowも[Github Flow](http://scottchacon.com/2011/08/31/github-flow.html) に乗っけることができるので、CMSで編集しながらにしてレポジトリはぐちゃぐちゃにならない。
さらに記事のWorkflowも[GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html) に乗っけることができるので、CMSで編集しながらにしてレポジトリはぐちゃぐちゃにならない。

これ結構いいアイディア!

Expand All @@ -66,7 +65,7 @@ MarkdownをGithubにPostすれば完全に求めている感じのことがで

### Netlify対応版のGatsby-starterをダウンロードする

[https://github.com/netlify-templates/gatsby-starter-netlify-cms
[<https://github.com/netlify-templates/gatsby-starter-netlify-cms>
](https://github.com/netlify-templates/gatsby-starter-netlify-cms
)

Expand All @@ -75,8 +74,8 @@ git cloneしてきます。
とりあえずローカル上で動かしてみます。

```bash{numberLines: 1}
$ npm install
$ npm start
npm install
npm start
```

するとコーヒー屋さん(?)のページが出てきます。
Expand All @@ -93,7 +92,6 @@ CMSの要素は残す必要があるため、ComponentsのTemplateを編集す

無事サイトができたら、Netlifyに挙げていきます。


![Imgur](https://i.imgur.com/P0E2109.png)

アカウントを作ってGithubと連携するとDeployするレポジトリを選択できます。
Expand Down Expand Up @@ -144,5 +142,3 @@ Githubの[PersonalAccessToken](https://github.com/settings/tokens/new)から作
Netlify CMSはすごいぞ!

![Imgur](https://i.imgur.com/mIcrB6K.png)


Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ headerImage: 'https://i.imgur.com/6T4kjdf.png'
templateKey: blog-post
---

最近Github Actionを触って便利さに気がついてしまったのでご紹介します。
最近GitHub Actionを触って便利さに気がついてしまったのでご紹介します。

## Table of Contents

```toc
```

## Github Actionとは?
## GitHub Actionとは?

Github Actionとは、 ***built by you, run by us*** です。[(公式より)](https://github.blog/2018-10-17-action-demos/)
GitHub Actionとは、 ***built by you, run by us*** です。[(公式より)](https://github.blog/2018-10-17-action-demos/)

詰まるところGithub製のCIです。

結構簡単に使えたのでご紹介します。

## Github Actionのプレビューに応募する
## GitHub Actionのプレビューに応募する

Github Action自体はまだプレビュー版ですので、[こちらのサイト](https://github.com/features/actions)から
GitHub Action自体はまだプレビュー版ですので、[こちらのサイト](https://github.com/features/actions)から
利用申請をする必要があります。

私は申し込みから一週間くらいで使えるようになりました。
Expand All @@ -41,7 +41,7 @@ Github Action自体はまだプレビュー版ですので、[こちらのサイ

## Workflowを設定する

Github ActionはほかのCIと同じくYAMLファイルで定義します。
GitHub ActionはほかのCIと同じくYAMLファイルで定義します。

今回はPythonのPytestでテストを回します。

Expand Down Expand Up @@ -163,5 +163,4 @@ StepはほかのCIと同じような感じで設定します。

## 結論

Github Actionを使えば、めんどっちいCIサーバー連携も不要で楽々です。

GitHub Actionを使えば、めんどっちいCIサーバー連携も不要で楽々です。
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Cloudwatchでもいいのですが、アプリへの導入が簡単にできる
![Img](https://i.imgur.com/7dWvynP.png)
くわしくは[公式Demo: What is Sentry?](https://sentry.io/_/demo/?referrer=welcome)へ。
詳しくは[公式Demo: What is Sentry?](https://sentry.io/_/demo/?referrer=welcome)へ。
### main.ts
Expand Down Expand Up @@ -97,7 +97,7 @@ SentryInitを呼び出すだけです。たったそれだけ。
さらにVue用にIntegrateされたSentryVueを呼び出します。
たったそれだけ。
### 実際にエラーを起こしてみた
### 実際にエラーを起こしてみた
実際にエラーを起こします。F12で確認してみると404NotFoundのエラーが出ています。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ GitHubへのコントリビュートをすることをいわゆる**草**とい

[Write Code Every Day](https://johnresig.com/blog/write-code-every-day/)というお話があります。


要は毎日**意味のある**コードを書きましょうということで、自身のスキルをあげるためにとりくんでみました。

というのも、本業でも少しはコードを書くのですが、一般的なエンジニアに比べると書く量も時間も少ないのが悩みで、明らかにエンジニアとしての力が不足していると最近感じたからです。
Expand All @@ -46,7 +45,7 @@ GitHubへのコントリビュートをすることをいわゆる**草**とい
> All code must be written before midnight.
**(夜の0時になる前に草はやせ!)**
>
> The code must be Open Source and up on Github. **(GitHubにOSSとしてコードを展開しろ!)**
> The code must be Open Source and up on GitHub. **(GitHubにOSSとしてコードを展開しろ!)**
>
> <cite>[Write Code Every Day](https://johnresig.com/blog/write-code-every-day/)</cite>
Expand Down Expand Up @@ -93,4 +92,3 @@ GitHubへのコントリビュートをすることをいわゆる**草**とい
次は60日連続で草を生やすことを目標にします。

微妙なことをいかに改善するかが成功の秘訣だと思っているので頑張ります。

Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ CIで回そう!
```

## MacOS X が使えるCIってあるの?
## macOS X が使えるCIってあるの?

結論から先にかけばあります。

私の大好きなCIのCircleCIだってMacOS XのOSイメージは用意されています。
私の大好きなCIのCircleCIだってmacOS XのOSイメージは用意されています。

ですが、CircleCIの場合で[$39/Month](https://circleci.jp/pricing/#build-os-x)とお金がかかってしまいます…。(2019/10現在)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tags:
headerImage: 'https://i.imgur.com/QCjxEBN.png'
templateKey: blog-post
---
タイトル長い
タイトル長い

くっそ長いタイトルで恐縮ですが、Google Apps Script(GAS)とAPI FLASHとSlackAPIをClaspとJestとGitHub Actionで調理して定期的にWebページのスクリーンショットを撮っていきたいと思います。

Expand Down Expand Up @@ -47,10 +47,10 @@ ExcelやPowerPointだとVBAがマクロ言語ですが、Google Apps ScriptはJa

またGoogle Apps Scriptのことを省略してGASとか言ったりするそうです。

ガスガス
ガスガス✨

GAS専用のマクロ用関数がある程度用意されてるのでマクロを組むのも簡単ですし、時間で関数をキックするトリガー機能もあるので、簡単なFaaS(Function as a Service)として
利用することもできます
利用できます

今回は後者の使い方が中心となります。

Expand Down Expand Up @@ -91,7 +91,7 @@ Chromeベースのキャプチャリングなので、レンダリングも正

さらに、うれしい機能として遅延キャプチャリング機能があり、ページのレンダリングを待ってからキャプチャを撮ることも可能です。

```
```text
https://api.apiflash.com/v1/urltoimage?access_key=hoge&url=hoge&delay=10
```

Expand Down Expand Up @@ -140,7 +140,6 @@ URLFetchAppはもちろんGAS専用のAPIですが、TypeSciptのLintがちゃ

コードは省略しますが上と同じ要領でURLFetchを使って、Slackコール部も作ります。


## テスト

テストはJestで作ります。
Expand All @@ -149,7 +148,7 @@ URLFetchAppはもちろんGAS専用のAPIですが、TypeSciptのLintがちゃ

Jestのグローバル変数定義であらかじめURLFetchを作り、JestのMock関数をテストケースごとにfetch関数と置き換えることで実現できます。

package.jsonに
package.jsonに

```json
"jest": {
Expand All @@ -160,7 +159,7 @@ package.jsonに
},
```

とすることでグローバルにUrlFetchAppができますので、テストコードで
とすることでグローバルにUrlFetchAppができますので、テストコードで

```typescript
const mockFetch = jest.fn();
Expand Down Expand Up @@ -188,15 +187,15 @@ mock関数をあらかじめ作成しておくと、コールのassertも可能

StarterではWebpackを使ってTypeSciptのGAS化を実行しているようです。

```
```shell{promptUser: tubone}{promptHost: dev.localhost}
npm run build
```

とすることで、dist配下にGASのコードが配置されました。

デプロイは、claspを利用します。

```
```shell{promptUser: tubone}{promptHost: dev.localhost}
clasp login
clasp push
```
Expand All @@ -215,11 +214,11 @@ clasp loginをローカル上で実施したときに取得できるトークン

GitHub ActionのSecretにはこのようにアクセスします。

```
```shell{promptUser: tubone}{promptHost: dev.localhost}
echo "${{ secrets.CLASPRC_JSON }}" > ~/.clasprc.json
```

## 完成
## 完成

GASにデプロイできたらcronでトリガーさせてあげれば定期的にキャプチャをとります。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Slackにはスタンプ機能があり、回りくどい文章を書かずに感
最上位の謝罪ができる。
見た目は汗をかきながら必死にする組体操なので、教育現場への疑問提起もできる。

ダイバーシティーを意識して人種のバリエーションを持たせるのがコツ
ダイバーシティーを意識して人種のバリエーションを持たせるのがコツ

![preview](https://raw.githubusercontent.com/tubone24/markdown-memo/master/src/loose/man-bowing-pyramid.png)

```
```text
:man-bowing: < ごめん!
:man-bowing::skin-tone-3:
:man-bowing::man-bowing::skin-tone-6:
Expand All @@ -49,7 +49,7 @@ Slackにはスタンプ機能があり、回りくどい文章を書かずに感

![img](https://raw.githubusercontent.com/tubone24/markdown-memo/master/src/loose/invador.png)

```
```text
:space_invader: :space_invader: :space_invader: :space_invader: :space_invader:
:space_invader: :boom: :space_invader:
Expand All @@ -70,7 +70,7 @@ Slackのスタンプになぜ顔のパーツがあるか、考えた結果思い

![img](https://raw.githubusercontent.com/tubone24/markdown-memo/master/src/loose/hukuwarai.png)

```
```text
:eye: :eye:
:nose::skin-tone-4:
:lips:
Expand All @@ -88,6 +88,6 @@ Slackのスタンプになぜ顔のパーツがあるか、考えた結果思い

これからも思いつき次第下記noteに記載していきます!!

https://note.tubone-project24.xyz/loose/slack-stamp-snipet.html#%E8%AC%9D%E7%BD%AA%E3%83%94%E3%83%A9%E3%83%9F%E3%83%83%E3%83%89
<https://note.tubone-project24.xyz/loose/slack-stamp-snipet.html#%E8%AC%9D%E7%BD%AA%E3%83%94%E3%83%A9%E3%83%9F%E3%83%83%E3%83%89>

みんなもSlackスタンプ生活、始めよう!
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags:
headerImage: 'https://i.imgur.com/N0Vkj2U.jpg'
templateKey: blog-post
---
昔ながらのラーメン
昔ながらのラーメン...。

食べたいですよね。

Expand All @@ -22,8 +22,8 @@ templateKey: blog-post

[南雲](https://tabelog.com/tokyo/A1308/A130802/13024487/)

共同通信会館というビルの地下。いい雰囲気
共同通信会館というビルの地下。いい雰囲気

<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12965.283684211874!2d139.7445434!3d35.6690992!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xf87a6d51dce26de8!2z5YWx5ZCM6YCa5L-h5Lya6aSo!5e0!3m2!1sja!2sjp!4v1573747714894!5m2!1sja!2sjp" width="600" height="450" frameborder="0" style="border:0;" allowfullscreen=""></iframe>

是非、皆さんも行ってみては?
ぜひ、皆さんも行ってみては?
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ tags:
headerImage: 'https://i.imgur.com/WtqaANF.jpg'
templateKey: blog-post
---
うまい!もう一杯
うまい!もう一杯

ラーメン食べました。

今日の一杯は
今日の一杯は

[](https://tabelog.com/tokyo/A1301/A130103/13156937/)

Expand All @@ -27,7 +27,4 @@ templateKey: blog-post

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3241.4558149052705!2d139.7540854147706!3d35.66577693842776!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x60188bea35890595%3A0x122e05e9a6a9ce62!2z5paw5qmLIOe6jw!5e0!3m2!1sja!2sjp!4v1573828271931!5m2!1sja!2sjp" width="800" height="600" frameborder="0" style="border:0;" allowfullscreen=""></iframe>


美味しいお味でした。(仕事しろ)


Loading

0 comments on commit cb39ddc

Please sign in to comment.