Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Patch image width and blur for transparency #182

Merged
merged 4 commits into from
Aug 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ date = ""
tags = [""]
categories = [""]
comments = true
removeBlur = false
[[images]]
src = ""
alt = ""
Expand Down
1 change: 1 addition & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ img,
svg,
video {
vertical-align: middle;
max-width: 100%;
}

/*
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pluralizeListTitles = false
disableLanguages = []

[markup.goldmark.renderer]
unsafe= true
unsafe = true

[outputs]
home = ["html", "json"]
Expand All @@ -26,6 +26,7 @@ disableLanguages = []
viewMorePostsLink = "/blog/"
readingTime = true
imageStretch = ""
removeBlur = false
socialShare = ["twitter", "facebook", "reddit", "linkedin", "pinterest", "email"]
hideEmptyStats = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ iframe,
img,
svg,
video {
vertical-align: middle; }
vertical-align: middle;
max-width: 100%; }

/*
* Remove default fieldset styles.
Expand Down Expand Up @@ -1154,38 +1155,38 @@ figcaption {
@media (min-width: 375px) {
.comment header {
border-radius: 0; } }
.comment header div {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
flex-grow: 1;
align-items: center; }
@media (min-width: 375px) {
.comment header div {
flex-direction: row; } }
.comment.comment-reply {
margin-left: 1.875em; }
@media (min-width: 375px) {
.comment.comment-reply {
margin-left: 3.75em; } }
.comment div {
.comment-author-container {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
flex-grow: 1;
align-items: center; }
align-items: center;
text-align: center; }
@media (min-width: 375px) {
.comment div {
flex-direction: row; } }
.comment div .comment-author-container {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
align-items: center;
text-align: center; }
@media (min-width: 375px) {
.comment div .comment-author-container {
align-items: flex-start;
flex-grow: 1; } }
@media (min-width: 768px) {
.comment div .comment-author-container {
flex-direction: row;
align-items: center; } }
.comment-author-container {
align-items: flex-start;
flex-grow: 1; } }
@media (min-width: 768px) {
.comment-author-container {
flex-direction: row;
align-items: center; } }
.comment-avatar {
margin: 0 0 0 1em;
width: 3.75em;
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{- end -}}
{{- end -}}
{{- end -}}
<a href="{{ $.Page.RelPermalink }}" class="image" style="--bg-image: url('{{ $src }}');">
<a href="{{ $.Page.RelPermalink }}" class="image"{{ if not (.Params.removeBlur | default .Site.Params.removeBlur) }} style="--bg-image: url('{{ $src }}');"{{ end }}>
<img {{ with $stretch }}class="{{ if or (eq (lower .) "vertical") (eq (lower .) "v") }}stretchV{{ else if or (eq (lower .) "horizontal") (eq (lower .) "h") }}stretchH{{ else if or (eq (lower .) "cover") (eq (lower .) "c") }}cover{{ end }}" {{ end }}src="{{ $src }}" alt="{{ $alt }}">
</a>
{{- end -}}