add alt text
This commit is contained in:
parent
cee11ba07a
commit
a8a1dca444
4 changed files with 17 additions and 9 deletions
17
README.md
17
README.md
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: "README"
|
||||
description: "the README.md file of this project"
|
||||
author: "slonkazoid"
|
||||
title: README
|
||||
description: the README.md file of this project
|
||||
author: slonkazoid
|
||||
created_at: 2024-04-18T04:15:26+03:00
|
||||
---
|
||||
|
||||
|
@ -15,7 +15,7 @@ blazingly fast markdown blog software written in rust memory safe
|
|||
- [x] finish writing this document
|
||||
- [x] document config
|
||||
- [ ] blog thumbnail and favicon
|
||||
- [ ] alt text for post icon
|
||||
- [x] alt text for post icon
|
||||
- [ ] extend syntect options
|
||||
- [ ] general cleanup of code
|
||||
- [ ] better error reporting and error pages
|
||||
|
@ -133,10 +133,11 @@ full example:
|
|||
|
||||
```md
|
||||
---
|
||||
title: "My first post" # title of the post
|
||||
description: "The first post on this awesome blog!" # short description of the post
|
||||
author: "Blubber256" # author of the post
|
||||
icon: "/media/first-post/icon.png" # icon/thumbnail of post used in embeds
|
||||
title: My first post # title of the post
|
||||
description: The first post on this awesome blog! # short description of the post
|
||||
author: Blubber256 # author of the post
|
||||
icon: /media/first-post/icon.png # icon/thumbnail of post used in embeds
|
||||
icon_alt: Picture of a computer running DOOM
|
||||
color: "#00aacc" # color of post, also used in embeds
|
||||
created_at: 2024-04-18T04:15:26+03:00 # date of writing, this is highly
|
||||
# recommended if you are on a system which doesnt have btime (like musl),
|
||||
|
|
|
@ -27,6 +27,7 @@ struct FrontMatter {
|
|||
pub description: String,
|
||||
pub author: String,
|
||||
pub icon: Option<String>,
|
||||
pub icon_alt: Option<String>,
|
||||
pub color: Option<String>,
|
||||
pub created_at: Option<DateTime<Utc>>,
|
||||
pub modified_at: Option<DateTime<Utc>>,
|
||||
|
@ -47,6 +48,7 @@ impl FrontMatter {
|
|||
description: self.description,
|
||||
author: self.author,
|
||||
icon: self.icon,
|
||||
icon_alt: self.icon_alt,
|
||||
color: self.color,
|
||||
created_at: self.created_at.or_else(|| created.map(|t| t.into())),
|
||||
modified_at: self.modified_at.or_else(|| modified.map(|t| t.into())),
|
||||
|
|
|
@ -17,7 +17,7 @@ pub struct PostMetadata {
|
|||
pub description: String,
|
||||
pub author: String,
|
||||
pub icon: Option<String>,
|
||||
//pub icon_alt: Option<String>,
|
||||
pub icon_alt: Option<String>,
|
||||
pub color: Option<String>,
|
||||
pub created_at: Option<DateTime<Utc>>,
|
||||
pub modified_at: Option<DateTime<Utc>>,
|
||||
|
|
|
@ -18,6 +18,11 @@
|
|||
<meta property="og:image" content="{{ url }}" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:image:src" content="{{ url }}" />
|
||||
{% match meta.icon_alt %} {% when Some with (alt) %}
|
||||
<meta property="og:image:alt" content="{{ alt }}" />
|
||||
<meta property="twitter:image:alt" content="{{ alt }}" />
|
||||
{% when None %} {% endmatch %}
|
||||
<!-- prettier-br -->
|
||||
{% when None %} {% endmatch %}
|
||||
<!-- prettier is annoying -->
|
||||
{% match color %} {% when Some with (color) %}
|
||||
|
|
Loading…
Reference in a new issue