Skip to content

Allow images in resource folder and resize for mobile#31

Open
ilja-radusch wants to merge 5 commits intohalf-duplex:mainfrom
ilja-radusch:main
Open

Allow images in resource folder and resize for mobile#31
ilja-radusch wants to merge 5 commits intohalf-duplex:mainfrom
ilja-radusch:main

Conversation

@ilja-radusch
Copy link

No description provided.

Copy link
Owner

@half-duplex half-duplex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Responsive images is something I wanted to do but never got to figuring out how.

Not-thoroughly-verified rebase: https://github.com/half-duplex/hugo-arcana/tree/image-resize

font-style:normal;
font-weight:300;
font-display:auto;
font-display:swap;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why swap? I assume responsiveness, but is it a best practice or solving a specific problem?

Comment on lines +14 to +17
{{- $breakpoints := slice 1920 1600 1366 900 600 360 -}}
{{- range $bp := $breakpoints }}
{{- if le $bp .Width }}
{{- with .Resize (printf "%dx %s" $bp $image_options) }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this exclude sizes larger than the original image?

Comment on lines +30 to +31
width="{{ .Width }}"
height="{{ .Height }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the exampleSite images from static/ to assets/ to test, this makes the front page block show a very tall left 10% of the image. Similar scale/size issues on the post list and post pages.
https://sec.gd/hugo/themes/arcana/dev/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants