@ainame/tuzuru 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -30
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Satoshi Namai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,29 @@
1
1
  # Tuzuru
2
2
 
3
- ![logo](.github/assets/logo.png)
4
-
5
- Tuzuru (綴る) is dead-simple static **blog** generator CLI that uses Git to manage your blog's metadata.
6
-
7
- Instead of writing YAML front matter, you just write and save your plain Markdown files to Git. Tuzuru automatically pulls metadata like the publication date and author information from the Git commit history.
3
+ [![Swift Version](https://img.shields.io/badge/Swift-6.1+-blue.svg)](https://swift.org)
4
+ [![Swift Package Manager](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)
5
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/ainame/tuzuru/blob/main/LICENSE)
6
+ [![GitHub Release](https://img.shields.io/github/v/release/ainame/tuzuru)](https://github.com/ainame/tuzuru/releases)
7
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/ainame/tuzuru/ci.yml?branch=main)](https://github.com/ainame/tuzuru/actions)
8
8
 
9
- This means you can focus on what you're writing, not on remembering syntax. It's a simpler, more lightweight way to manage your blog.
9
+ Tuzuru (綴る) is a dead-simple static **blog** generator CLI that uses Git to manage your blog metadata.
10
+ Just write and commit plain Markdown files—no front matter needed.
11
+ Tuzuru automatically derives metadata such as dates and author from your Git history.
10
12
 
11
- ## Motivation
12
-
13
- Years ago, I built a blog with Hugo, but eventually stopped updating it. When I recently wanted to start again, I found it tough to remember and re-learn how to use it.
14
-
15
- I wanted a simple, intuitive blogging tool, but none I tried felt quite right. So, I decided to build my own.
13
+ ![logo](.github/assets/logo.png)
16
14
 
17
- Tuzuru is designed with these core principles:
15
+ It is designed to keep workflows minimal, allowing you to focus on writing.
18
16
 
19
- * Plain Markdown: No YAML front matter.
20
- * Simple Routing: A routing system built specifically for blogs.
21
- * No JavaScript Framework: Lightweight and fast.
22
- * Single Binary Installation: Avoids environment setup for tools that you may not use day-to-day
17
+ * Simple plain Markdown format, no YAML required
18
+ * Instead of YAML front matter, Tuzuru pulls the publication date and author from Git.
19
+ * Simple routing with auto-generated listing pages
20
+ * Yearly archives and category-based listings are created automatically.
21
+ * Simple preview server with built-in watch mode
22
+ * `tuzuru serve` automatically rebuilds on requests.
23
+ * Simple installation with minimal setup
24
+ * Install via Homebrew, npm, or download a binary from GitHub Releases.
25
+ * Simple deployment with built-in GitHub Actions
26
+ * From installation to deployment, everything is handled for you.
23
27
 
24
28
  ## Installation
25
29
 
@@ -89,14 +93,75 @@ tuzuru serve
89
93
 
90
94
  This starts a local HTTP server at `http://localhost:8000` with auto-regeneration enabled. When you modify source files, the blog will be automatically rebuilt on the next request.
91
95
 
96
+ ### Deployment
97
+
98
+ This repo has two GitHub Actions prepared for Tuzuru blogs to set up deployment easily.
99
+
100
+ * [ainame/Tuzuru/.github/actions/tuzuru-deploy](https://github.com/ainame/tuzuru/blob/main/.github/actions/tuzuru-deploy/action.yml)
101
+ * Install tuzuru via npm, generate blog, upload the artefact, and deploy to GitHub page
102
+ * [ainame/Tuzuru/.github/actions/tuzuru-generate](https://github.com/ainame/tuzuru/blob/main/.github/actions/tuzuru-generate/action.yml)
103
+ * Only install tuzuru via npm and generate blog
104
+ * You can deploy to anywhere you like
105
+
106
+ Their versions should match the CLI’s version. When you update the CLI version, you should also update the action’s version.
107
+ It is recommended to use Renovate or Dependabot to keep it up to date.
108
+
109
+ **Note that sicne Tuzuru relies on Git history, you have to checkout git repo with the entire history. Specify `fetch-deploy: 0` in `actions/checkout`**
110
+
111
+ This is an exmaple `.github/workflows/deploy.yml`.
112
+
113
+ <details>
114
+
115
+ ```yaml
116
+ name: Deploy
117
+
118
+ on:
119
+ push:
120
+ branches: [main]
121
+ workflow_dispatch:
122
+
123
+ permissions:
124
+ contents: read
125
+ pages: write
126
+ id-token: write
127
+
128
+ concurrency:
129
+ group: "pages"
130
+ cancel-in-progress: false
131
+
132
+ jobs:
133
+ deploy:
134
+ runs-on: ubuntu-latest
135
+ environment:
136
+ name: github-pages
137
+ url: ${{ steps.deployment.outputs.page_url }}
138
+ steps:
139
+ - uses: actions/checkout@v5
140
+ with:
141
+ fetch-depth: 0
142
+ - uses: ainame/Tuzuru/.github/actions/tuzuru-deploy@0.1.2
143
+ ```
144
+
145
+ </details>
146
+
92
147
  ### Built-in layout
93
148
 
94
149
  The built-in layout is a great starting point and is easy to customize. It already includes [github-markdown-css](https://github.com/sindresorhus/github-markdown-css) and [highlight.js](https://highlightjs.org/) to make writing tech blog posts a breeze.
95
150
 
96
-
97
151
  ![screenshot](.github/assets/screenshot.png)
98
152
 
99
- ### Example project structure
153
+ ### Demo
154
+
155
+ You can see Tuzuru in action with this demo blog hosted on GitHub Pages:
156
+
157
+ - **Live Demo**: [https://ainame.tokyo/tuzuru-demo/](https://ainame.github.io/tuzuru-demo/)
158
+ - **Source Repository**: [https://github.com/ainame/tuzuru-demo](https://github.com/ainame/tuzuru-demo)
159
+
160
+ This demo showcases the built-in layout.
161
+
162
+ ## How it works
163
+
164
+ This is how a tuzuru project look like.
100
165
 
101
166
  ```
102
167
  my-blog/
@@ -115,16 +180,10 @@ my-blog/
115
180
  └── tuzuru.json
116
181
  ```
117
182
 
118
- ### Demo
119
-
120
- You can see Tuzuru in action with this demo blog hosted on GitHub Pages:
121
-
122
- - **Live Demo**: [https://ainame.tokyo/tuzuru-demo/](https://ainame.github.io/tuzuru-demo/)
123
- - **Source Repository**: [https://github.com/ainame/tuzuru-demo](https://github.com/ainame/tuzuru-demo)
124
-
125
- This demo showcases the built-in layout and demonstrates how Tuzuru generates clean, lightweight blog pages from plain Markdown files.
126
-
127
- ## How it works
183
+ * `contents/` - where you put markdown files
184
+ * `templates/` - layout files
185
+ * `assets/` - place to locate your assets files, like css or images
186
+ * `tuzuru.json` - configuration
128
187
 
129
188
  ### Layout and customization
130
189
 
@@ -165,7 +224,9 @@ To prevent browser cache issues, use the `{{buildVersion}}` variable in your tem
165
224
 
166
225
  ### tuzuru.json
167
226
 
168
- `tuzuru.json` is the main configuration file, though you can omit most settings if you stick to the defaults.
227
+ `tuzuru.json` is the main configuration file.
228
+ By default, you get only `metadata` section by `tuzuru init` but
229
+ here's the rest of customization you can do.
169
230
 
170
231
 
171
232
  ```javascript
@@ -255,7 +316,7 @@ tuzuru serve --config my-config.json
255
316
  The serve command automatically watches for changes in your source files and regenerates the blog when needed:
256
317
 
257
318
  - **Content files**: Watches `contents/` and `contents/unlisted/` directories
258
- - **Asset files**: Watches the `assets/` directory
319
+ - **Asset files**: Watches the `assets/` directory
259
320
  - **Templates**: Watches template files for changes
260
321
 
261
322
  When files are modified, the blog is regenerated on the next HTTP request, providing a seamless development experience without manual rebuilds.
@@ -264,3 +325,19 @@ When files are modified, the blog is regenerated on the next HTTP request, provi
264
325
 
265
326
  - Swift 6.1+
266
327
  - macOS v15+
328
+
329
+ ## Release
330
+
331
+ Tuzuru uses a PR-based release flow with automated tagging.
332
+
333
+ - Prepare PR (bumps versions, updates composite actions, runs build/tests):
334
+ - `scripts/release.sh 1.2.3` (shortcut for `prepare`)
335
+ - `scripts/release.sh prepare 1.2.3`
336
+
337
+ - After the PR is merged into `main`, a GitHub Actions workflow automatically creates and pushes the git tag (no `v` prefix). That tag triggers the Release workflow to build binaries, create the GitHub Release, and publish to npm.
338
+
339
+ Notes:
340
+ - The script updates `Sources/Command/Command.swift`, `package.json`, `Formula/tuzuru.rb` (if present), and internal composite actions to reference the new npm version.
341
+ - Tags do not use a `v` prefix (e.g., use `1.2.3`).
342
+ - If automation is ever unavailable, a fallback command exists: `scripts/release.sh tag <version>`.
343
+ - If `gh` (GitHub CLI) is installed, the script opens a PR automatically; otherwise, push branch `release/<version>` and open a PR manually.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainame/tuzuru",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "Tuzuru static blog generator (npm wrapper around prebuilt binaries)",
5
5
  "license": "MIT",
6
6
  "private": false,