Compare commits

...

4 commits

Author SHA1 Message Date
Agos95 e17b4d4ef0 refactor as fix 2023-07-19 10:46:39 +02:00
Federico Agostini ef3574d316
Merge branch 'wowchemy:main' into sticky-header 2023-07-19 09:43:21 +02:00
Christian Brueffer 92cc5a2710
feat(blocks>slider): only show prev/next arrows when more than one slide (#2949) 2023-06-18 23:14:59 +01:00
kjrstory 8b1b5ee32a
starters: add google_tag_manager and microsoft_clarity to default config (#2955) 2023-06-18 23:07:49 +01:00
12 changed files with 45 additions and 19 deletions

View file

@ -6,13 +6,16 @@
{{ $page := .wcPage }}
{{ $block := .wcBlock }}
{{ $hash_id := .wcIdentifier }}
{{ $slide_count := len $block.content.slides }}
<!-- Indicators -->
{{ if gt $slide_count 1 }}
<ol class="carousel-indicators">
{{ range $index, $item := $block.content.slides }}
<li data-target="#{{$hash_id}}" data-slide-to="{{$index}}" {{if eq $index 0}}class="active"{{end}}></li>
{{ end }}
</ol>
{{ end }}
<!-- Carousel slides wrapper -->
<div class="carousel-inner">
@ -81,6 +84,7 @@
</div>
<!-- Left and right controls -->
{{ if gt $slide_count 1 }}
<a class="carousel-control-prev" href="#{{$hash_id}}" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
<span class="sr-only">Previous</span>
@ -89,3 +93,4 @@
<span class="carousel-control-next-icon"></span>
<span class="sr-only">Next</span>
</a>
{{ end }}

View file

@ -6,13 +6,16 @@
{{ $page := .wcPage }}
{{ $block := .wcBlock }}
{{ $hash_id := .wcIdentifier }}
{{ $slide_count := len $block.Params.content.slides }}
<!-- Indicators -->
{{ if gt $slide_count 1 }}
<ol class="carousel-indicators">
{{ range $index, $item := $block.Params.content.slides }}
<li data-target="#{{$hash_id}}" data-slide-to="{{$index}}" {{if eq $index 0}}class="active"{{end}}></li>
{{ end }}
</ol>
{{ end }}
<!-- Carousel slides wrapper -->
<div class="carousel-inner">
@ -75,6 +78,7 @@
</div>
<!-- Left and right controls -->
{{ if gt $slide_count 1 }}
<a class="carousel-control-prev" href="#{{$hash_id}}" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
<span class="sr-only">Previous</span>
@ -83,3 +87,4 @@
<span class="carousel-control-next-icon"></span>
<span class="sr-only">Next</span>
</a>
{{ end }}

View file

@ -131,45 +131,43 @@
{{/* Headroom */}}
{{/*
Loading the Headroom js set the header to disappear when scrolling the page down.
So to have a sticky header, don't load the Headroom.
If you want the header to disappear, set the option to "disappear";
otherwise (sticky header), set it to any other value (eg. "sticky").
This option can be set in the following ways:
- globally, by adding in your 'params.yaml':
```
header:
sticky: true/false
on_scroll: "disappear" | "sticky"
```
- per page, by adding in the page Front Matter:
```
header:
sticky: true/false
on_scroll: "disappear" | "sticky"
```
- in order to be compatible with older versions where there was a bug, Headroom
is also disabled by setting in the page Front Matter (this is now deprecated)
- in order to be compatible with older versions where there was a bug,
the header also disappears by setting in the page Front Matter (now deprecated):
```
header.on_scroll: false
header.on_scroll: "disappear" | "sticky"
```
'false' indicates that the header disappears on scrolling (-> load Headroom)
'true' indicates that the header is sticky (-> don't load Headroom)
If the header is set to disappear, the Headroom js is loaded.
By default, the header is sticky in the homepage and in the book layout,
and disappears on scrolling in all other pages.
and it disappears when scrolling in all other pages.
*/}}
{{/* by default don't use Headroom in homepage and book layout */}}
{{ $use_headroom := not (.IsHome | or (eq .Type "book")) }}
{{/* look global site parameter 'header.sticky' true/false */}}
{{ if (isset site.Params.header "sticky") }}
{{ $use_headroom = not site.Params.header.sticky }}
{{/* look global site parameter 'header.on_scroll' */}}
{{ if (isset site.Params.header "on_scroll") }}
{{ $use_headroom = eq site.Params.header.on_scroll "disappear" }}
{{ end }}
{{/* support for old "buggy" syntax "header.on_scroll" in page parameters */}}
{{/* support for old buggy syntax "header.on_scroll" */}}
{{ if (isset $.Params "header.on_scroll") }}
{{ $use_headroom = false }}
{{ $use_headroom = eq (index $.Params "header.on_scroll") "disappear" }}
{{ end }}
{{/* look page parameter 'header.sticky' true/false */}}
{{ if (isset $.Params.header "sticky") }}
{{ $use_headroom = not $.Params.header.sticky }}
{{/* look page parameter 'header.on_scroll' */}}
{{ if (isset $.Params.header "on_scroll") }}
{{ $use_headroom = eq $.Params.header.on_scroll "disappear" }}
{{ end }}
{{ printf "<script id=\"page-data\" type=\"application/json\">%s</script>" (dict "use_headroom" $use_headroom | jsonify) | safeHTML}}

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''

View file

@ -23,6 +23,8 @@ marketing:
analytics:
google_analytics: ''
baidu_tongji: ''
google_tag_manager: ''
microsoft_clarity: ''
verification:
google: ''
baidu: ''