Skip to content

Commit

Permalink
Added support for syntax for image titles
Browse files Browse the repository at this point in the history
  • Loading branch information
chollinger93 committed Jun 29, 2021
1 parent 7bbf2b3 commit b7cb50a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ As well as some additional **features**:
- Added random footer messages
- Added "Edit this on GitHub" button
- Added `inlineimg` shortcode to render images (e.g. SVGs) in-line
- Added support for `![](image title="title")` syntax for image titles
- Random, somewhat humorous messages at the end of each post

And some **bugfixes**:
Expand Down
8 changes: 8 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ if .Title }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" class="figcaption-img">
<figcaption>{{ .Title }}</figcaption>
</figure>
{{ else }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}">
{{ end }}
11 changes: 11 additions & 0 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,15 @@ ul {
margin: 0 0 0 0 !important;
max-width: 100%;
display: inline-block !important;
}

.figcaption-img {
margin-bottom: 0px;
}

figcaption {
font-size: 0.9rem;
display: block;
text-align: center;
color: gray;
}

0 comments on commit b7cb50a

Please sign in to comment.