Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Org Flux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
Org Flux
Commits
53af2625
Commit
53af2625
authored
2 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
link for rss
parent
4ea3f439
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/assets/rss.svg
+18
-0
18 additions, 0 deletions
src/assets/rss.svg
src/blog.rs
+6
-1
6 additions, 1 deletion
src/blog.rs
src/resp.rs
+8
-0
8 additions, 0 deletions
src/resp.rs
with
32 additions
and
1 deletion
src/assets/rss.svg
0 → 100644
+
18
−
0
View file @
53af2625
<?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
This diff is collapsed.
Click to expand it.
src/blog.rs
+
6
−
1
View file @
53af2625
...
...
@@ -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"
)));
...
...
This diff is collapsed.
Click to expand it.
src/resp.rs
+
8
−
0
View file @
53af2625
...
...
@@ -64,4 +64,12 @@ impl Response {
data
,
}
}
pub
fn
svg
(
data
:
Vec
<
u8
>
)
->
Self
{
Self
{
content_type
:
"image/svg+xml"
,
expiry
:
Expiry
::
Year
,
data
,
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment