File tree Expand file tree Collapse file tree 6 files changed +5
-17
lines changed
Expand file tree Collapse file tree 6 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 2323 - uses : actions/checkout@v4
2424 - uses : oven-sh/setup-bun@v2
2525 with :
26- bun-version : 1.2.5
26+ bun-version : 1.3
2727 - run : bun install --frozen-lockfile
2828 - uses : actions/cache@v4
2929 with :
Original file line number Diff line number Diff line change 1616- HEIC は対応していないので、 ImageMagick で他のフォーマットに変換してください。
1717 - 例: ` magick picture.HEIC picture.webp `
1818- すべての画像ファイルは 1 MB 未満に抑えてください。既存のものを変更したり、 CI でチェックしたりはまだ実装してないです。
19-
2019 - ffmpeg や ImageMagick を使い、解像度を下げたり、画質 (Quality) を下げたり、WebP (or AVIF) に変換するなどができます。
21-
2220 - 例:
23-
2421 - ` mogrify -resize 800x -quality 80 -format webp input.png `
25-
2622 - ImageMagick についてきます。
2723 - コマンドの引数は見ての通り。
2824
2925 - ` ffmpeg -i ./input.png -vf 'scale=1920:-1' -crf 10 output.avif `
30-
3126 - -> 50〜300kb 程度になります。AVIF の場合、多少 (数秒〜1分程度) 時間がかかります。
3227 - ` -vf scale={width}:{height} ` : 画像の横幅。height が -1 のときは、横幅から計算する。
3328 - ` -crf ` : 画像の圧縮率。大きいほうが圧縮率が高い。
4237### 記事
4338
4439- サムネイルは縦横比 3:5 にクロップされます。
45-
4640 - 可能なら 3:5 に近い画像を使い、
4741 - できないかつクロップが許容できない場合は、 ` thumbnail.fit: contain ` と背景色 (` thumbnail.bg ` ) を指定してください。
4842
Original file line number Diff line number Diff line change 55### base
66
77- title: string
8-
98 - 記事タイトル。
109
1110- date: Date
12-
1311 - ** 記事を書いた** 日。
1412 - フォーマット:
1513 - yyyy-MM-dd (日付のみ)
1614 - yyyy-MM-dd hh:mm: ss +09:00 (日付+時間)
1715
1816- author: string & keyof Member
19-
2017 - 著者。
2118
2219- categories?: string[ ]
2522### image 系
2623
2724- thumbnail.src: path
28-
2925 - タイトル画像。記事一覧とトップで使うよ。
3026 - 縦横比 3:5 に crop されるよ。
3127
3228- thumbnail.fit?: "cover" | "contain" | fill" | "none" = "cover"
33-
3429 - ` object-fit `
3530 - Astro のビルド段階で Sharp に渡されるよ。
3631 - < https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit >
3732
3833- thumbnail.position?: "center" | "left" | "right" | "top" | "bottom"
39-
4034 - ` object-position `
4135 - Astro のビルド段階で Sharp に渡されるよ。
4236
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const {
2222} = props ;
2323
2424const maxCols =
25- typeof _maxCols === " string" ? Number .parseInt (_maxCols ) : _maxCols ;
25+ typeof _maxCols === " string" ? Number .parseInt (_maxCols , 10 ) : _maxCols ;
2626
2727const MDXSpecialSyntax = / ^ import ActionButton from ". + ";/ ;
2828
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export async function cache<T>(
2323 } = { } ,
2424) : Promise < T > {
2525 const ttl = options . ttl ?? DEFAULT_TTL ;
26- const now = new Date ( ) . getTime ( ) / 1000 ;
26+ const now = Date . now ( ) / 1000 ;
2727 const path = await toPath ( sanitizeKey ( key ) ) ;
2828
2929 // cache load
@@ -80,7 +80,7 @@ async function exists(path: string) {
8080 try {
8181 await fs . stat ( path ) ;
8282 return true ;
83- } catch ( err ) {
83+ } catch ( _err ) {
8484 return false ;
8585 }
8686}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export const getStaticPaths = (async () => {
2020const { project } = Astro .props ;
2121const { Content } = await render (project );
2222
23- let iconSrc: string | undefined ;
23+ let iconSrc: string | undefined ;
2424if (project .data .status !== " dead" ) {
2525 if (project .data .favicon ) iconSrc = project .data .favicon .src ;
2626 if (! iconSrc && project .data .app .url ) {
You can’t perform that action at this time.
0 commit comments