Add a rating to pages with the rating front matter
This commit is contained in:
parent
3aecd74424
commit
3ec66211a5
1 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,17 @@
|
|||
<article>
|
||||
<header>
|
||||
<h2>{{- .Title -}}</h2>
|
||||
{{ if .Params.rating }}
|
||||
<strong>Rating</strong>
|
||||
{{ range seq $.Params.rating }}
|
||||
⭐
|
||||
{{ end }}
|
||||
{{ if lt .Params.rating 5 }}
|
||||
{{ range seq $.Params.rating 4 }}
|
||||
<span style="filter: grayscale(1)">⭐</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</header>
|
||||
<div>
|
||||
{{- .Content -}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue