mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 04:35:31 -04:00
set max width of pages in Hugo config.toml, retrieve value from SCSS
https://gohugo.io/hugo-pipes/resource-from-template/
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{{ $original := .Page.Resources.GetMatch (.Get "src") }}
|
||||
{{ .Scratch.Set "image" $original }}
|
||||
|
||||
{{ $setWidth := 910 }}
|
||||
{{ $setWidth := .Site.Params.pageMaxWidth }}
|
||||
|
||||
{{ if .Get "width" }}
|
||||
{{ $setWidth = (int (.Get "width")) }}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<amp-video
|
||||
layout="responsive"
|
||||
width="{{ with .Get "width" }}{{ . }}{{ else }}910{{ end }}"
|
||||
width="{{ with .Get "width" }}{{ . }}{{ else }}{{ .Site.Params.pageMaxWidth }}{{ end }}"
|
||||
height="{{ with .Get "height" }}{{ . }}{{ else }}600{{ end }}"
|
||||
{{- with .Page.Resources.GetMatch (.Get "poster") }} poster="{{ .Permalink }}"{{ end }}
|
||||
{{- if .Get "autoplay" }} autoplay{{ end }}
|
||||
|
Reference in New Issue
Block a user