Skip to content

Commit

Permalink
add Markdown render hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cntrump committed Dec 24, 2019
1 parent cca1260 commit 0bf255f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -523,17 +523,20 @@ acronym {
border-bottom: 1px solid #eaecef;
}

.markdown-body .image-container,
.markdown-body figure {
text-align: center;
margin: 0 0 20px 0;
}

.markdown-body .image-container .img,
.markdown-body figure > img {
margin: 0;
border-radius: 4px;
border: 1px solid #f0f0f0;
}

.markdown-body .image-container .title,
.markdown-body figcaption > h4 {
min-width: 20%;
max-width: 80%;
Expand Down
5 changes: 5 additions & 0 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ $url := .Destination | safeURL }}
<figure class="image-container">
<img class="img" src="{{ $url }}" {{ with .Text }}alt="{{ . }}"{{ end }} />
{{ with .Title }}<figcaption><h4 class="title">{{ . | htmlUnescape }}</h4></figcaption>{{ end }}
</figure>
3 changes: 3 additions & 0 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ $url := .Destination | safeURL }}
{{ $text := .Text | htmlUnescape }}
<a href="{{ $url }}" {{ with .Title }}title="{{ . }}"{{ end }} {{ if strings.HasPrefix $url "http" }}target="_blank"{{ end }}>{{ $text }}</a>

0 comments on commit 0bf255f

Please sign in to comment.