Skip to content

Commit

Permalink
Render image as <figure> with <figcaption>
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Aug 23, 2024
1 parent add2a27 commit 1a0bab8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 23 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ edition = "2021"
axum = "0.7"
axum-login = "0.15"
chrono = { version = "0.4", features = ["serde"] }
comrak = { version = "0.27", features = ["syntect"] }
comrak = { git = "https://github.com/kivikakk/comrak", rev = "e30dd1e9b792a6743fe99c243f9a49b49832c4e6", features = [
"syntect",
] }
minijinja = { version = "2.1", features = ["loader"] }
password-auth = "1.0.0"
rand = "0.8"
Expand Down
1 change: 1 addition & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl AppState {
let mut options = Options::default();
options.extension.strikethrough = true;
options.extension.autolink = true;
options.render.figure_with_caption = true;
// enable the syntax highlight adapter.
let mut plugins = Plugins::default();
let adapter = syntect::SyntectAdapterBuilder::new()
Expand Down
5 changes: 0 additions & 5 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,6 @@ table {
word-break: break-word;
}

#content .post article p img {
display: block;
margin: auto;
}

#content .post .tags {
display: inline;
color: gray;
Expand Down
20 changes: 3 additions & 17 deletions static/css/yue.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
outline: 0;
margin: 10px 0 30px;
padding: 0;
min-height: 100px;
}

.yue figure img {
Expand Down Expand Up @@ -288,24 +287,11 @@
}

.yue figure img {
margin: 0 0 4px;
}

.yue figure figcaption:before {
width: 25%;
margin-left: 75%;
border-top: 1px solid #dededc;
display: block;
content: "";
margin-bottom: 10px;
margin: auto;
}

.yue figure figcaption {
position: absolute;
left: -172px;
width: 150px;
top: 0;
text-align: right;
margin-top: 0;
position: relative;
width: 100%;
}
}

0 comments on commit 1a0bab8

Please sign in to comment.