-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.89 KB
/
Makefile
File metadata and controls
47 lines (36 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY: help install install-e2e build serve clean test-e2e new-ja new-en
TITLE ?= untitled
SLUG ?= untitled
help: ## ヘルプを表示
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## 依存ツールをインストール (gohan)
go install github.com/bmf-san/gohan/cmd/gohan@v0.1.5
install-e2e: ## Playwright依存をインストール
cd e2e && npm ci && npx playwright install chromium
build: ## サイトをビルド
gohan build
serve: ## ローカルサーバーを起動 (http://localhost:1313)
gohan serve
clean: ## ビルド出力を削除
rm -rf public/*
test-e2e: ## E2Eテストを実行 (事前にビルドして http-server で配信)
gohan build && cd e2e && npx playwright test
test-e2e-ui: ## E2EテストをPlaywright UI モードで実行
gohan build && cd e2e && npx playwright test --ui
new-ja: ## 日本語記事を作成 例: make new-ja TITLE="タイトル" SLUG=slug
@mkdir -p content/ja/posts
@if [ -f "content/ja/posts/$(SLUG).md" ]; then \
echo "error: content/ja/posts/$(SLUG).md already exists"; exit 1; \
fi
@printf -- '---\ntitle: "$(TITLE)"\nslug: $(SLUG)\ndate: %s\nauthor: bmf-san\ncategories:\n - \ntags:\n - \ndescription: ""\ntranslation_key: $(SLUG)\ndraft: true\n---\n' \
$$(date +%Y-%m-%d) > content/ja/posts/$(SLUG).md
@echo "created: content/ja/posts/$(SLUG).md"
new-en: ## 英語記事を作成 例: make new-en TITLE="Title" SLUG=slug
@mkdir -p content/en/posts
@if [ -f "content/en/posts/$(SLUG).md" ]; then \
echo "error: content/en/posts/$(SLUG).md already exists"; exit 1; \
fi
@printf -- '---\ntitle: "$(TITLE)"\nslug: $(SLUG)\ndate: %s\nauthor: bmf-san\ncategories:\n - \ntags:\n - \ndescription: ""\ntranslation_key: $(SLUG)\ndraft: true\n---\n' \
$$(date +%Y-%m-%d) > content/en/posts/$(SLUG).md
@echo "created: content/en/posts/$(SLUG).md"