From 0bdd90edbecb600ab6bae93711e00138655e27f1 Mon Sep 17 00:00:00 2001
From: Michal Vanko
Date: Wed, 13 Mar 2024 19:14:10 +0100
Subject: [PATCH] i have no idea how many changes
---
axum_server/.cargo/config.toml | 2 +
axum_server/.zellij/dev-layout.kdl | 6 +-
axum_server/Cargo.toml | 13 ++-
axum_server/justfile | 6 ++
axum_server/src/main.rs | 3 +-
axum_server/src/pages/post.rs | 7 +-
axum_server/styles/output.css | 85 ++++++++++++++++---
.../templates/components/talent_card.html | 18 ++++
axum_server/templates/index.html | 17 ++--
axum_server/templates/post.html | 10 +--
axum_server/templates/post_list.html | 2 +-
axum_server/templates/post_preview_card.html | 18 +---
axum_server/templates/post_tag_list.html | 11 +++
axum_server/templates/site_footer.html | 50 ++++++++++-
14 files changed, 194 insertions(+), 54 deletions(-)
create mode 100644 axum_server/.cargo/config.toml
create mode 100644 axum_server/templates/components/talent_card.html
create mode 100644 axum_server/templates/post_tag_list.html
diff --git a/axum_server/.cargo/config.toml b/axum_server/.cargo/config.toml
new file mode 100644
index 0000000..c4bb6e0
--- /dev/null
+++ b/axum_server/.cargo/config.toml
@@ -0,0 +1,2 @@
+[build]
+rustflags = ["-Clink-arg=-fuse-ld=lld", "-Ctarget-cpu=native"]
diff --git a/axum_server/.zellij/dev-layout.kdl b/axum_server/.zellij/dev-layout.kdl
index 99d4bc0..6f06a8c 100644
--- a/axum_server/.zellij/dev-layout.kdl
+++ b/axum_server/.zellij/dev-layout.kdl
@@ -1,7 +1,4 @@
layout {
- pane size=1 borderless=true {
- plugin location="zellij:tab-bar"
- }
pane split_direction="vertical" focus=true {
pane edit="src/main.rs"
pane split_direction="horizontal" size=60 {
@@ -22,4 +19,7 @@ layout {
pane size=2 borderless=true {
plugin location="zellij:status-bar"
}
+ pane size=1 borderless=true {
+ plugin location="zellij:tab-bar"
+ }
}
diff --git a/axum_server/Cargo.toml b/axum_server/Cargo.toml
index 49724f2..677cd94 100644
--- a/axum_server/Cargo.toml
+++ b/axum_server/Cargo.toml
@@ -1,6 +1,3 @@
-[build]
-rustflags = ["-Z", "threads=8"]
-
[package]
name = "axum_server"
version = "0.1.0"
@@ -23,3 +20,13 @@ tower-http = { version = "0.5.0", features = ["trace", "fs"] }
tower-livereload = "0.9.2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
+
+[build]
+rustflags = ["-Z", "threads=8"]
+
+[profile.dev]
+debug = true
+opt-level = 1
+lto = "thin"
+panic = "unwind"
+strip = false
diff --git a/axum_server/justfile b/axum_server/justfile
index 42ab7ca..664bea4 100644
--- a/axum_server/justfile
+++ b/axum_server/justfile
@@ -4,6 +4,12 @@ port := env_var_or_default('PORT', '3080')
tailwind:
npx tailwindcss -i ./styles/input.css -o ./styles/output.css --watch
+# svg sprite creation
+# TODO change route on svetle project deletion
+# TODO #directory-swap
+svgstore:
+ npx svgstore -o ../static/svg/icons-sprite.svg ../src/svg/**.svg
+
server_dev:
cargo watch -x run
diff --git a/axum_server/src/main.rs b/axum_server/src/main.rs
index 1e14237..f3268e7 100644
--- a/axum_server/src/main.rs
+++ b/axum_server/src/main.rs
@@ -28,7 +28,8 @@ async fn main() {
// build our application with a single route
let app = router::get_router()
.nest_service("/styles", ServeDir::new("styles"))
- .nest_service("/images", ServeDir::new("../static/images"));
+ .nest_service("/images", ServeDir::new("../static/images"))
+ .nest_service("/svg", ServeDir::new("../static/svg"));
#[cfg(debug_assertions)]
let app = app.layer(LiveReloadLayer::new());
diff --git a/axum_server/src/pages/post.rs b/axum_server/src/pages/post.rs
index 5da2ad8..d6b1618 100644
--- a/axum_server/src/pages/post.rs
+++ b/axum_server/src/pages/post.rs
@@ -1,4 +1,4 @@
-use crate::filters;
+use crate::{components::site_header::Link, filters};
use askama::Template;
use axum::{extract::Path, http::StatusCode};
use chrono::{DateTime, Utc};
@@ -49,6 +49,9 @@ pub async fn render_post(Path(post_id): Path) -> Result
+
+
+
+
+{% endmacro %}
+
diff --git a/axum_server/templates/index.html b/axum_server/templates/index.html
index d0421ef..9301701 100644
--- a/axum_server/templates/index.html
+++ b/axum_server/templates/index.html
@@ -1,9 +1,10 @@
+{%- import "components/talent_card.html" as tc -%}
{% extends "base.html" %}
{% block title %}Introduction{% endblock %}
{% block content %}
-
+
+
+ {% call tc::talent_card("code", "Web development", "Extensive expertise in creating performant, live web applications and websites") %}
+ {% call tc::talent_card("gamepad", "Game development", "Extensive expertise in creating performant, live web applications and websites") %}
+
Follow my twitch stream
diff --git a/axum_server/templates/post.html b/axum_server/templates/post.html
index 1828fc9..637e8ef 100644
--- a/axum_server/templates/post.html
+++ b/axum_server/templates/post.html
@@ -5,13 +5,9 @@
{% block content %}
- {{title}}
-
-
- {% for tag in tags %}
- #{{tag}}
- {% endfor %}
-
+ {{title}}
+
TODO: article preview, maybe implement as a filter?,
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Ald
-
-
- {% if post.metadata.tags.len() > 0 %}
- Tags:
-
- {% for tag in post.metadata.tags %}
-
- {{tag}}
-
- {% endfor %}
-
- {% endif %}
-
-
diff --git a/axum_server/templates/post_tag_list.html b/axum_server/templates/post_tag_list.html
new file mode 100644
index 0000000..d1cf9be
--- /dev/null
+++ b/axum_server/templates/post_tag_list.html
@@ -0,0 +1,11 @@
+
+ {% if tags.len() > 0 %}
+
+ {% for tag in tags %}
+
+ #{{tag}}
+
+ {% endfor %}
+
+ {% endif %}
+
diff --git a/axum_server/templates/site_footer.html b/axum_server/templates/site_footer.html
index 60cd712..67c25f6 100644
--- a/axum_server/templates/site_footer.html
+++ b/axum_server/templates/site_footer.html
@@ -1,7 +1,49 @@
+{% macro contact_link(svg, title, href, text) %}
+
+
+
+
+
+ {{text}}
+
+
+{% endmacro %}
+
- {% for post in latest_posts %}
+
+ Contact
- {{post.metadata.title}}
-
- {% endfor %}
+
+
+ {% call contact_link("mail", "E-mail address", "mailto: michalvankosk@gmail.com", "michalvankosk@gmail.com") %}
+
+
+ {% call contact_link("twitch", "Twitch channel", "https://twitch.tv/michalvankodev", "Twitch") %}
+
+
+ {% call contact_link("discord", "Discord channel", "TODO link na discord", "Discord channel") %}
+
+
+ {% call contact_link("tiktok", "TikTok channel", "https://tiktok.com/@michalvankodev", "TikTok") %}
+
+
+ {% call contact_link("youtube", "YouTube channel", "https://www.youtube.com/@michalvankodev", "YouTube") %}
+
+
+ {% call contact_link("twitter", "Twitter profile", "https://twitter.com/michalvankodev", "Twitter") %}
+
+
+ {% call contact_link("instagram", "Instagram profile", "https://instagram.com/michalvankodev", "Instagram") %}
+
+
+ {% call contact_link("github", "GitHub profile", "https://github.com/michalvankodev", "GitHub") %}
+
+
+ {% call contact_link("linkedin", "LinkedIn profile", "https://www.linkedin.com/in/michal-vanko-dev/", "LinkedIn") %}
+
+