@ainame/tuzuru 0.1.2 → 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.
- package/LICENSE +21 -0
- package/README.md +91 -30
- 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
|
-
](https://swift.org)
|
|
4
|
+
[](https://swift.org/package-manager/)
|
|
5
|
+
[](https://github.com/ainame/tuzuru/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/ainame/tuzuru/releases)
|
|
7
|
+
[](https://github.com/ainame/tuzuru/actions)
|
|
12
8
|
|
|
13
|
-
|
|
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.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+

|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
It is designed to keep workflows minimal, allowing you to focus on writing.
|
|
18
16
|
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
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
|

|
|
98
152
|
|
|
99
|
-
###
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
|
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.
|