Skip to content

Commit bacc13b

Browse files
authored
Merge pull request #6 from oriverk/dev
Dev
2 parents 3ce566e + 518fd7e commit bacc13b

File tree

141 files changed

+28590
-11082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+28590
-11082
lines changed

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PUBLIC_ALGOLIA_INDEX_BLOG=\w+
2+
PUBLIC_ALGOLIA_APP_ID=\w+
3+
PUBLIC_ALGOLIA_SEARCH_KEY=\w+
4+
SECRET_ALGOLIA_ADMIN_KEY=\w+
5+
6+
SECRET_GH_PAT=\w+

.eslintrc.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- main
66
- dev
77
schedule:
8-
- cron: "0 2 * * *"
8+
- cron: "0 2 * * 0"
99
workflow_dispatch:
1010

1111
jobs:
@@ -32,8 +32,7 @@ jobs:
3232
npm run build
3333
env:
3434
MODE: production
35-
SECRET_GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.SECRET_GITHUB_PERSONAL_ACCESS_TOKEN }}
36-
PUBLIC_GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
35+
SECRET_GH_PAT: ${{ secrets.SECRET_GH_PAT }}
3736
PUBLIC_ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
3837
PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
3938
PUBLIC_ALGOLIA_INDEX_BLOG: ${{ secrets.ALGOLIA_INDEX_BLOG }}
@@ -45,4 +44,4 @@ jobs:
4544
projectName: astro-site
4645
directory: dist
4746
# Optional: Enable this if you want to have GitHub Deployments triggered
48-
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}
47+
# gitHubToken: ${{ secrets.SECRET_GH_PAT }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ pnpm-debug.log*
1717
.env
1818
.env.production
1919

20+
.cache
21+
2022
# macOS-specific files
2123
.DS_Store
2224

2325
.contents
26+
src/content/static/cv.md

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 0 additions & 5 deletions
This file was deleted.

.markdownlint.jsonc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"default": true,
3+
"first-line-h1": false,
4+
"no-emphasis-as-heading": false,
5+
"line-length": false,
6+
// for GFM Alerts > [!NOTE]
7+
"no-blanks-blockquote": false,
8+
"no-inline-html": {
9+
"allowed_elements": [
10+
"details",
11+
"summary",
12+
"code"
13+
]
14+
}
15+
}

.prettierrc.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.textlintrc.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const IS_LINK_CHECK = !!process.env.LINK_CHECK;
2+
3+
module.exports = {
4+
plugins: {
5+
"@textlint/markdown": true,
6+
latex2e: true,
7+
},
8+
filters: {
9+
allowlist: {
10+
allow: [
11+
// markdown link and img alt
12+
"/\\[.+?\\]/gm",
13+
// math
14+
"/\\$\\$?[\\s\\S]*?\\$\\$?/m",
15+
"/\\$([^$]*)\\$/",
16+
// url
17+
"/<https?://.*?>/gm",
18+
// aws
19+
"/-?config/gm",
20+
],
21+
},
22+
},
23+
rules: {
24+
"ja-no-inappropriate-words": true,
25+
"ja-no-abusage": true,
26+
27+
"preset-ja-spacing": {
28+
"ja-space-between-half-and-full-width": {
29+
space: ["alphabets"],
30+
},
31+
"ja-space-around-code": { after: true, before: true },
32+
"ja-space-around-link": { after: true, before: true },
33+
},
34+
"preset-ja-technical-writing": {
35+
"no-doubled-joshi": false,
36+
"no-exclamation-question-mark": false,
37+
"ja-no-mixed-period": false,
38+
"ja-no-weak-phrase": false,
39+
"max-comma": false,
40+
"max-kanji-continuous-len": {
41+
max: 6,
42+
allow: ["永続性記憶資源", "浮動小数点演算", "自己代入演算子"],
43+
},
44+
},
45+
"period-in-list-item": {
46+
periodMark: "",
47+
},
48+
"@proofdict/proofdict": {
49+
dictURL: "https://azu.github.io/proof-dictionary/",
50+
},
51+
"aws-service-name": true,
52+
"no-kangxi-radicals": true,
53+
},
54+
};

.vscode/extensions.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2-
"recommendations": ["astro-build.astro-vscode"],
2+
"recommendations": [
3+
"astro-build.astro-vscode",
4+
"biomejs.biome"
5+
],
36
"unwantedRecommendations": []
47
}

.vscode/setting.json

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
{
22
"editor.formatOnSave": true,
3-
"editor.deafultFormatter": "esbenp.prettier-vscode",
4-
"editor.codeActionsOnSave": [
5-
"source.addMissingImports",
6-
"source.fixAll.eslint"
7-
],
8-
"eslint.validate": [
9-
"javascript",
10-
"javascriptreact",
11-
"astro",
12-
"typescript",
13-
"typescriptreact"
14-
],
15-
"[svelte]": {
16-
"editor.formatOnSave": true,
17-
"editor.deafultFormatter": "svelte.svelte-vscode"
3+
"editor.deafultFormatter": "biomejs.biome",
4+
"editor.codeActionsOnSave": {
5+
"quickfix.biome": "explicit",
6+
"source.organizeImports.biome": "explicit"
187
}
19-
20-
}
8+
}

README.md

Lines changed: 16 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,16 @@
1-
# Astro Starter Kit: Basics
2-
3-
- [blog.oriverk.dev](https://blog.oriverk.dev/)
4-
- [AstroとSvelteでStaticサイトを作って、GitHub Actions で定期的に情報を取得更新するようにした | blog.oriverk.dev](https://blog.oriverk.dev/entry/2023/202305-svelte-site/)
5-
6-
## 🧞 Commands
7-
8-
All commands are run from the root of the project, from a terminal:
9-
10-
| Command | Action |
11-
| :--------------------- | :----------------------------------------------- |
12-
| `npm install` | Installs dependencies |
13-
| `npm run dev` | Starts local dev server at `localhost:3000` |
14-
| `npm run build` | Build your production site to `./dist/` |
15-
| `npm run preview` | Preview your build locally, before deploying |
16-
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
17-
| `npm run astro --help` | Get help using the Astro CLI |
18-
19-
## 🚀 Project init
20-
21-
```shell
22-
npm create astro@latest -- --template basics
23-
```
24-
25-
![npm create astro@latest](https://user-images.githubusercontent.com/44029144/231638707-5afcf66c-2e6d-4bda-a69b-235e74507376.png)
26-
27-
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)
28-
29-
```shell
30-
npm i -D npm-run-all
31-
npm i -D @commitlint/{config-conventional,cli}
32-
# echo '{"extends": ["@commitlint/config-conventional"]}' > .commitlintrc.json
33-
34-
npm install -D eslint eslint-plugin-astro @typescript-eslint/parser eslint-plugin-jsx-a11y
35-
npm install -D prettier prettier-plugin-astro eslint-config-prettier
36-
# echo {} > .prettierrc.json
37-
38-
npx husky-init && npm install
39-
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
40-
41-
npx astro add svelte
42-
npm i -D eslint-plugin-svelte3 prettier-plugin-svelte
43-
44-
npm i sass cssnano autoprefixer
45-
```
46-
47-
- `feat:`:新機能
48-
- `fix:`:バグフィックス
49-
- `refactor:`:新機能でもバグフィックスでもないコード変更
50-
- `perf:`:パフォーマンス向上
51-
- `test:`:テストコードの追加・修正
52-
- `style:`:コードの意味に影響しない変更(空白、フォーマット、セミコロン)
53-
- `docs:`:ドキュメントだけの変更
54-
- `chore:`:雑用(ビルドプロセスの変更、ツールやライブラリの追加削除)
55-
56-
## Project content
57-
58-
### GraphQL
59-
60-
I used @octokit/graphql to get my contributions calendar and pinned repository in GitHub.
61-
62-
<details><summary>GraphQl query with @octokit/graphql</summary>
63-
64-
```typescript
65-
import type { User, Repository, Blob } from '@octokit/graphql-schema'
66-
import { graphql, GraphqlResponseError } from '@octokit/graphql'
67-
68-
/**
69-
*
70-
* @param githubToken
71-
* @param owner userid
72-
* @param pinnedItemsNum
73-
* @param calendarFrom new Date().toISOString().split(".")[0]
74-
* @param calendarTo "2023-04-01T00:00:00"
75-
* @returns
76-
*/
77-
export async function fetchUserContent(githubToken: string, owner: string, pinnedItemsNum: number, calendarFrom: string, calendarTo: string, repo: string, expression: string) {
78-
try {
79-
if (!githubToken) {
80-
throw new Error('githubToken is not defined')
81-
}
82-
83-
const { user, repository } = await graphql<{ user: User, repository: Repository }>(`
84-
query userContent ($owner: String!, $pinnedItemsNum: Int = 4, $calendarFrom: DateTime!, $calendarTo: DateTime!, $repo: String!, $expression: String!){
85-
user(login: $owner) {
86-
pinnedItems(first: $pinnedItemsNum) {
87-
nodes {
88-
... on Repository {
89-
name
90-
description
91-
url
92-
isFork
93-
isArchived
94-
stargazerCount
95-
primaryLanguage {
96-
name
97-
color
98-
}
99-
}
100-
}
101-
}
102-
contributionsCollection (from: $calendarFrom, to: $calendarTo) {
103-
contributionCalendar {
104-
totalContributions
105-
isHalloween
106-
weeks {
107-
firstDay
108-
contributionDays {
109-
date
110-
color
111-
contributionCount
112-
contributionLevel
113-
weekday
114-
}
115-
}
116-
}
117-
}
118-
}
119-
repository(owner: $owner, name: $repo) {
120-
object(expression: $expression) {
121-
... on Blob {
122-
text
123-
}
124-
}
125-
}
126-
}
127-
`,
128-
{
129-
owner,
130-
pinnedItemsNum,
131-
calendarFrom,
132-
calendarTo,
133-
repo,
134-
expression,
135-
headers: {
136-
authorization: `token ${githubToken}`
137-
}
138-
}
139-
)
140-
return { user, repository }
141-
} catch (error) {
142-
if(error instanceof GraphqlResponseError) {
143-
console.log("Request failed:", error.request)
144-
console.log(error.message);
145-
} else {
146-
console.log('non GitHub GraphQl erorr happend.')
147-
console.error(error)
148-
}
149-
}
150-
}
151-
```
152-
153-
</details>
154-
155-
### Cloudflare Pages
156-
157-
- refenrece
158-
- [Cloudflare Pages GitHub Action · Actions · GitHub Marketplace](https://github.com/marketplace/actions/cloudflare-pages-github-action)
159-
- [Deploy your Astro Site to Cloudflare Pages 🚀 Astro Documentation](https://docs.astro.build/en/guides/deploy/cloudflare/)
160-
- [Build configuration · Cloudflare Pages docs](https://developers.cloudflare.com/pages/platform/build-configuration)
161-
- Svelte Styles
162-
- [Advanced styling / The style directive • Svelte Tutorial](https://svelte.dev/tutorial/style-directive)
163-
- [こびと on Twitter: "「CSS変数をstyle属性で書いてしまえばユニークな値入れ放題」 という技をエスイチさんから盗みました。義賊なのでみなさんに再配布します(感動の共有) https://t.co/siA1s8R7Tb" / Twitter](https://twitter.com/kobitoCode/status/1645360488602284032)
164-
- [Emotion – Best Practices](https://emotion.sh/docs/best-practices#advanced-css-variables-with-style)
1+
# oriverk.dev
2+
3+
## built with
4+
5+
- dependencies
6+
- Astro
7+
- Svelte
8+
- unified, remark, rehype ...
9+
- @octokit/graphql
10+
- algoliasearch
11+
- devDependencies
12+
- husky
13+
- biomejs
14+
- commitlint
15+
- textlint
16+
- markdownlint-cli

0 commit comments

Comments
 (0)