blob: d03844ee8f5f71e7e13d9c6b9aa73316a9299f76 (
plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# page
A static website generator for exactly 1 use case.
"I have a bunch of gemini files that I want to serve as-is, but I also
want to generate some HTML"
## How to use
1. Stand on the directory you want to turn into a page
2. run page
3. your html output is in ../<directory_name>_html
4. your gemini without frontmatter output is in ../<directory_name>_gemini
So for example:
```
$ pwd
/home/rbdr/web/website
$ page
$ ls ..
website/
website_html/
website_gemini/
```
## Front Matter
You can add some optional front matter. We'll look at the two first lines that
start with `---`
The format is:
```
--- title: the title of the page
--- description: a description
```
This only works if they are the first lines of the page.
## Local Path Translation
Links that end with `.gmi` will be replaced with `.html` unless they specifically start with `gemini:`
## Layouts
page expects a file called _layout.html in the root. It expects three placeholders:
* {{ content }} the generated HTML from parsing the gemini text files.
* {{ title }} the frontmatter title or an empty string.
* {{ description }} the frontmatter description or an empty string.
## Hidden folders
Hidden folders are copied as well, we only make an exception for `.git/`, and
`.gitignore` which are explicitly ignored. This is handy for folders like
`.well-known`, but could cause unwanted behavior if there's other hidden files
in the directory.
## What happens to files that aren't gemini?
They're copied as-is.
# Building
This project is built using cargo. A makefile is provided to run common tasks.
Build dev version with `make` or `make build`.
Build release with `make -e profile=release` or `make -e profile=release build`.
Run tests with `make test`.
If you have [tarpaulin][tarpaulin], you can also run `make coverage` to get
coverage information.
# Distribution of Builds
Builds are available at [build.r.bdr.sh][rbdr-builds]. The linux builds are
generated automatically by the CI: Unstable builds are built from the `main`
branch, and stable releases are built from tags.
For mac, the process is still manual, since the commands need to be run from
a macos machine by running `make mac` for unstable builds, and
`make -e tag=M.m.p` for stable builds.
[tarpaulin]: https://github.com/xd009642/tarpaulin
[rbdr-builds]: https://build.r.bdr.sh/page/
|