From: Ruben Beltran del Rio Date: Wed, 13 Mar 2024 10:29:57 +0000 (+0100) Subject: Add the packaging steps + manual X-Git-Tag: 1.3.1~1 X-Git-Url: https://git.r.bdr.sh/rbdr/page/commitdiff_plain/a411ac34c5895e8ea4ddeed6b72f4787886a1ab0 Add the packaging steps + manual --- diff --git a/.build.yml b/.build.yml index 1b1a3b9..729271b 100644 --- a/.build.yml +++ b/.build.yml @@ -2,6 +2,7 @@ image: archlinux packages: - make - rsync + - coreutils - clang - lld - rustup @@ -17,6 +18,9 @@ tasks: - set_rust: | cd page make set_rust + - install_builders: | + cargo install cargo-generate-rpm + cargo install cargo-deb - package: | cd page make ci diff --git a/Cargo.toml b/Cargo.toml index 742098f..ebec913 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,10 @@ name = "page" version = "1.3.1" edition = "2021" +license = "AGPL-3.0-or-later" +description = "Command line tool to generate a static website and gemini capsule from a directory with gemtext." +homepage = "https://r.bdr.sh/page.html" +authors = ["Rubén Beltrán del Río "] [dependencies] @@ -9,3 +13,15 @@ edition = "2021" strip = true lto = true panic = "abort" + +[package.metadata.generate-rpm] +assets = [ + { source = "target/release/page", dest = "/usr/bin/page", mode = "755" }, + { source = "man/page.1", dest = "/usr/share/man/man1/page.1", mode = "644" }, +] + +[package.metadata.deb] +assets = [ + ["target/release/page", "/usr/bin/page", "755" ], + ["man/page.1", "/usr/share/man/man1/page.1", "644" ], +] diff --git a/Makefile b/Makefile index 04e6cd6..e1b9f97 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ prepare: build: prepare cargo build --profile $(profile) --target $(target) -release: rpm tar - rsync -avz $(app_name)-$(target)-$(channel).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) +release: rpm tar deb + @$(eval filename := $(app_name)-$(target)-$(channel)) $(architectures): ifneq ($(channel),) @@ -24,10 +24,28 @@ else $(MAKE) -e target=$@ build endif +deb: build + @$(eval filename := $(app_name)-$(target)-$(channel)) + cargo deb --profile $(profile) --target $(target) + mv target/$(target)/debian/*.deb $(filename).deb + sha256sum $(filename).deb > $(filename).deb.sha256 + rsync -avz $(filename).deb deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) + rsync -avz $(filename).deb.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) + rpm: build + @$(eval filename := $(app_name)-$(target)-$(channel)) + cargo generate-rpm --profile $(profile) --target $(target) + mv target/$(target)/generate-rpm/*.rpm $(filename).rpm + sha256sum $(filename).rpm > $(filename).rpm.sha256 + rsync -avz $(filename).rpm deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) + rsync -avz $(filename).rpm.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) tar: build - tar -czvf $(app_name)-$(target)-$(channel).tar.gz -C target/$(target)/$(profile)/ $(app_name) + @$(eval filename := $(app_name)-$(target)-$(channel)) + tar -czvf $(filename).tar.gz -C target/$(target)/$(profile)/ $(app_name) + sha256sum $(filename).tar.gz > $(filename).tar.gz.sha256 + rsync -avz $(filename).tar.gz deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) + rsync -avz $(filename).tar.gz.sha256 deploy@conchos.unlimited.pizza:/srv/http/build.r.bdr.sh/$(app_name) package: $(architectures) diff --git a/man/page.1 b/man/page.1 new file mode 100644 index 0000000..40ed0c4 --- /dev/null +++ b/man/page.1 @@ -0,0 +1,93 @@ +.TH PAGE 1 "2024-03-13" "1.3.1" "Page Manual" +.SH NAME +page \- gemtext based static website generation tool for gemini and http. +.SH SYNOPSIS +.B page +.SH DESCRIPTION +.PP +page is a tool that lets you create a static website from a directory of +gemtext files. +.PP +To use, go to the directory containing the site, and run \fBpage\fR. It will +create two directories in the parent directory using the same name but +appending \fB_html\fR and \fB_gemini\fR. +.SH FOLDER STRUCTURE +The website directory has some requirements for page to work correctly. It +must contain \fIgemtext\fR and a \fIlayout\fR, and optionally may contain +static files. +.SH GEMTEXT +.P +Any file with ending \fI.gmi\fR is interpreted as gemtext and will be parsed +as html with the following rules: +.TP +\- The first two lines are checked for front matter +.TP +\- If the first or second line starts with \fB--- title:\fR, the text following will be treated as the title of the page and the line will be removed from the output. +.TP +\- If the first or second line starts with \fB--- description:\fR, the text following will be treated as the description of the page and the line will be removed from the output. +.TP +\- URLs that end with the extension \fI.gmi\fR will be replaced with \fI.html\fR unless the url begins with \fIgemini:\fR +.P +Example, this could be index.gmi. The first link will be converted to html but the second won't: +.nf +\f(CW +--- title: Home +--- description: Clemland is dedicated to all things sound + +# Welcome to Clemland + +My projects are located here: + +=> /projects.gmi Projects + +This is a good gemini page: + +=> gemini://r.bdr.sh/page.gmi +\fR +.fi +.SH LAYOUT +A file called _layout.html at the root of the element. It must be present. It +should include the three following keywords, \fBexactly as shown\fR. +.TP +.B {{ title }} +will get replaced with the front matter title of the gemtext file. +.TP +.B {{ description }} +will get replaced with the front matter description of the gemtext file. +.TP +.B {{ content }} +will get replaced with the body of the gemtext file. +.P +For example: +.nf +\f(CW + + + + + + + + + + Clemland {{ title }} + + + + +
+ {{ content }} +
+ + +\fR +.fi +.SH STATIC FILES +Any file that isn't gemtext or the layout will be copied as-is. This includes +hidden files! The only ones that are excluded are .git and .gitignore. +.SH VERSION +.BR 1.3.1 +.SH HOMEPAGE +.I https://r.bdr.sh/page.html +.SH AUTHORS +\ Rubén Beltrán del Río <\fIpage@r.bdr.sh\fP>