Skip to content
Open
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
5 changes: 4 additions & 1 deletion config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ disqusShortname = "microcks-io"
#hasCJKLanguage = true # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content.
hasCJKLanguage = false

# Increase Hugo build timeout to prevent aborts during heavy image processing
timeout = "300s"

############################# Modules ############################
[module]
[[module.mounts]]
Expand Down Expand Up @@ -61,7 +64,7 @@ home = ["HTML", "RSS", "JSON", "WebAppManifest"]
# See https://github.com/disintegration/imaging
# Default JPEG or WebP quality setting. Default is 75.
quality = 90
resampleFilter = "lanczos"
resampleFilter = "Lanczos"

############################# Caches ###############################
[caches]
Expand Down
27 changes: 27 additions & 0 deletions layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- $src := .Get "src" -}} {{- $alt := .Get "alt" | default "" -}} {{- $width :=
.Get "width" -}} {{- $height := .Get "height" -}} {{- $sizes := .Get "sizes" |
default "(max-width: 800px) 100vw, 800px" -}} {{- /* For real responsive images,
you would generate resized versions. Here, we use the same src for all for
simplicity. */ -}} {{- $srcset := printf "%s 400w, %s 800w, %s 1200w" $src $src
$src -}}
<img
src="{{ $src }}"
alt="{{ $alt }}"
{{
with
$width
}}width="{{ . }}"
{{
end
}}
{{
with
$height
}}height="{{ . }}"
{{
end
}}
srcset="{{ $srcset }}"
sizes="{{ $sizes }}"
loading="lazy"
/>
17 changes: 17 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[build]
publish = "public"
command = "npm run build"

[context.deploy-preview]
command = "npm run build"

[context.branch-deploy]
command = "npm run build"

[context.production]
command = "npm run build"

[context.production.environment]
HUGO_BASEURL = "https://microcks.io/"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"