diff options
| author | Christine Dodrill <me@christine.website> | 2021-01-14 22:36:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-14 22:36:34 -0500 |
| commit | d2455aa1c1bfc599a07966a7d717c1380d41bbc0 (patch) | |
| tree | c2b206aa41cd6f0e13d61b5455861f09ab5d1304 /src/post | |
| parent | a359f54a91f4aeb914c69f59a02afabccd72450e (diff) | |
| download | xesite-d2455aa1c1bfc599a07966a7d717c1380d41bbc0.tar.xz xesite-d2455aa1c1bfc599a07966a7d717c1380d41bbc0.zip | |
Cache better (#296)
* Many improvements around bandwidth use
- Use ETags for RSS/Atom feeds
- Use cache-control headers
- Update to rust nightly (for rust-analyzer and faster builds)
- Limit feeds to the last 20 posts:
https://twitter.com/theprincessxena/status/1349891678857998339
- Use if-none-match to limit bandwidth further
Also does this:
- bump go_vanity to 0.3.0 and lets users customize the branch name
- fix formatting on jsonfeed
- remove last vestige of kubernetes/docker support
Signed-off-by: Christine Dodrill <me@christine.website>
* expire cache quicker for dynamic pages
Signed-off-by: Christine Dodrill <me@christine.website>
* add rss ttl
Signed-off-by: Christine Dodrill <me@christine.website>
* add blogpost
Signed-off-by: Christine Dodrill <me@christine.website>
Diffstat (limited to 'src/post')
| -rw-r--r-- | src/post/frontmatter.rs | 7 | ||||
| -rw-r--r-- | src/post/mod.rs | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/post/frontmatter.rs b/src/post/frontmatter.rs index 615f2c5..f2c1587 100644 --- a/src/post/frontmatter.rs +++ b/src/post/frontmatter.rs @@ -1,7 +1,6 @@ /// This code was borrowed from @fasterthanlime. - -use color_eyre::eyre::{Result}; -use serde::{Serialize, Deserialize}; +use color_eyre::eyre::Result; +use serde::{Deserialize, Serialize}; #[derive(Eq, PartialEq, Deserialize, Default, Debug, Serialize, Clone)] pub struct Data { @@ -81,7 +80,7 @@ impl Data { }; } } - _ => panic!("Expected newline, got {:?}",), + _ => panic!("Expected newline, got {:?}", ch), }, State::ReadingFrontMatter { buf, line_start } => match ch { '-' if *line_start => { diff --git a/src/post/mod.rs b/src/post/mod.rs index 79affbc..eb8ee54 100644 --- a/src/post/mod.rs +++ b/src/post/mod.rs @@ -20,7 +20,6 @@ impl Into<jsonfeed::Item> for Post { let mut result = jsonfeed::Item::builder() .title(self.front_matter.title) .content_html(self.body_html) - .content_text(self.body) .id(format!("https://christine.website/{}", self.link)) .url(format!("https://christine.website/{}", self.link)) .date_published(self.date.to_rfc3339()) |
