Compare commits
2 commits
c1e1670db3
...
bd7823dc14
Author | SHA1 | Date | |
---|---|---|---|
bd7823dc14 | |||
516e791ad6 |
3 changed files with 6 additions and 1 deletions
|
@ -141,7 +141,7 @@ impl Default for CacheConfig {
|
||||||
pub async fn load() -> Result<Config> {
|
pub async fn load() -> Result<Config> {
|
||||||
let config_file = env::var(format!(
|
let config_file = env::var(format!(
|
||||||
"{}_CONFIG",
|
"{}_CONFIG",
|
||||||
env!("CARGO_BIN_NAME").to_uppercase().replace("-", "_")
|
env!("CARGO_BIN_NAME").to_uppercase().replace('-', "_")
|
||||||
))
|
))
|
||||||
.unwrap_or(String::from("config.toml"));
|
.unwrap_or(String::from("config.toml"));
|
||||||
match tokio::fs::OpenOptions::new()
|
match tokio::fs::OpenOptions::new()
|
||||||
|
|
|
@ -56,6 +56,7 @@ struct IndexTemplate {
|
||||||
title: String,
|
title: String,
|
||||||
description: String,
|
description: String,
|
||||||
posts: Vec<PostMetadata>,
|
posts: Vec<PostMetadata>,
|
||||||
|
rss: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
|
@ -87,6 +88,7 @@ async fn index(
|
||||||
title: state.config.title.clone(),
|
title: state.config.title.clone(),
|
||||||
description: state.config.description.clone(),
|
description: state.config.description.clone(),
|
||||||
posts,
|
posts,
|
||||||
|
rss: state.config.rss.enable,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
<meta property="og:description" content="{{ description }}" />
|
<meta property="og:description" content="{{ description }}" />
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link rel="stylesheet" href="/static/style.css" />
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
|
{% if rss %}
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="{{ title }}" href="/feed.xml" />
|
||||||
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
|
|
Loading…
Reference in a new issue