Commit
Message
Changed Files (8)
-
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c9243..457bb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [unreleased] +### 🚀 Features + +- Add CLI and config serialization + ### 🐛 Bug Fixes - Remove builder artifact hashing as it is done on site build -
modified README.md
diff --git a/README.md b/README.md index 1902e7b..60c4d2e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# abbaye - -## Abbaye +# Abbaye  @@ -33,33 +31,33 @@ Here's an example file structure: └── … ``` -### Why ? +## Why ? This piece of software is for people that can't or won't use a full-featured forge such as GitHub, GitLab, ForgeJo & others. These forges provide "release pages" that allow you to upload and distribute your software, as well as get a changelog. Abbaye is made to be a simple, lightweight alternative to these forges, for the release/documentation parts. -#### Why "Abbaye" ? +### Why "Abbaye" ? [Abbaye](https://en.wikipedia.org/wiki/Abbaye) is a French word for Abbey. An Abbey is a type of monastery, on the big-ish side, but still a small, quiet place. Anyway, that's where you store and display your relics (your software releases). -### Installation +## Installation -#### Pre-built binaries +### Pre-built binaries You can grab a pre-built binary from the [releases page](http://vit.am/~ololduck/abbaye/latest). The `-musl` binaries are statically linked and should run everywhere, while the `-gnu` binaries are dynamically linked and require a compatible system library(which is probably available if you're not using an exotic distribution). -#### From source +### From source To build from source, you need to have Rust installed. You can install Rust using [rustup](https://rustup.rs/). If you don't have rust installed, this project won't be of much use to you, as it currently only implements rust builders :stuck_out_tongue: You can clone the [repository](https://git.sr.ht/~ololduck/abbaye) and build the project using `cargo build --release`. -### Usage +## Usage Run `abbaye init` in your project's directory to create a `abbaye.toml` configuration file. You can then customize the configuration to your liking. Here's an example configuration file to get you started: -
modified abbaye.toml
diff --git a/abbaye.toml b/abbaye.toml index 5ed77fe..aae0dfd 100644 --- a/abbaye.toml +++ b/abbaye.toml @@ -1,6 +1,7 @@ [site] name = "Abbaye" base_url = "http://vit.am/~ololduck/abbaye/" +repo_url = "https://git.sr.ht/~ololduck/abbaye" [version_extractor] type = "git" -
modified mise.toml
diff --git a/mise.toml b/mise.toml index cddadbc..33692ac 100644 --- a/mise.toml +++ b/mise.toml @@ -38,7 +38,8 @@ sources = ["src/main.rs"] [tasks.generate-changelog] description = "generates a changelog from git commits" run = [ - "git-cliff $(if [[ \"${usage_bump:-false}\" == \"true\" ]]; then echo -n '--bump'; fi) --output ${usage_output}" + "git-cliff $(if [[ \"${usage_bump:-false}\" == \"true\" ]]; then echo -n '--bump'; fi) --output ${usage_output}", + "if [[ -n \"${usage_output}\" ]]; then git add ${usage_output}; fi", ] usage = """ flag "-b --bump" help="bump level" @@ -48,7 +49,7 @@ outputs = ["CHANGELOG.md"] [tasks.build] alias = "b" -depends = ["generate-readme", "generate-changelog"] +depends = ["generate-readme", "generate-changelog -o CHANGELOG.md"] description = "build the project" run = ["cargo build"] sources = ["Cargo.toml", "Cargo.lock", "*.rs", "**/*.rs"] @@ -60,6 +61,13 @@ run = ["cargo build --release"] sources = ["Cargo.toml", "Cargo.lock", "*.rs", "**/*.rs"] [tasks.release] +depends = [ + "generate-readme", + "generate-changelog", + "build::release", + "fmt", + "lint" +] confirm = "Are you sure you want to release?" description = "release the project" run = [ @@ -77,12 +85,12 @@ run = ["cargo clean", "rm -rf public/"] [tasks.abbaye] wait_for = ["release", "clean"] description = "builds the release website" -run = ["cargo run --bin abbaye"] +run = ["cargo run --bin abbaye -- build"] outputs = ["public/"] [tasks.deploy-docs] description = "deploys documentation to https://vit.am/~ololduck/abbaye" -depends = ["abbaye"] +depends = ["abbaye", "clean"] run = [ "rsync --progress -avz --links --perms --update public/ ololduck@vit.am:public_html/abbaye/" ] -
modified src/config.rs
diff --git a/src/config.rs b/src/config.rs index e404bac..ba7d4fc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,6 +18,9 @@ pub struct SiteConfig { /// When set, the generated `releases.atom` feed will include absolute links /// and proper entry IDs. Trailing slashes are stripped automatically. pub base_url: Option<String>, + /// URL of the project's repository (e.g. `"https://git.sr.ht/~ololduck/abbaye"`). + /// When set, we will show the repository link in the generated website. + pub repo_url: Option<String>, } /// A full configuration for the Abbaye site generator. -
modified src/main.rs
diff --git a/src/main.rs b/src/main.rs index a79936f..e90a06c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,6 +139,7 @@ async fn main() -> Result<()> { name: "MyProject Release Page".to_string(), readme: None, base_url: None, + repo_url: None, }, version_extractor: AnyVersionExtractor::Git(GitVersionConfig { tag_prefix: Some("v".to_string()), -
modified src/site.rs
diff --git a/src/site.rs b/src/site.rs index f973934..ef0fb76 100644 --- a/src/site.rs +++ b/src/site.rs @@ -213,6 +213,7 @@ pub async fn build_site(config: AbbayeConfig) -> Result<()> { // ── 8. Version index.html ───────────────────────────────────────────────── let mut version_ctx = Context::new(); version_ctx.insert("project_name", &config.site.name); + version_ctx.insert("repo_url", &config.site.repo_url); version_ctx.insert("version", &version); version_ctx.insert("readme_html", &readme_html); version_ctx.insert("changelog_html", &changelog_html); @@ -249,6 +250,7 @@ pub async fn build_site(config: AbbayeConfig) -> Result<()> { let mut root_ctx = Context::new(); root_ctx.insert("project_name", &config.site.name); + root_ctx.insert("repo_url", &config.site.repo_url); root_ctx.insert("versions", &version_entries); root_ctx.insert("atom_feed", ATOM_FEED_FILENAME); -
modified src/templates/version_index.html
diff --git a/src/templates/version_index.html b/src/templates/version_index.html index 07200f3..3939b12 100644 --- a/src/templates/version_index.html +++ b/src/templates/version_index.html @@ -228,7 +228,12 @@ </header> <div class="layout"> <aside> - {% if has_docs %} + {% if repo_url %} + <dl> + <dt>Repository</dt> + <dd><a href="{{ repo_url }}">{{ repo_url }}</a></dd> + </dl> + {% endif %} {% if has_docs %} <h3>Documentation</h3> <ul> <li><a href="docs/">📖 API docs</a></li>