From 50694c43f5ab890a385d14127c9aaf6002e87a2b Mon Sep 17 00:00:00 2001 From: Michal Vanko Date: Sun, 15 Sep 2024 22:08:44 +0200 Subject: [PATCH] Fix SSG and just commmands --- axum_server/docs/cicd_pipeline.md | 25 +++++++++++++++++++++++++ axum_server/justfile | 11 ++++++++++- axum_server/src/main.rs | 12 +++++++++--- axum_server/templates/base.html | 6 ------ axum_server/templates/site_footer.html | 2 ++ 5 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 axum_server/docs/cicd_pipeline.md diff --git a/axum_server/docs/cicd_pipeline.md b/axum_server/docs/cicd_pipeline.md new file mode 100644 index 0000000..7f0b86f --- /dev/null +++ b/axum_server/docs/cicd_pipeline.md @@ -0,0 +1,25 @@ +# CI/CD Pipeline + +Gitea server for production. + +Github actions for build and release. +Release -> Publish. + +## Build step + +1. Compile project +2. Run in production mode +3. wget command to download and create a static site. + a) ensure every image is downloaded and created / we can create a cache mechanism to download images from previous build / save a ton of time +4. Backup old version +5. Publish new version + + +## Development + +1. Build the project +2. Wget cannot be run on dev server due to tower reload + +## TODO + +- Some weird links (Colemak) diff --git a/axum_server/justfile b/axum_server/justfile index 987aed1..5244e13 100644 --- a/axum_server/justfile +++ b/axum_server/justfile @@ -52,9 +52,18 @@ kill: clean: rm -rf dist +# SSG +ssg: + - wget --no-convert-links -r -p -E -P dist --no-host-directories 127.0.0.1:{{port}} + - wget -P dist/svg 127.0.0.1:{{port}}/svg/icons-sprite.svg + +# Preview server +preview: + npx http-server dist + # SSG export of production server export: clean just prod & just wait_for_port - - wget --convert-links -r -p --level 1 -E -P dist --no-host-directories localhost:{{port}} + just ssg just kill diff --git a/axum_server/src/main.rs b/axum_server/src/main.rs index 9a0a62d..d3fc4b7 100644 --- a/axum_server/src/main.rs +++ b/axum_server/src/main.rs @@ -49,8 +49,14 @@ async fn main() { axum::serve(listener, app).await.unwrap(); } -// TODO responsive design -// TODO Variable weight for font, setup boldness for and h1 h2 ... elements -// - contact +// TODO Socials +// TODO ul li article styles +// TODO header height difference +// - fotos // TODO Colors +// TODO print css and other 404 css linked in base.html // TODO go live pipeline +// TODO after release +// - contact +// - projects page +// - linktree page diff --git a/axum_server/templates/base.html b/axum_server/templates/base.html index 22a87f3..6d5f51f 100644 --- a/axum_server/templates/base.html +++ b/axum_server/templates/base.html @@ -15,12 +15,6 @@ title="RSS feed for latest posts" href="https://michalvanko.dev/feed.xml" /> - diff --git a/axum_server/templates/site_footer.html b/axum_server/templates/site_footer.html index 0729e4f..5562bd0 100644 --- a/axum_server/templates/site_footer.html +++ b/axum_server/templates/site_footer.html @@ -37,5 +37,7 @@ alt="nd" class="inline-block h-6 mx-0.5" /> + +