From fa9827b726b5e7a181337bfd7b27f36a9582d340 Mon Sep 17 00:00:00 2001 From: Geo Date: Thu, 24 Mar 2022 19:11:49 +0000 Subject: [PATCH] feat: autodetect Isotope usage Remove Params.extensions.isotope.enable --- starters/academic/config/_default/params.yaml | 3 --- starters/blog/config/_default/params.yaml | 3 --- starters/course/config/_default/params.yaml | 3 --- starters/minimal/config/_default/params.yaml | 3 --- starters/portfolio/config/_default/params.yaml | 3 --- starters/research-group/config/_default/params.yaml | 3 --- wowchemy/layouts/partials/site_js.html | 3 +-- wowchemy/layouts/partials/widgets/portfolio.html | 3 +++ wowchemy/layouts/section/publication.html | 3 +++ 9 files changed, 7 insertions(+), 20 deletions(-) diff --git a/starters/academic/config/_default/params.yaml b/starters/academic/config/_default/params.yaml index 7046b850..69717bba 100644 --- a/starters/academic/config/_default/params.yaml +++ b/starters/academic/config/_default/params.yaml @@ -101,8 +101,5 @@ extensions: cms: branch: master local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: true academicons: enable: true diff --git a/starters/blog/config/_default/params.yaml b/starters/blog/config/_default/params.yaml index 7a87e401..93bba069 100644 --- a/starters/blog/config/_default/params.yaml +++ b/starters/blog/config/_default/params.yaml @@ -96,8 +96,5 @@ extensions: cms: branch: main local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: false academicons: enable: false diff --git a/starters/course/config/_default/params.yaml b/starters/course/config/_default/params.yaml index a77d038d..9e63c001 100644 --- a/starters/course/config/_default/params.yaml +++ b/starters/course/config/_default/params.yaml @@ -91,8 +91,5 @@ extensions: cms: branch: main local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: true academicons: enable: false diff --git a/starters/minimal/config/_default/params.yaml b/starters/minimal/config/_default/params.yaml index a6644985..35328c7b 100644 --- a/starters/minimal/config/_default/params.yaml +++ b/starters/minimal/config/_default/params.yaml @@ -96,8 +96,5 @@ extensions: cms: branch: main local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: false academicons: enable: false diff --git a/starters/portfolio/config/_default/params.yaml b/starters/portfolio/config/_default/params.yaml index 5c582c12..b69a6fc8 100644 --- a/starters/portfolio/config/_default/params.yaml +++ b/starters/portfolio/config/_default/params.yaml @@ -96,8 +96,5 @@ extensions: cms: branch: main local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: true academicons: enable: false diff --git a/starters/research-group/config/_default/params.yaml b/starters/research-group/config/_default/params.yaml index e0834969..69e54886 100644 --- a/starters/research-group/config/_default/params.yaml +++ b/starters/research-group/config/_default/params.yaml @@ -101,9 +101,6 @@ extensions: cms: branch: main local_backend: false - isotope: - # Enable if you use the Portfolio widget or Publication filter - enable: true academicons: enable: true diff --git a/wowchemy/layouts/partials/site_js.html b/wowchemy/layouts/partials/site_js.html index 7623d1b0..e365171d 100644 --- a/wowchemy/layouts/partials/site_js.html +++ b/wowchemy/layouts/partials/site_js.html @@ -17,8 +17,7 @@ {{ if not ($scr.Get "use_cdn") }} {{ else }} - {{ $require_isotope := .Params.require_isotope | default site.Params.extensions.isotope.enable | default false }} - {{ if $require_isotope }} + {{ if .Page.Store.Get "has_isotope" }} {{ printf "" (printf $js.imagesLoaded.url $js.imagesLoaded.version) $js.imagesLoaded.sri | safeHTML }} {{ printf "" (printf $js.isotope.url $js.isotope.version) $js.isotope.sri | safeHTML }} {{ end }} diff --git a/wowchemy/layouts/partials/widgets/portfolio.html b/wowchemy/layouts/partials/widgets/portfolio.html index 2acca632..0fd360ed 100644 --- a/wowchemy/layouts/partials/widgets/portfolio.html +++ b/wowchemy/layouts/partials/widgets/portfolio.html @@ -6,6 +6,9 @@ {{ $columns := $st.Params.design.columns | default "2" }} {{ $view := $st.Params.design.view | default "masonry" }} +{{/* Require Isotope */}} +{{ $.Page.Store.Set "has_isotope" true }} +
{{ with $st.Content }}{{ . }}{{ end }} diff --git a/wowchemy/layouts/section/publication.html b/wowchemy/layouts/section/publication.html index c4e98e43..797a4ff8 100644 --- a/wowchemy/layouts/section/publication.html +++ b/wowchemy/layouts/section/publication.html @@ -1,5 +1,8 @@ {{- define "main" -}} +{{/* Require Isotope */}} +{{ $.Page.Store.Set "has_isotope" true }} + {{ partial "page_header.html" . }}