add more more
This commit is contained in:
parent
8e4369fa99
commit
98da093ec2
3 changed files with 13 additions and 4 deletions
|
@ -17,6 +17,7 @@ pub struct Config {
|
||||||
pub TWITTER_BASE_URL: Url,
|
pub TWITTER_BASE_URL: Url,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
pub description: String,
|
pub description: String,
|
||||||
|
pub color: String,
|
||||||
pub db_url: Option<String>,
|
pub db_url: Option<String>,
|
||||||
pub json: bool,
|
pub json: bool,
|
||||||
}
|
}
|
||||||
|
@ -30,6 +31,7 @@ impl Default for Config {
|
||||||
TWITTER_BASE_URL: Url::parse("https://x.com/").unwrap(),
|
TWITTER_BASE_URL: Url::parse("https://x.com/").unwrap(),
|
||||||
title: "biter".into(),
|
title: "biter".into(),
|
||||||
description: "biter twitter proxy".into(),
|
description: "biter twitter proxy".into(),
|
||||||
|
color: "#f5c2e7".into(),
|
||||||
db_url: None,
|
db_url: None,
|
||||||
json: false,
|
json: false,
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ struct IndexTemplate<'a> {
|
||||||
#[template(path = "display_tweet.html")]
|
#[template(path = "display_tweet.html")]
|
||||||
struct TweetTemplate<'a> {
|
struct TweetTemplate<'a> {
|
||||||
title: &'a str,
|
title: &'a str,
|
||||||
|
color: &'a str,
|
||||||
author: String,
|
author: String,
|
||||||
author_url: String,
|
author_url: String,
|
||||||
url: String,
|
url: String,
|
||||||
|
@ -156,6 +157,7 @@ async fn tweet<'a>(
|
||||||
|
|
||||||
Ok(TweetTemplate {
|
Ok(TweetTemplate {
|
||||||
title: &config.title,
|
title: &config.title,
|
||||||
|
color: &config.color,
|
||||||
author: post.name,
|
author: post.name,
|
||||||
author_url: {
|
author_url: {
|
||||||
let mut url = config.TWITTER_BASE_URL.clone();
|
let mut url = config.TWITTER_BASE_URL.clone();
|
||||||
|
|
|
@ -3,20 +3,25 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta
|
|
||||||
name="description"
|
|
||||||
content="Tweet by {{ author }} - {{ title }}"
|
|
||||||
/>
|
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content="Tweet by {{ author }} - {{ title }}"
|
content="Tweet by {{ author }} - {{ title }}"
|
||||||
/>
|
/>
|
||||||
|
<meta
|
||||||
|
property="twitter:title"
|
||||||
|
content="Tweet by {{ author }} - {{ title }}"
|
||||||
|
/>
|
||||||
<meta property="og:description" content="{{ content }}" />
|
<meta property="og:description" content="{{ content }}" />
|
||||||
|
<meta property="twitter:description" content="{{ content }}" />
|
||||||
{% match image %} {% when Some with (link) %}
|
{% match image %} {% when Some with (link) %}
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta property="og:image" content="{{ link }}" />
|
<meta property="og:image" content="{{ link }}" />
|
||||||
|
<meta property="twitter:image:src" content="{{ link }}" />
|
||||||
{% match alt %} {% when Some with (text) %}
|
{% match alt %} {% when Some with (text) %}
|
||||||
<meta property="og:image:alt" content="{{ text }}" />
|
<meta property="og:image:alt" content="{{ text }}" />
|
||||||
|
<meta property="twitter:image:alt" content="{{ text }}" />
|
||||||
{% when None %} {% endmatch %} {% when None %} {% endmatch %}
|
{% when None %} {% endmatch %} {% when None %} {% endmatch %}
|
||||||
|
<meta name="theme-color" content="{{ color }}" />
|
||||||
<title>Tweet by {{ author }} - {{ title }}</title>
|
<title>Tweet by {{ author }} - {{ title }}</title>
|
||||||
<link rel="stylesheet" href="/static/style.css" />
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
<link rel="stylesheet" href="/static/tweet.css" />
|
<link rel="stylesheet" href="/static/tweet.css" />
|
||||||
|
|
Loading…
Reference in a new issue