Skip to content

Commit

Permalink
doc: fix SVG example, improve data
Browse files Browse the repository at this point in the history
  • Loading branch information
bowman2001 committed Jan 6, 2024
1 parent 8e373b4 commit 36dbbbe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions data/modImg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ missing: mod-img/missing.svg
errorLevel: warning
unsplash: false
svg:
defaultType: contain
defaultType: symbol
maxInline: 8192

srcset:
sizeStep: 30 # In percent
maxDensityFactor: 2.61
maxDensityFactor: 2.6
quality: 85
qualityReductionFactor: 25
lqip:
Expand Down
1 change: 0 additions & 1 deletion exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ resources:
padding: one
background: light
box: shadow
ratio: 1
- src: small_portrait.jpg
name: portrait
params:
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/data/modImg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ container:
type:
name: Type
prefix: t-
options: [contain]
options: [symbol, none]

figure:
base: "fig"
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/mod-img/func/params/collect/attributes.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{/* Context: parameter map */}}
{{ $imgMap := . }}

{{ $params := dict }}

{{ $svgDefaultType := site.Data.modImg.svg.defaultType | default "symbol" }}

{{ with .params }}
{{ if (or .svgstr (eq $.img.MediaType.SubType "svg")) -}}
{{ if (or .svgstr (eq $imgMap.img.MediaType.SubType "svg")) -}}
{{ $params = merge $params (dict (slice "contClass" "type") $svgDefaultType ) }}
{{ end }}

Expand Down

0 comments on commit 36dbbbe

Please sign in to comment.