mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-20 18:41:53 +02:00
Merge pull request #1668 from ldericher/image-quality
✨ add parameters for finer adjustment of image quality
This commit is contained in:
commit
c18545b157
10 changed files with 19 additions and 15 deletions
|
@ -16,6 +16,7 @@ title = "Blowfish"
|
||||||
# [author]
|
# [author]
|
||||||
# name = "Your name here"
|
# name = "Your name here"
|
||||||
# image = "img/blowfish_logo.png"
|
# image = "img/blowfish_logo.png"
|
||||||
|
# imageQuality = 96
|
||||||
# headline = "I'm only human"
|
# headline = "I'm only human"
|
||||||
# bio = "A little bit about you"
|
# bio = "A little bit about you"
|
||||||
# links = [
|
# links = [
|
||||||
|
|
|
@ -17,6 +17,7 @@ enableCodeCopy = false
|
||||||
|
|
||||||
disableImageOptimization = false
|
disableImageOptimization = false
|
||||||
disableTextInHeader = false
|
disableTextInHeader = false
|
||||||
|
# backgroundImageWidth = 1200
|
||||||
|
|
||||||
# defaultBackgroundImage = "IMAGE.jpg" # used as default for background images
|
# defaultBackgroundImage = "IMAGE.jpg" # used as default for background images
|
||||||
# defaultFeaturedImage = "IMAGE.jpg" # used as default for featured images in all articles
|
# defaultFeaturedImage = "IMAGE.jpg" # used as default for featured images in all articles
|
||||||
|
|
|
@ -138,9 +138,10 @@ The default file can be used as a template to create additional languages, or re
|
||||||
|
|
||||||
#### Author
|
#### Author
|
||||||
| Name | Default | Description |
|
| Name | Default | Description |
|
||||||
| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `author.name` | _Not set_ | The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used. |
|
| `author.name` | _Not set_ | The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used. |
|
||||||
| `author.image` | _Not set_ | Path to the image file of the author. The image should be a 1:1 aspect ratio. The image can be placed in the site's `assets/` folder or can be external url. |
|
| `author.image` | _Not set_ | Path to the image file of the author. The image should be a 1:1 aspect ratio. The image can be placed in the site's `assets/` folder or can be external url. |
|
||||||
|
| `author.imageQuality` | `96` | The author's image file will be treated as a "high quality" image to minimize artifacts on the front page. Value range 1-100. |
|
||||||
| `author.headline` | _Not set_ | A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name. |
|
| `author.headline` | _Not set_ | A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name. |
|
||||||
| `author.bio` | _Not set_ | A Markdown string containing the author's bio. It will be displayed in article footers. |
|
| `author.bio` | _Not set_ | A Markdown string containing the author's bio. It will be displayed in article footers. |
|
||||||
| `author.links` | _Not set_ | The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`. |
|
| `author.links` | _Not set_ | The links to display alongside the author's details. The config file contains example links which can simply be uncommented to enable. The order that the links are displayed is determined by the order they appear in the array. Custom links can be added by providing corresponding SVG icon assets in `assets/icons/`. |
|
||||||
|
@ -179,6 +180,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
||||||
| `robots` | _Not set_ | String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values. |
|
| `robots` | _Not set_ | String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values. |
|
||||||
| `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. |
|
| `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. |
|
||||||
| `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. |
|
| `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. |
|
||||||
|
| `backgroundImageWidth` | `1200` | Width (in pixels) to scale background images to. |
|
||||||
| `disableTextInHeader` | `false` | Disables text in header, useful for logo based headers. |
|
| `disableTextInHeader` | `false` | Disables text in header, useful for logo based headers. |
|
||||||
| `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style |
|
| `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style |
|
||||||
| `defaultFeaturedImage` | _Not set_ | Default background image for all `featured` images across articles, will be overridden by a local `featured` image. |
|
| `defaultFeaturedImage` | _Not set_ | Default background image for all `featured` images across articles, will be overridden by a local `featured` image. |
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
style="background-image:url({{ .RelPermalink }});">
|
style="background-image:url({{ .RelPermalink }});">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Resize "1200x" }}
|
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
|
||||||
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
|
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
|
||||||
style="background-image:url({{ .RelPermalink }});">
|
style="background-image:url({{ .RelPermalink }});">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Resize "1200x" }}
|
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
|
||||||
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
</figure>
|
</figure>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Resize "1200x" }}
|
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
|
||||||
<figure>
|
<figure>
|
||||||
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
||||||
{{ if $caption }}
|
{{ if $caption }}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Resize "1200x" }}
|
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
|
||||||
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>{{ end }}
|
</div>{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Resize "1200x" }}
|
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
|
||||||
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
|
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
|
||||||
style="background-image:url({{ .RelPermalink }});">
|
style="background-image:url({{ .RelPermalink }});">
|
||||||
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
|
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if $authorImage }}
|
{{ if $authorImage }}
|
||||||
{{ if not $disableImageOptimization }}
|
{{ if not $disableImageOptimization }}
|
||||||
{{ $authorImage = $authorImage.Fill "288x288" }}
|
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Author.imagequality | default "96" )) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
|
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
|
||||||
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
|
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if $authorImage }}
|
{{ if $authorImage }}
|
||||||
{{ if not $disableImageOptimization }}
|
{{ if not $disableImageOptimization }}
|
||||||
{{ $authorImage = $authorImage.Fill "288x288" }}
|
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Author.imagequality | default "96" )) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
|
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
|
||||||
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
|
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if $authorImage }}
|
{{ if $authorImage }}
|
||||||
{{ if not $disableImageOptimization }}
|
{{ if not $disableImageOptimization }}
|
||||||
{{ $authorImage = $authorImage.Fill "288x288" }}
|
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Author.imagequality | default "96" )) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Author.name | default " Author" }}"
|
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Author.name | default " Author" }}"
|
||||||
src="{{ $authorImage.RelPermalink }}" />
|
src="{{ $authorImage.RelPermalink }}" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue