@ainame/tuzuru 0.1.1 → 0.2.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 +97 -28
  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,27 +1,39 @@
1
1
  # Tuzuru
2
2
 
3
- ![logo](.github/assets/logo.png)
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)
4
8
 
5
- Tuzuru (綴る) is dead-simple static **blog** generator CLI that uses Git to manage your blog's metadata.
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.
6
12
 
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.
13
+ ![logo](.github/assets/logo.png)
8
14
 
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.
15
+ It is designed to keep workflows minimal, allowing you to focus on writing.
10
16
 
11
- ## Motivation
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.
12
27
 
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.
28
+ ## Installation
14
29
 
15
- I wanted a simple, intuitive blogging tool, but none I tried felt quite right. So, I decided to build my own.
30
+ ### npm (Cross-platform)
16
31
 
17
- Tuzuru is designed with these core principles:
32
+ ```bash
33
+ npm install -g @ainame/tuzuru
34
+ ```
18
35
 
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
23
-
24
- ## Installation
36
+ This will download and install the appropriate prebuilt binary for your platform (macOS or Linux).
25
37
 
26
38
  ### Homebrew (macOS)
27
39
 
@@ -81,14 +93,75 @@ tuzuru serve
81
93
 
82
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.
83
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
+
84
147
  ### Built-in layout
85
148
 
86
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.
87
150
 
88
-
89
151
  ![screenshot](.github/assets/screenshot.png)
90
152
 
91
- ### 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.
92
165
 
93
166
  ```
94
167
  my-blog/
@@ -107,16 +180,10 @@ my-blog/
107
180
  └── tuzuru.json
108
181
  ```
109
182
 
110
- ### Demo
111
-
112
- You can see Tuzuru in action with this demo blog hosted on GitHub Pages:
113
-
114
- - **Live Demo**: [https://ainame.tokyo/tuzuru-demo/](https://ainame.github.io/tuzuru-demo/)
115
- - **Source Repository**: [https://github.com/ainame/tuzuru-demo](https://github.com/ainame/tuzuru-demo)
116
-
117
- This demo showcases the built-in layout and demonstrates how Tuzuru generates clean, lightweight blog pages from plain Markdown files.
118
-
119
- ## 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
120
187
 
121
188
  ### Layout and customization
122
189
 
@@ -157,7 +224,9 @@ To prevent browser cache issues, use the `{{buildVersion}}` variable in your tem
157
224
 
158
225
  ### tuzuru.json
159
226
 
160
- `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.
161
230
 
162
231
 
163
232
  ```javascript
@@ -247,7 +316,7 @@ tuzuru serve --config my-config.json
247
316
  The serve command automatically watches for changes in your source files and regenerates the blog when needed:
248
317
 
249
318
  - **Content files**: Watches `contents/` and `contents/unlisted/` directories
250
- - **Asset files**: Watches the `assets/` directory
319
+ - **Asset files**: Watches the `assets/` directory
251
320
  - **Templates**: Watches template files for changes
252
321
 
253
322
  When files are modified, the blog is regenerated on the next HTTP request, providing a seamless development experience without manual rebuilds.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainame/tuzuru",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Tuzuru static blog generator (npm wrapper around prebuilt binaries)",
5
5
  "license": "MIT",
6
6
  "private": false,