diff --git a/config/_default/params.toml b/config/_default/params.toml
index 0fb4b228..04682387 100644
--- a/config/_default/params.toml
+++ b/config/_default/params.toml
@@ -37,7 +37,7 @@ table_of_content = true
# copyright
theme_copyright = false
-copyright = "The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [**Trademark Usage**.](https://www.linuxfoundation.org/legal/trademark-usage)
**Microcks** is a [**Cloud Native Computing Incubating**](https://landscape.cncf.io/?selected=microcks&item=app-definition-and-development--application-definition-image-build--microcks) project 🚀"
+copyright = "Copyright © {year} The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [**Trademark Usage**.](https://www.linuxfoundation.org/legal/trademark-usage)
**Microcks** is a [**Cloud Native Computing Incubating**](https://landscape.cncf.io/?selected=microcks&item=app-definition-and-development--application-definition-image-build--microcks) project 🚀"
# Preloader
[preloader]
diff --git a/themes/microcks/assets/js/script.js b/themes/microcks/assets/js/script.js
index c32615b8..79a8ebe9 100644
--- a/themes/microcks/assets/js/script.js
+++ b/themes/microcks/assets/js/script.js
@@ -180,7 +180,7 @@ window.onscroll = function () {
window.onload = function () {
let masonryWrapper = document.querySelector('.masonry-wrapper');
// if masonryWrapper is not null, then initialize masonry
- if (masonryWrapper) {
+ if (masonryWrapper && typeof Masonry !== 'undefined') {
let masonry = new Masonry(masonryWrapper, {
columnWidth: 1
});
diff --git a/themes/microcks/layouts/_default/index.json b/themes/microcks/layouts/_default/index.json
index 0f428763..54b754ce 100644
--- a/themes/microcks/layouts/_default/index.json
+++ b/themes/microcks/layouts/_default/index.json
@@ -1,36 +1,32 @@
-{{- $len := sub (len (.Pages.GroupBy "Section")) 1 -}}
-[{{- range $item, $el := .Pages.GroupBy "Section" -}}
-{{- range $i, $e := .Pages -}}
-{{- if and (not .Params.ignoreSearch) (ne $e.Type "json") -}}
- {
- "section": "",
- "url": "{{ $e.Permalink }}",
- "title": "{{ with $e.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $e.Title}}{{end}}",
- "description": "{{ htmlEscape .Description}}",
- "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
- "content": {{$e.Plain | jsonify}}
- }{{- if eq $item $len -}}{{- else -}},{{- end -}}
-{{- end -}}
-
-{{- if .Section -}}
-{{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}}
-{{- $sectionLen := len (where site.Pages "Section" .Section) -}}
-{{- $sectionLenTotal := sub $sectionLen 2 -}}
-
-{{- range $index, $page := $section -}}
-{{- if and (not .Params.ignoreSearch) (ne $page.Type "json") -}}
- {
- "section": "{{$page.Section | humanize}}",
- "url": "{{ $page.Permalink }}",
- "title": "{{ with $page.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $page.Title}}{{end}}",
- "description": "{{ htmlEscape .Description}}",
- "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
- "content": {{$page.Plain | jsonify}}
- }{{- if eq $item $len -}}{{- if ne $index $sectionLenTotal -}},{{- end -}}{{- else -}},{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{- end -}}
+{{- $.Scratch.Delete "search_index" -}}
+{{- range $item, $el := .Pages.GroupBy "Section" -}}
+ {{- range $i, $e := .Pages -}}
+ {{- if and (not $e.Params.ignoreSearch) (ne $e.Type "json") -}}
+ {{- $title := $e.Title -}}
+ {{- if $e.Params.bannertext -}}
+ {{- $title = $e.Params.bannertext -}}
+ {{- end -}}
+ {{- $entry := dict "section" "" "url" $e.Permalink "title" (htmlEscape $title) "description" (htmlEscape $e.Description) "searchKeyword" (htmlEscape $e.Params.searchKeyword) "content" $e.Plain -}}
+ {{- $.Scratch.Add "search_index" (slice $entry) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if .Section -}}
+ {{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}}
+ {{- range $index, $page := $section -}}
+ {{- if and (not $page.Params.ignoreSearch) (ne $page.Type "json") -}}
+ {{- $title := $page.Title -}}
+ {{- if $page.Params.bannertext -}}
+ {{- $title = $page.Params.bannertext -}}
+ {{- end -}}
+ {{- $entry := dict "section" ($page.Section | humanize) "url" $page.Permalink "title" (htmlEscape $title) "description" (htmlEscape $page.Description) "searchKeyword" (htmlEscape $page.Params.searchKeyword) "content" $page.Plain -}}
+ {{- $.Scratch.Add "search_index" (slice $entry) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
{{- end -}}
-{{- end -}}]
\ No newline at end of file
+{{- with $.Scratch.Get "search_index" -}}
+ {{- . | jsonify -}}
+{{- else -}}
+ []
+{{- end -}}
\ No newline at end of file
diff --git a/themes/microcks/layouts/documentation/index.json b/themes/microcks/layouts/documentation/index.json
index 25fe5c79..54b754ce 100644
--- a/themes/microcks/layouts/documentation/index.json
+++ b/themes/microcks/layouts/documentation/index.json
@@ -1,36 +1,32 @@
-{{- $len := sub (len (.Pages.GroupBy "Section")) 1 -}}
-[{{- range $item, $el := .Pages.GroupBy "Section" -}}
-{{- range $i, $e := .Pages -}}
-{{- if and (not .Params.ignoreSearch) (ne $e.Type "json") -}}
- {
- "section": "",
- "url": "{{ $e.Permalink }}",
- "title": "{{ with $e.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $e.Title}}{{end}}",
- "description": "{{ htmlEscape .Description}}",
- "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
- "content": {{$e.Plain | jsonify}}
- },
-{{- end -}}
-
-{{- if .Section -}}
-{{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}}
-{{- $sectionLen := len (where site.Pages "Section" .Section) -}}
-{{- $sectionLenTotal := sub $sectionLen 2 -}}
-
-{{- range $index, $page := $section -}}
-{{- if and (not .Params.ignoreSearch) (ne $page.Type "json") -}}
- {
- "section": "{{$page.Section | humanize}}",
- "url": "{{ $page.Permalink }}",
- "title": "{{ with $page.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $page.Title}}{{end}}",
- "description": "{{ htmlEscape .Description}}",
- "searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
- "content": {{$page.Plain | jsonify}}
- }{{- if eq $item $len -}}{{- if ne $index $sectionLenTotal -}},{{- end -}}{{- else -}},{{- end -}}
-{{- end -}}
-{{- end -}}
-
-{{- end -}}
+{{- $.Scratch.Delete "search_index" -}}
+{{- range $item, $el := .Pages.GroupBy "Section" -}}
+ {{- range $i, $e := .Pages -}}
+ {{- if and (not $e.Params.ignoreSearch) (ne $e.Type "json") -}}
+ {{- $title := $e.Title -}}
+ {{- if $e.Params.bannertext -}}
+ {{- $title = $e.Params.bannertext -}}
+ {{- end -}}
+ {{- $entry := dict "section" "" "url" $e.Permalink "title" (htmlEscape $title) "description" (htmlEscape $e.Description) "searchKeyword" (htmlEscape $e.Params.searchKeyword) "content" $e.Plain -}}
+ {{- $.Scratch.Add "search_index" (slice $entry) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if .Section -}}
+ {{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}}
+ {{- range $index, $page := $section -}}
+ {{- if and (not $page.Params.ignoreSearch) (ne $page.Type "json") -}}
+ {{- $title := $page.Title -}}
+ {{- if $page.Params.bannertext -}}
+ {{- $title = $page.Params.bannertext -}}
+ {{- end -}}
+ {{- $entry := dict "section" ($page.Section | humanize) "url" $page.Permalink "title" (htmlEscape $title) "description" (htmlEscape $page.Description) "searchKeyword" (htmlEscape $page.Params.searchKeyword) "content" $page.Plain -}}
+ {{- $.Scratch.Add "search_index" (slice $entry) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
{{- end -}}
-{{- end -}}]
\ No newline at end of file
+{{- with $.Scratch.Get "search_index" -}}
+ {{- . | jsonify -}}
+{{- else -}}
+ []
+{{- end -}}
\ No newline at end of file
diff --git a/themes/microcks/layouts/partials/footer.html b/themes/microcks/layouts/partials/footer.html
index b3ddde40..30e311a2 100644
--- a/themes/microcks/layouts/partials/footer.html
+++ b/themes/microcks/layouts/partials/footer.html
@@ -59,7 +59,7 @@