IMPROVEMENT: give a jsonp api to return the number of moments and fix incorrect count for a certain section.
This commit is contained in:
parent
6c14c1355f
commit
5ad98eeadb
2 changed files with 6 additions and 2 deletions
4
layouts/_default/list.js.js
Normal file
4
layouts/_default/list.js.js
Normal file
|
@ -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()
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{ {{ $a := where $.Site.RegularPages "Section" .Section}}{{ if .IsHome }}{{ $a = $.Site.RegularPages }}{{ end }}
|
||||||
"sectionName": "{{ default "index" .Section }}",
|
"sectionName": "{{ default "index" .Section }}",
|
||||||
"momentCount": {{ len .Site.RegularPages }}
|
"momentCount": {{ len $a }}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue