-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aff09de
commit 01b6291
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
all: | ||
node scripts/make_post.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
makeで_postsに記事ができるので作成。 | ||
public/assets/blog/記事のtitle/*.(jpg|png|.*)に画像をおく。 | ||
scripts/build.jsでビルドしている。やや複雑。sh scripts/build.jsでdistにhtmlができるので確認する。 | ||
public/template.htmlは\<\!\-\-\-\-\>によって、分割して必要な属性を埋め込んでいる。 | ||
本番環境はcloudflareに上がっているが、こちらでもscripts/build.jsを使っている。 | ||
public/web_components.jsは先に読み込まれる必要があるので、data-cfasync="false"によって、cloudflareのjs遅延読み込みを無効化している | ||
コンポーネントを使いたくなったらpublic/web_components.jsとweb_component_templates.htmlに追加 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const content = `\ | ||
--- | ||
title: "title" | ||
excerpt: "みなさんこんにちは、かじりです。概要" | ||
created_at: "2024-03-28 21:07:53" | ||
updated_at: "2024-03-28 21:07:53" | ||
tags: [a, b] | ||
--- | ||
みなさんこんにちは、かじりです。本文`; | ||
|
||
fs.writeFile(path.join('_posts', '0.md'), content, (err) => { | ||
if (err) throw err; | ||
console.log('File created successfully.'); | ||
}); | ||
|