update ready listing for search

* update json output
* add rss output
* change tags to a tag cloud style

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
newmemberlevels
Toshaan Bharvani 3 years ago
parent 057c82709f
commit 2d7be0befe

@ -3,8 +3,8 @@ title: "OpenPOWER Ready"
date: 2021-03-30 date: 2021-03-30
outputs: outputs:
- html - html
- rss
- json - json
- rss
draft: false draft: false
--- ---



@ -6,7 +6,7 @@
<div class="section-header"> <div class="section-header">
<div class="row"> <div class="row">
<div class="col-lg-12 text-center"> <div class="col-lg-12 text-center">
<h2 class="section-title text-center">{{ .Title }}</h2> <h1 class="section-title text-center">{{ .Title }}</h1>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -31,15 +31,15 @@
<form action="{{ .RelPermalink }}" onkeyup="executeInlineSearch()"> <form action="{{ .RelPermalink }}" onkeyup="executeInlineSearch()">
<input id="search-query" placeholder="Search..." name="s" autocomplete="off" search autofocus/> <input id="search-query" placeholder="Search..." name="s" autocomplete="off" search autofocus/>
</form> </form>
<div id="search-results"><h3 class="search-results-title mb-4">Matching pages</h3></div> <div id="search-results"><h3 class="search-results-title mb-4">Matching items</h3></div>
</div> </div>
<script id="search-result-template" type="text/x-js-template"> <script id="search-result-template" type="text/x-js-template">
<div class="search-results-summary" id="summary-${key}"> <div class="search-results-summary">
<h4><a class="search-item mb-4" href="${link}">${title}</a></h4> <div class="search-results" id="summary-${key}">
<p>${snippet} ... <a class="search-item-more" href="${link}">[more]</a></p> <h4><a class="search-item" href="${link}">${title}</a></h4>
${ isset tags }<p>${tags}</p>${ end } ${ isset tags }<p>${tags}</p>${ end }
${ isset categories }<p>Categories: ${categories}</p>${ end }
</div> </div>
</div>
</script> </script>
</div> </div>
<div class="col-lg-2">&nbsp;</div> <div class="col-lg-2">&nbsp;</div>

@ -40,12 +40,38 @@
{{ end }} {{ end }}
<li>Date Added : {{ .Date.Format "2 January 2006" }}</li> <li>Date Added : {{ .Date.Format "2 January 2006" }}</li>
</ul> </ul>
<h4>Tags</h4> {{ if .Params.tags }}
<ul id="tags"> {{ $tags := .Params.tags }}
{{ range .Params.tags }} <h4>Tags</h4>
<li>{{ . }}</li> <ul id="tags">
<li>
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
{{ $fontUnit := "rem" }}
{{ $largestFontSize := 3.5 }}
{{ $smallestFontSize := 0.5 }}
{{ $fontSpread := sub $largestFontSize $smallestFontSize }}
{{ $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 }}
{{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }}
{{ $spread := sub $max $min }}
{{ $fontStep := div $fontSpread $spread }}
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
{{ $currentTagCount := len $taxonomy.Pages }}
{{ $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) }}
{{ $count := len $taxonomy.Pages }}
{{ $weigth := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }}
{{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weigth) ) }}
{{ range $tags }}
{{ if eq $name . }}
&nbsp;
<span style="font-size: {{ $currentFontSize }}{{ $fontUnit }}">{{ $name }}</span>
&nbsp;
{{ end }}
{{ end }}
{{ end }}
</li>
</ul>
{{ end }}
{{ end }} {{ end }}
</ul>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

Loading…
Cancel
Save