metamuffin's personal website


About 1751008311639 milliseconds have passed since midnight of the january the first in 1970.
------------------------------------------------------
}



======================================
    Contents of "blog/atom.rs"
======================================
use super::{
    helper::{get_articles, ArticleMeta},
    rocket_uri_macro_r_blog_article, rocket_uri_macro_r_blog_index, ARTICLE_ROOT,
};
use crate::{error::MyResult, uri};
use rocket::get;
use std::{path::PathBuf, str::FromStr};

#[get("/blog/feed.atom")]
pub async fn r_blog_atom() -> MyResult<String> {
    let entries = get_articles(&PathBuf::from_str(ARTICLE_ROOT).unwrap())
        .await?
        .iter()
        .map(
            |ArticleMeta {
                 title,
                 date,
                 canonical_name,
                 ..
             }| {
                let title = horrible_escape_function(title);
                let datetime = iso8601::DateTime {
                    date: date.clone(),