Skip to content
Snippets Groups Projects
Commit 53af2625 authored by Stephen D's avatar Stephen D
Browse files

link for rss

parent 4ea3f439
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
id="RSSicon"
viewBox="0 0 8 8" width="256" height="256">
<title>RSS feed icon</title>
<style type="text/css">
.button {stroke: none; fill: orange;}
.symbol {stroke: none; fill: white;}
</style>
<rect class="button" width="8" height="8" rx="1.5" />
<circle class="symbol" cx="2" cy="6" r="1" />
<path class="symbol" d="m 1,4 a 3,3 0 0 1 3,3 h 1 a 4,4 0 0 0 -4,-4 z" />
<path class="symbol" d="m 1,2 a 5,5 0 0 1 5,5 h 1 a 6,6 0 0 0 -6,-6 z" />
</svg>
\ No newline at end of file
......@@ -47,7 +47,7 @@ impl Blog {
let description = &self.config.description;
let mut content = format!(
r#"<div class="centered"><h1>{name}</h1>{description}</div><h2>Recent Posts</h2><table>"#
r#"<div class="centered"><h1>{name}</h1>{description}</div><h2>Recent Posts <a href="/posts.rss"><img src="/rss.svg" width="16em" /></a></h2><table>"#
);
for post in &self.posts {
......@@ -168,6 +168,11 @@ impl TryFrom<Blog> for RenderedBlog {
}
insert_path(&mut pages, "/posts.rss", Response::rss(b.rss()?))?;
insert_path(
&mut pages,
"/rss.svg",
Response::svg(include_bytes!("assets/rss.svg").to_vec()),
)?;
let not_found =
Response::html(b.dress_page(Some("Page not found"), include_str!("assets/404.html")));
......
......@@ -64,4 +64,12 @@ impl Response {
data,
}
}
pub fn svg(data: Vec<u8>) -> Self {
Self {
content_type: "image/svg+xml",
expiry: Expiry::Year,
data,
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment