From 199b975aea2d125dd7518b439bcd0a04fdebaed4 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Tue, 13 Aug 2024 04:22:19 +0000 Subject: [PATCH 1/2] =?UTF-8?q?refactor(overall):=20=E2=9C=A8=20tweak=20ar?= =?UTF-8?q?ticles,=20frontmatter=20config,=20and=20env=20vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #39 --- .dev.vars.example | 1 - .env.example | 4 +- README.md | 4 +- frontmatter.json | 82 ++++++++++++++++++----- src/content/blog/en/pomodoro-shortcut.mdx | 11 +-- src/content/blog/ja/pomodoro-shortcut.mdx | 11 +-- src/content/tags/en/tags.yml | 4 ++ src/content/tags/ja/tags.yml | 4 ++ src/lib/consts.ts | 4 +- src/vite-env.d.ts | 3 - 10 files changed, 90 insertions(+), 38 deletions(-) diff --git a/.dev.vars.example b/.dev.vars.example index f52b91d7..6fb3915f 100644 --- a/.dev.vars.example +++ b/.dev.vars.example @@ -1,4 +1,3 @@ TURNSTILE_SECRET_KEY=xxxxxx MY_CUSTOM_EMAIL_ADDRESS=xxxxxx@xxxxxx.xxx RESEND_API_KEY=xxxxxx -LOCAL_DB_PATH=.wrangler\\state\\v3\\d1\\miniflare-D1DatabaseObject\\xxxxxx.sqlite diff --git a/.env.example b/.env.example index a2f50392..f6f08d8c 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,3 @@ UNSPLASH_API_ACCESS_KEY=xxxxxx PUBLIC_TURNSTILE_SITE_KEY=xxxxxx -CLOUDFLARE_ACCOUNT_ID=xxxxxx -D1_DB_ID=xxxxxx -D1_DB_API_TOKEN=xxxxxx +LOCAL_DB_PATH=.wrangler\\state\\v3\\d1\\miniflare-D1DatabaseObject\\xxxxxx.sqlite diff --git a/README.md b/README.md index b202911d..7df8ee4e 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,8 @@ This project adopts Issue-driven Development. #### Outside the container -1. Create `.env` and `.env.vars` at the root - - see `.env.example` and `.env.vars.example` for reference, respectively +1. Create `.env` and `.dev.vars` at the root + - see `.env.example` and `.dev.vars.example` for reference, respectively - At this moment, you can't set the `LOCAL_DB_PATH` var yet #### Inside the container diff --git a/frontmatter.json b/frontmatter.json index b3d0edd6..1bd7cb1c 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -7,19 +7,25 @@ { "title": "blog", "path": "[[workspace]]/src/content/blog", - "contentTypes": ["blog"], + "contentTypes": [ + "blog" + ], "defaultLocale": "en" }, { "title": "news", "path": "[[workspace]]/src/content/news", - "contentTypes": ["news"], + "contentTypes": [ + "news" + ], "defaultLocale": "en" }, { "title": "page", "path": "[[workspace]]/src/content/page", - "contentTypes": ["page"], + "contentTypes": [ + "page" + ], "defaultLocale": "en" } ], @@ -38,7 +44,11 @@ "frontMatter.content.draftField": { "name": "draft", "type": "choice", - "choices": ["draft", "in progress", "published"] + "choices": [ + "draft", + "in progress", + "published" + ] }, "frontMatter.taxonomy.seoTitleLength": 90, "frontMatter.taxonomy.contentTypes": [ @@ -223,7 +233,12 @@ "schema": { "title": "Categories", "type": "object", - "required": ["title", "slug", "color"], + "required": [ + "title", + "slug", + "ruby", + "color" + ], "properties": { "title": { "type": "string", @@ -233,6 +248,10 @@ "type": "string", "title": "Slug" }, + "ruby": { + "type": "string", + "title": "Ruby" + }, "color": { "type": "string", "title": "Color" @@ -245,7 +264,12 @@ "schema": { "title": "Tags", "type": "object", - "required": ["title", "slug", "color"], + "required": [ + "title", + "slug", + "ruby", + "color" + ], "properties": { "title": { "type": "string", @@ -255,6 +279,10 @@ "type": "string", "title": "Slug" }, + "ruby": { + "type": "string", + "title": "Ruby" + }, "color": { "type": "string", "title": "Color" @@ -302,27 +330,38 @@ }, "Code block with specified language": { "description": "Insert code block snippet", - "body": ["```[[language]] title=\"[[filename]]\"", "", "```"], + "body": [ + "```[[language]] title=\"[[filename]]\"", + "", + "```" + ], "fields": [ { "name": "language", "title": "Language", "type": "choice", "choices": [ - "html", + "astro", + "bash", + "c", "css", + "dockerfile", + "html", "javascript", - "typescript", - "rust", - "yml", - "astro", - "jsx", - "tsx", "json", + "jsx", "markdown", "mdx", - "bash", - "txt" + "nix", + "python", + "rust", + "shell", + "sql", + "toml", + "tsx", + "typescript", + "txt", + "yml" ], "single": true, "default": "markdown" @@ -338,7 +377,10 @@ }, "Callout": { "description": "Insert a callout", - "body": ["> [![[type]] ][[symbol]][[title]]", "> [[content]]"], + "body": [ + "> [![[type]] ][[symbol]][[title]]", + "> [[content]]" + ], "fields": [ { "name": "type", @@ -360,7 +402,11 @@ "name": "symbol", "title": "Symbol", "type": "choice", - "choices": ["+", "-", " "], + "choices": [ + "+", + "-", + " " + ], "single": true, "default": " " }, diff --git a/src/content/blog/en/pomodoro-shortcut.mdx b/src/content/blog/en/pomodoro-shortcut.mdx index dd60fb8c..16926803 100644 --- a/src/content/blog/en/pomodoro-shortcut.mdx +++ b/src/content/blog/en/pomodoro-shortcut.mdx @@ -3,7 +3,7 @@ title: Free pomodoro timer shortcut built only with the genuine Apple Clock app draft: published publishedAt: 2024-08-08T03:05:43.193Z type: blog -modifiedAt: 2024-08-09T02:52:38.552Z +modifiedAt: 2024-08-13T03:56:30.278Z category: slug: learning metadata: en/categories @@ -20,7 +20,7 @@ description: Learn how to create a pomodoro timer shortcut with the Apple Clock [The Pomodoro® Technique](https://www.pomodorotechnique.com/) plays a pivotal role in enhancing our productivity in modern society and there has been a bunch of pomodoro timer apps available in app stores. -That said, it turned out that few of them were really my cup of tea. Some have very limited features for free tier users, whereas some have a lot of bells and whistles that I don't use. Given that, I embarked on creating it on my own with the Apple shortcut. +That said, it turned out that few of them were really my cup of tea. Some have very limited features for free tier users, whereas some have a lot of bells and whistles that I mightn't use. Given that, I embarked on creating it on my own with the Apple shortcut. > [!info]-What's the Pomodoro® Technique? > The Pomodoro® Technique utilizes fixed time intervals for focused work, usually 25 minutes, followed by short breaks. This structured approach keeps the mind alert and engaged, significantly reducing the inclination to procrastinate and enabling a deeper focus on tasks. @@ -51,7 +51,7 @@ https://www.icloud.com/shortcuts/b12a5c2e30484677b40a5f98b9e7774d To start the pomodoro timer, all you have to do are: -1. Tap or click the shortcut icon(Put it on your home screen or somewhere in advance) +1. Tap or click the shortcut icon to run it(Put it on your home screen or somewhere in advance) 2. Set your working interval(25mins by default) 3. Set your breaking interval(5mins by default) @@ -61,7 +61,7 @@ You'll see the timer counting down appear and now it's time to get your work sta ### The workflow -Behind the scenes, the pomodoro shortcut proceeds as follows: +Behind the scenes, the pomodoro shortcut proceeds as follows: (You can skip this section if you're not interested in the mechanism) **Does the shortcut receives a parameter?** @@ -69,6 +69,9 @@ Behind the scenes, the pomodoro shortcut proceeds as follows: - Retrieve the work & break time from the param by splitting it +> [!info] +> You will see what it means later in this section + ↪️No - Ask you how long you're working(in minutes) diff --git a/src/content/blog/ja/pomodoro-shortcut.mdx b/src/content/blog/ja/pomodoro-shortcut.mdx index c0910c04..d0a810ea 100644 --- a/src/content/blog/ja/pomodoro-shortcut.mdx +++ b/src/content/blog/ja/pomodoro-shortcut.mdx @@ -3,7 +3,7 @@ title: 【無料ダウンロード】ポモドーロタイマー用ショート draft: published publishedAt: 2024-08-08T03:05:43.193Z type: blog -modifiedAt: 2024-08-09T03:08:33.303Z +modifiedAt: 2024-08-13T03:57:45.301Z category: slug: learning metadata: ja/categories @@ -20,8 +20,8 @@ description: Apple のショートカット機能と純正時計アプリだけ [ポモドーロテクニック(The Pomodoro® Technique)](https://www.pomodorotechnique.com/)は現代社会において人々の生産性を高める重要な役割を果たしています。そしてアプリ市場には数多のポモドーロタイマーアプリがあります。 -とはいえ、私個人の要望をピッタリ満たしてくれるものは残念ながら見つかりませんでした。あるものは無料ユーザへの機能制限が厳しく、またあるものは「ポモドーロタイマーにそこまでは求めてないんだよな...」と思ってしまうくらいに機能が盛り込まれていました。 -そこで、Apple のショートカット機能を使って自作しよう!ということになりました。 +しかし、私個人の要望をピッタリ満たしてくれるものは残念ながら見つかりませんでした。あるものは無料ユーザへの機能制限が厳しく、またあるものは「ポモドーロタイマーにそこまでは求めてない...」と思ってしまう程に機能が盛り沢山。 +無いなら自分で作ろうということで、今回は Apple のショートカット機能を使って自作してみました。 > [!info]-ポモドーロテクニックとは? > ポモドーロテクニックとは、物事に集中するのに決められたインターバルに時間を小分けし、短期間で集中・休憩を繰り返すというものです。大抵は25分間集中し、その後は小休憩をはさみます。このアプローチは常に能動的な思考を促し、特に先延ばし傾向を軽減したり深い集中に入りやすくするのに役立ちます。 @@ -62,7 +62,7 @@ https://www.icloud.com/shortcuts/b12a5c2e30484677b40a5f98b9e7774d ### ワークフロー -ポモドーロショートカットは裏で次のような流れに沿って動いています。 +ポモドーロショートカットは裏で次のような流れに沿って動いています。仕組みに興味がなければ読み飛ばしても問題はありません。 **ショートカットはパラメータを受け取っているか?** @@ -70,6 +70,9 @@ https://www.icloud.com/shortcuts/b12a5c2e30484677b40a5f98b9e7774d - 連結文字列を分解してパラメータから集中&休憩タイムをそれぞれ取り出す +> [!info] +> この処理については本章で後々説明があります + ↪️いいえ。 - 集中タイムをユーザに聞く(分単位で) diff --git a/src/content/tags/en/tags.yml b/src/content/tags/en/tags.yml index efd0ddc8..751b31e5 100644 --- a/src/content/tags/en/tags.yml +++ b/src/content/tags/en/tags.yml @@ -30,3 +30,7 @@ slug: iphone ruby: iPhone color: grey +- title: Obsidian + slug: obsidian + ruby: obsidian + color: purple diff --git a/src/content/tags/ja/tags.yml b/src/content/tags/ja/tags.yml index 30a05f48..cd9eff98 100644 --- a/src/content/tags/ja/tags.yml +++ b/src/content/tags/ja/tags.yml @@ -30,3 +30,7 @@ slug: iphone ruby: iPhone color: grey +- title: Obsidian + slug: obsidian + ruby: obsidian + color: purple diff --git a/src/lib/consts.ts b/src/lib/consts.ts index a45b0974..590b9073 100644 --- a/src/lib/consts.ts +++ b/src/lib/consts.ts @@ -11,11 +11,9 @@ export const ACCOUNT_ID = 'brklntmhwk'; export const SITE_URL = 'https://younagi.dev'; export const UNSPLASH_BASE_URL = 'https://unsplash.com'; export const GITHUB_BASE_URL = 'https://github.com'; -export const BREVO_FORM_URL = 'https://api.brevo.com/v3/smtp/email'; export const TURNSTILE_API_URL = 'https://challenges.cloudflare.com/turnstile/v0/api.js'; export const TURNSTILE_SITE_VERIFICATION_URL = 'https://challenges.cloudflare.com/turnstile/v0/siteverify'; export const SHOW_DRAFT_PAGES_IN_DEV = true; -export const CONTACT_NOTIFICATION_SUBJECT = - 'younagi.dev からお問い合わせがありました'; +export const CONTACT_NOTIFICATION_SUBJECT = 'younagi.dev: New Contact Message'; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index b3805eb0..b69b9685 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -3,9 +3,6 @@ interface ImportMetaEnv { readonly UNSPLASH_API_ACCESS_KEY: string; readonly PUBLIC_TURNSTILE_SITE_KEY: string; - readonly CLOUDFLARE_ACCOUNT_ID: string; - readonly D1_DB_ID: string; - readonly D1_DB_API_TOKEN: string; readonly LOCAL_DB_PATH: string; } From 8712ddb5f9bcf5f84d41b83c3e549493d22493c5 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Tue, 13 Aug 2024 04:48:12 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs(contents):=20=F0=9F=93=96=20tweak=20po?= =?UTF-8?q?modoro=20articles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #39 --- src/content/blog/en/pomodoro-shortcut.mdx | 40 ++++++++++++----------- src/content/blog/ja/pomodoro-shortcut.mdx | 36 ++++++++++---------- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/src/content/blog/en/pomodoro-shortcut.mdx b/src/content/blog/en/pomodoro-shortcut.mdx index 16926803..64b158ea 100644 --- a/src/content/blog/en/pomodoro-shortcut.mdx +++ b/src/content/blog/en/pomodoro-shortcut.mdx @@ -3,7 +3,7 @@ title: Free pomodoro timer shortcut built only with the genuine Apple Clock app draft: published publishedAt: 2024-08-08T03:05:43.193Z type: blog -modifiedAt: 2024-08-13T03:56:30.278Z +modifiedAt: 2024-08-13T04:45:14.521Z category: slug: learning metadata: en/categories @@ -77,24 +77,26 @@ Behind the scenes, the pomodoro shortcut proceeds as follows: (You can skip this - Ask you how long you're working(in minutes) - Ask you how long you're taking a break(in minutes) -Hereafter, it runs the same processes - -- Set the work & break intervals to variables -- Wait for a few seconds -- Open the timer tab of the Apple Clock app -- Show a notification that lets you know the work interval's started -- multiply the work & break intervals by 60 to get them in seconds -- Set the work interval in seconds to a variable -- Wait for the work intervals in seconds -- Show an alert to check if you want to continue -- Open the timer tab of the Apple Clock app -- Show a notification that lets you know the break interval's started -- Set the break interval in seconds to a variable -- Wait for the break intervals in seconds -- Show an alert to check if you want to continue -- Concatenate the work & break intervals in minutes as a string -- Set the concatenated string to a variable -- Pass it to this shortcut and call it in itself +Hereafter, it runs on the same process + +- 𝕏 Set the work & break intervals to variables +- ✋Wait for a few seconds +- ⏰Open the timer tab of the Apple Clock app +- 📢Show a notification that lets you know the work interval's started +- 🔄multiply the work & break intervals by 60 to get them in seconds +- 𝕏 Set the work interval in seconds to a variable +- ✋Wait for the work intervals in seconds +- ⚠️Show an alert to check if you want to continue + - If canceled, it gets out of the process here +- ⏰Open the timer tab of the Apple Clock app +- 📢Show a notification that lets you know the break interval's started +- 𝕏 Set the break interval in seconds to a variable +- ✋Wait for the break intervals in seconds +- ⚠️Show an alert to check if you want to continue + - If canceled, it gets out of the process here +- 🔄Concatenate the work & break intervals in minutes as a string +- 𝕏 Set the concatenated string to a variable +- 🔛Pass it to this shortcut and call it in itself This shortcut can take a parameter in text and then retrieves the work & break interval times separately from it if it exists, which enables the recursive structure. If not, it asks you how long, which is supposed to be the case only the first time. diff --git a/src/content/blog/ja/pomodoro-shortcut.mdx b/src/content/blog/ja/pomodoro-shortcut.mdx index d0a810ea..e7db5def 100644 --- a/src/content/blog/ja/pomodoro-shortcut.mdx +++ b/src/content/blog/ja/pomodoro-shortcut.mdx @@ -3,7 +3,7 @@ title: 【無料ダウンロード】ポモドーロタイマー用ショート draft: published publishedAt: 2024-08-08T03:05:43.193Z type: blog -modifiedAt: 2024-08-13T03:57:45.301Z +modifiedAt: 2024-08-13T04:46:18.086Z category: slug: learning metadata: ja/categories @@ -80,22 +80,24 @@ https://www.icloud.com/shortcuts/b12a5c2e30484677b40a5f98b9e7774d ここからは同じ流れに沿って動きます。 -- 集中&休憩タイムを変数にセットする -- 数秒待つ -- 時計アプリのタイマータブを開く -- 集中タイムが始まった旨をユーザに通知する -- 集中&休憩タイムに 60 を掛けて秒単位に変換する -- 秒単位の集中タイムを変数にセットする -- 集中タイムの時間分待つ -- 続けるかどうか決定を促すアラートを表示する -- 時計アプリのタイマータブを開く -- 休憩タイムが始まった旨をユーザに通知する -- 秒単位の休憩タイムを変数にセットする -- 休憩タイムの時間分待つ -- 続けるかどうか決定を促すアラートを表示する -- 分単位の集中&休憩タイムを連結して文字列に変換する -- 連結文字列を変数にセットする -- その変数を自身に渡してもう一度起動する +- 𝕏 集中&休憩タイムを変数にセットする +- ✋数秒待つ +- ⏰時計アプリのタイマータブを開く +- 📢集中タイムが始まった旨をユーザに通知する +- 🔄集中&休憩タイムに 60 を掛けて秒単位に変換する +- 𝕏 秒単位の集中タイムを変数にセットする +- ✋集中タイムの時間分待つ +- ⚠️続けるかどうか決定を促すアラートを表示する + - キャンセルの場合ここで終了 +- ⏰時計アプリのタイマータブを開く +- 📢休憩タイムが始まった旨をユーザに通知する +- 𝕏 秒単位の休憩タイムを変数にセットする +- ✋休憩タイムの時間分待つ +- ⚠️続けるかどうか決定を促すアラートを表示する + - キャンセルの場合ここで終了 +- 🔄分単位の集中&休憩タイムを連結して文字列に変換する +- 𝕏 連結文字列を変数にセットする +- 🔛その変数を自身に渡してもう一度起動する 特筆すべきはこの再帰的とも言える構造とパラメータです。 ショートカットはパラメータを受け取ることができるので、そこで初回に設定した集中&休憩タイムを渡してしまえば次回以降はわざわざ聞く必要もなくなるね、ということになります。