diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/layout.rs | 3 | ||||
-rw-r--r-- | src/main.rs | 3 | ||||
-rw-r--r-- | src/pages.rs | 37 | ||||
-rw-r--r-- | src/projects/data.rs | 65 | ||||
-rw-r--r-- | src/projects/mod.rs | 71 |
5 files changed, 141 insertions, 38 deletions
diff --git a/src/layout.rs b/src/layout.rs index 600b61a..3a9ca6c 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -7,8 +7,9 @@ Copyright (C) 2023 metamuffin <metamuffin.org> use crate::blog::rocket_uri_macro_r_blog; use crate::pages::{ rocket_uri_macro_r_about, rocket_uri_macro_r_contact, rocket_uri_macro_r_pgp_key, - rocket_uri_macro_r_projects, rocket_uri_macro_r_stuff, rocket_uri_macro_r_toggle_css, + rocket_uri_macro_r_stuff, rocket_uri_macro_r_toggle_css, }; +use crate::projects::rocket_uri_macro_r_projects; use crate::source::rocket_uri_macro_r_source; use crate::uri; use markup::Render; diff --git a/src/main.rs b/src/main.rs index 85670c4..ebe217c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,16 +3,19 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin <metamuffin.org> */ +#![feature(const_trait_impl)] pub mod blog; pub mod error; pub mod layout; pub mod pages; +pub mod projects; pub mod source; pub mod wellknown; use blog::*; use error::*; use pages::*; +use projects::*; use rocket::{catchers, fairing::AdHoc, fs::FileServer, http::Header, routes}; use source::*; use wellknown::*; diff --git a/src/pages.rs b/src/pages.rs index 47f9f98..1a00664 100644 --- a/src/pages.rs +++ b/src/pages.rs @@ -44,43 +44,6 @@ pub fn r_about() -> DynScaffold<'static> { } } -#[get("/projects")] -pub fn r_projects() -> DynScaffold<'static> { - Scaffold { - title: "projects".to_string(), - content: markup::new! { - p { "I am starting a lot of projects - here are a few selected ones:" } - ul { - li { - b{"keks-meet:"} " a simple secure web conferencing application. " - "(" a[href="https://meet.metamuffin.org"]{"hosted"} "; " a[href="https://codeberg.org/metamuffin/keks-meet"]{"code"} ")" - } - li { - b{"gnix:"} " a stupid reverse proxy to replace nginx. serving the webpage you are viewing right now. " - "(" a[href="https://metamuffin.org"]{"hosted"} "; " a[href="https://codeberg.org/metamuffin/gnix"]{"code"} ")" - } - li { - b{"pfadfinder:"} " parallel anytime A* for openstreetmap with custom frontend and integration into the existing one. " - "(" a[href="https://codeberg.org/metamuffin/pfadfinder"]{"code"} ")" - } - li { - b{"video-codec-experiments:"} " a few attempts of creating my own video codecs, making use of motion compensation, dct, quantization and more. " - "(" a[href="https://codeberg.org/metamuffin/video-codec-experiments"]{"code"} ")" - } - li { - b{"pixelflut tools:"} " the programs I hacked together when playing pixelflut. includes GPU-acceleration for updating the canvas with minimal bandwidth usage. " - "(" a[href="https://codeberg.org/metamuffin/pixelflut"]{"code"} ")" - } - li { - b{"karlender:"} " a personal calender suite consisting of a daemon, a graphical and a command-line user interface. " - "supports very flexible condition based recurring tasks and automatic scheduling so you dont need to decide. " - "(" a[href="https://codeberg.org/metamuffin/karlender"]{"code"} ")" - } - } - }, - } -} - #[get("/contact")] pub fn r_contact() -> DynScaffold<'static> { Scaffold { diff --git a/src/projects/data.rs b/src/projects/data.rs new file mode 100644 index 0000000..0e2b8dc --- /dev/null +++ b/src/projects/data.rs @@ -0,0 +1,65 @@ +use super::{Project, Status::*}; + +pub const PROJECTS: &'static [Project] = &[ + Project { + name: "keks-meet", + status: Maintained, + description: "a simple secure web conferencing application.", + link: Some("https://meet.metamuffin.org"), + ..default() + }, + Project { + name: "jellything", + status: Developing, + description: "media streaming solution (similiar to jellyfin). supports on-the-fly remuxing and federated content.", + ..default() + }, + Project { + name: "voxelwagen", + status: Developing, + description: "voxel game engine made from scratch; made to host an automation game.", + repo_link: Some("https://codeberg.org/voxelwagen/voxelwagen"), + ..default() + }, + Project { + name: "gnix", + status: Maintained, + description: "a stupid reverse proxy to replace nginx. serving the webpage you are viewing right now.", + link: Some("https://metamuffin.org"), + ..default() + }, + Project { + name: "pfadfinder", + status: Stale, + description: "parallel anytime A* for openstreetmap with custom frontend and integration into the existing one.", + ..default() + }, + Project { + name: "video-codec-experiments", + status: Stale, + description: "a few attempts of creating my own video codecs, making use of motion compensation, dct, quantization and more. ", + ..default() + }, + Project { + name: "pixelflut tools", + status: Stale, + description: "the programs I hacked together when playing pixelflut. includes GPU-acceleration for updating the canvas with minimal bandwidth usage.", + ..default() + }, + Project { + name: "karlender", + status: Stale, + description: " a personal calender suite consisting of a daemon, a graphical and a command-line user interface. supports very flexible condition based recurring tasks and automatic scheduling so you dont need to decide.", + ..default() + }, +]; + +const fn default() -> Project { + Project { + name: "", + status: super::Status::Unknown, + description: "", + link: None, + repo_link: None, + } +} diff --git a/src/projects/mod.rs b/src/projects/mod.rs new file mode 100644 index 0000000..f399984 --- /dev/null +++ b/src/projects/mod.rs @@ -0,0 +1,71 @@ +use self::data::PROJECTS; +use crate::layout::{DynScaffold, Scaffold}; +use markup::Render; +use rocket::get; + +pub mod data; + +#[get("/projects")] +pub fn r_projects() -> DynScaffold<'static> { + Scaffold { + title: "projects".to_string(), + content: markup::new! { + p { "I am starting a lot of projects - this page lists some of them." } + p { + "Starting so many means, that most of then are not maintained or not even properly developed." + "Here is a quick reference to what I define the status of a project to be:" + } + ol { + li { @Status::Planned.render() ": No code has been written yet." } + li { @Status::Developing.render() ": Project is under active development." } + li { @Status::Maintained.render() ": Project is in a working state and receives regular updates." } + li { @Status::Stale.render() ": Project has been discontinued for an unspecified amount of time, but might be resumed if i feel like it." } + li { @Status::Abandoned.render() ": Project has been discontinued and will likely not be continued forever." } + li { @Status::Unknown.render() ": I have not bothered to write down the status" } + } + ul { + @for p in PROJECTS { + li { @p } + } + } + }, + } +} + +#[derive(Debug, Clone, Copy)] +pub enum Status { + Unknown, + Planned, + Developing, + Stale, + Maintained, + Abandoned, +} + +markup::define! { Project( + name: &'static str, + status: Status, + description: &'static str, + link: Option<&'static str>, + repo_link: Option<&'static str> +) { + b { @name } + @status.render() + ": " @description + " (" + @if let Some(link) = link { + a[href=link] "Project page" + ", " + } + @let fallback = format!("https://codeberg.org/metamuffin/{name}"); + a[href=repo_link.unwrap_or(&fallback)] "Source code" + ")" +}} + +impl Status { + pub fn render(self) -> impl Render { + markup::new! { + div[class=format!("status status-{self:?}")] { @format!("{self:?}") } + } + } +} |