Skip to content

Commit 135fb3d

Browse files
committed
✏️🩹 Rename: field img_fmt of article frontmatter to imgFmt [#12]
follow naming convention
1 parent bf65623 commit 135fb3d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/routes/blog/articles/20230917_test.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "記事の書式(?)について"
55
desc: "この記事はテスト記事です。 "
66
tags: ["first", "test"]
77
hasThumbnail: true
8-
img_fmt: "webp"
8+
imgFmt: "webp"
99
---
1010

1111
<!--
@@ -28,7 +28,7 @@ img_fmt: "webp"
2828
| `desc` | string \| null | 記事の説明 |
2929
| `tags` | string[] \| null | 記事のタグ |
3030
| `hasThumbnail` | bool | サムネイル画像の有無 |
31-
| `img_fmt` | string \| null | サムネイル画像のファイルフォーマット (サムネイル画像無しなら null) |
31+
| `imgFmt` | string \| null | サムネイル画像のファイルフォーマット (サムネイル画像無しなら null) |
3232

3333
本文はこうやって普通に書ける。
3434
普通に改行してもただの半角空白として反映される。
@@ -272,7 +272,7 @@ TEXT = {TEST}
272272
- desc: "{desc}"
273273
- tags: [{tags}]
274274
- hasThumbnail: {hasThumbnail}
275-
- img_fmt: "{img_fmt}"
275+
- imgFmt: "{imgFmt}"
276276
277277
---
278278

src/routes/blog/articles/[slug]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
let date = idToDate(slug);
2525
2626
const hasThumbnail = metadata.hasThumbnail;
27-
const thumbnail_path = hasThumbnail ? `/images/blog/${slug}.` + metadata.img_fmt : null;
27+
const thumbnail_path = hasThumbnail ? `/images/blog/${slug}.` + metadata.imgFmt : null;
2828
2929
const HEAD = {
3030
title: 'Blog - ' + metadata.title,

0 commit comments

Comments
 (0)