diff --git a/layouts/_default/list.js.js b/layouts/_default/list.js.js new file mode 100644 index 0000000..8c4a03d --- /dev/null +++ b/layouts/_default/list.js.js @@ -0,0 +1,4 @@ +function showMomentCount() { {{ $a := where $.Site.RegularPages "Section" .Section}}{{ if .IsHome }}{{ $a = $.Site.RegularPages }}{{ end }} + document.getElementById("momentCount").innerHTML = {{ len $a }}; +} +showMomentCount() \ No newline at end of file diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index a0a2820..fc2f96d 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -1,4 +1,4 @@ -{ +{ {{ $a := where $.Site.RegularPages "Section" .Section}}{{ if .IsHome }}{{ $a = $.Site.RegularPages }}{{ end }} "sectionName": "{{ default "index" .Section }}", - "momentCount": {{ len .Site.RegularPages }} + "momentCount": {{ len $a }} } \ No newline at end of file