Compare commits
2 Commits
0509565c2b
...
fec60900f5
Author | SHA1 | Date | |
---|---|---|---|
fec60900f5 | |||
96ead1a38f |
@ -26,6 +26,7 @@ rayon = "1.10.0"
|
||||
syntect = "5.2.0"
|
||||
indoc = "2.0.5"
|
||||
askama_escape = "0.10.3"
|
||||
mime_guess = "2.0.5"
|
||||
|
||||
[build]
|
||||
rustflags = ["-Z", "threads=8"]
|
||||
|
29
src/feed.rs
29
src/feed.rs
@ -1,9 +1,10 @@
|
||||
use axum::http::{header, StatusCode};
|
||||
use axum::response::IntoResponse;
|
||||
use chrono::Utc;
|
||||
use rss::{ChannelBuilder, GuidBuilder, Item, ItemBuilder};
|
||||
use rss::{ChannelBuilder, EnclosureBuilder, GuidBuilder, Item, ItemBuilder};
|
||||
|
||||
use crate::blog_posts::blog_post_model::{BlogPostMetadata, BLOG_POST_PATH};
|
||||
use crate::filters::{parse_markdown, truncate_md};
|
||||
use crate::post_utils::post_listing::get_post_list;
|
||||
|
||||
pub async fn render_rss_feed() -> Result<impl IntoResponse, StatusCode> {
|
||||
@ -25,8 +26,30 @@ pub async fn render_rss_feed() -> Result<impl IntoResponse, StatusCode> {
|
||||
ItemBuilder::default()
|
||||
.title(Some(post.metadata.title))
|
||||
.link(Some(format!("https://michalvanko.dev/blog/{}", post.slug)))
|
||||
// TODO Description should be just a preview
|
||||
.description(None)
|
||||
.description({
|
||||
let truncated =
|
||||
truncate_md(&post.body, 2).unwrap_or("Can't parse post body".to_string());
|
||||
let parsed_md = parse_markdown(&truncated)
|
||||
.unwrap_or("Can't process truncated post body".to_string());
|
||||
Some(parsed_md)
|
||||
})
|
||||
.content({
|
||||
let parsed_md = parse_markdown(&post.body)
|
||||
.unwrap_or("Can't process full post body".to_string());
|
||||
Some(parsed_md)
|
||||
})
|
||||
.enclosure({
|
||||
post.metadata.thumbnail.map(|src| {
|
||||
let mime_type = mime_guess::from_path(&src)
|
||||
.first()
|
||||
.map(|mime| mime.to_string())
|
||||
.unwrap_or("image".to_string());
|
||||
EnclosureBuilder::default()
|
||||
.url(src)
|
||||
.mime_type(mime_type)
|
||||
.build()
|
||||
})
|
||||
})
|
||||
.guid(Some(
|
||||
GuidBuilder::default()
|
||||
.value(format!("https://michalvanko.dev/blog/{}", post.slug))
|
||||
|
@ -56,6 +56,5 @@ async fn main() {
|
||||
// - fotos
|
||||
// THINK deploy to alula? rather then katelyn? can be change whenever
|
||||
//
|
||||
// TODO view page transitions
|
||||
// TODO cookbook
|
||||
// TODO remove m-logo-svg from justfile and mention it in some article!!! WRITE SOME NEW ARTICLES
|
||||
// TODO remove m-logo-svg from justfile and mention it in some article!!!
|
||||
|
@ -107,7 +107,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
! tailwindcss v3.4.14 | MIT License | https://tailwindcss.com
|
||||
! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -964,42 +964,42 @@ video {
|
||||
|
||||
.border-blue-300 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(130 195 247 / var(--tw-border-opacity));
|
||||
border-color: rgb(130 195 247 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.border-blue-500 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(23 137 224 / var(--tw-border-opacity));
|
||||
border-color: rgb(23 137 224 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.border-blue-950 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(11 39 70 / var(--tw-border-opacity));
|
||||
border-color: rgb(11 39 70 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.border-slate-300 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(203 213 225 / var(--tw-border-opacity));
|
||||
border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-blue-100 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity));
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-blue-50 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(241 247 254 / var(--tw-bg-opacity));
|
||||
background-color: rgb(241 247 254 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-pink-200 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 207 247 / var(--tw-bg-opacity));
|
||||
background-color: rgb(255 207 247 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.fill-blue-900 {
|
||||
@ -1140,42 +1140,42 @@ video {
|
||||
|
||||
.text-blue-500 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(23 137 224 / var(--tw-text-opacity));
|
||||
color: rgb(23 137 224 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-blue-700 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(10 86 154 / var(--tw-text-opacity));
|
||||
color: rgb(10 86 154 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-blue-900 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity));
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-blue-950 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(11 39 70 / var(--tw-text-opacity));
|
||||
color: rgb(11 39 70 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-pink-900 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(119 24 89 / var(--tw-text-opacity));
|
||||
color: rgb(119 24 89 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-pink-950 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(80 2 56 / var(--tw-text-opacity));
|
||||
color: rgb(80 2 56 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-slate-600 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(71 85 105 / var(--tw-text-opacity));
|
||||
color: rgb(71 85 105 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-slate-800 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(30 41 59 / var(--tw-text-opacity));
|
||||
color: rgb(30 41 59 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.no-underline {
|
||||
@ -1190,14 +1190,14 @@ video {
|
||||
|
||||
a {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(146 22 110 / var(--tw-text-opacity));
|
||||
color: rgb(146 22 110 / var(--tw-text-opacity, 1));
|
||||
text-decoration-line: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(23 137 224 / var(--tw-text-opacity));
|
||||
color: rgb(23 137 224 / var(--tw-text-opacity, 1));
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
||||
@ -1236,7 +1236,7 @@ strong {
|
||||
}
|
||||
h1 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity));
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
h1 {
|
||||
@ -1276,7 +1276,7 @@ strong {
|
||||
}
|
||||
h2 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity));
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
h2 {
|
||||
@ -1336,7 +1336,7 @@ strong {
|
||||
}
|
||||
h3 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity));
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
h3 {
|
||||
@ -1396,7 +1396,7 @@ strong {
|
||||
}
|
||||
h4 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity));
|
||||
color: rgb(16 62 106 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
h4 {
|
||||
@ -1450,7 +1450,7 @@ strong {
|
||||
}
|
||||
p {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(2 6 23 / var(--tw-text-opacity));
|
||||
color: rgb(2 6 23 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
p {
|
||||
@ -1530,7 +1530,7 @@ strong {
|
||||
}
|
||||
figcaption {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(12 73 128 / var(--tw-text-opacity));
|
||||
color: rgb(12 73 128 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
figcaption {
|
||||
@ -1574,7 +1574,7 @@ strong {
|
||||
}
|
||||
table {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(226 232 240 / var(--tw-border-opacity));
|
||||
border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
table {
|
||||
font-size: 0.875rem;
|
||||
@ -1600,11 +1600,11 @@ strong {
|
||||
}
|
||||
thead {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity));
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
tbody {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(248 250 252 / var(--tw-bg-opacity));
|
||||
background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
td,
|
||||
th {
|
||||
@ -1636,7 +1636,7 @@ strong {
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(241 245 249 / var(--tw-bg-opacity));
|
||||
background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
blockquote {
|
||||
margin-left: 1.5rem;
|
||||
@ -1650,11 +1650,11 @@ strong {
|
||||
}
|
||||
blockquote {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(215 34 169 / var(--tw-border-opacity));
|
||||
border-color: rgb(215 34 169 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
blockquote {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 244 253 / var(--tw-bg-opacity));
|
||||
background-color: rgb(255 244 253 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
blockquote {
|
||||
padding-top: 0.25rem;
|
||||
@ -1680,7 +1680,7 @@ strong {
|
||||
}
|
||||
p {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(71 85 105 / var(--tw-text-opacity));
|
||||
color: rgb(71 85 105 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
p {
|
||||
@ -1697,11 +1697,11 @@ strong {
|
||||
}
|
||||
:not(pre) code {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(130 195 247 / var(--tw-border-opacity));
|
||||
border-color: rgb(130 195 247 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
:not(pre) code {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity));
|
||||
background-color: rgb(225 239 253 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
:not(pre) code {
|
||||
padding-left: 0.25rem;
|
||||
@ -1717,7 +1717,7 @@ strong {
|
||||
}
|
||||
:not(pre) code {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(119 24 89 / var(--tw-text-opacity));
|
||||
color: rgb(119 24 89 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
:not(pre) code {
|
||||
@ -1785,7 +1785,7 @@ strong {
|
||||
ul,
|
||||
ol {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(2 6 23 / var(--tw-text-opacity));
|
||||
color: rgb(2 6 23 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
ul,
|
||||
@ -2003,7 +2003,7 @@ article a:visited {
|
||||
|
||||
.hover\:bg-pink-200:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 207 247 / var(--tw-bg-opacity));
|
||||
background-color: rgb(255 207 247 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.hover\:fill-blue-400:hover {
|
||||
|
Loading…
Reference in New Issue
Block a user