add wordcount feature
This commit is contained in:
@@ -204,6 +204,18 @@ form:
|
|||||||
size: medium
|
size: medium
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
|
owner_title:
|
||||||
|
type: text
|
||||||
|
label: Owner title
|
||||||
|
size: medium
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
wordcount_title:
|
||||||
|
type: text
|
||||||
|
label: Word count title
|
||||||
|
size: medium
|
||||||
|
default: ""
|
||||||
|
|
||||||
analytics:
|
analytics:
|
||||||
type: textarea
|
type: textarea
|
||||||
label: Analytics script
|
label: Analytics script
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
owner_title:
|
||||||
|
wordcount_title:
|
||||||
analytics:
|
analytics:
|
||||||
social_buttons:
|
social_buttons:
|
||||||
contact:
|
contact:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<article class="post">
|
<article class="post">
|
||||||
<h2>{{ page.title }}</h2>
|
<h2>{{ page.title }}</h2>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<p>{{ page.date|date("d.m.Y H:i") }}{% if config.plugins.readingtime.enabled %} | {{ page.content|readingtime }}{% endif %}</p>
|
<p>{{ page.date|date("d.m.Y H:i") }}{% if config.plugins.readingtime.enabled %} | {{ page.content|readingtime }}{% endif %}{% if config.plugins.wordcount.enabled and grav.user.title == theme_config.owner_title %} | {{ getWordCount(content) }} {{ theme_config.wordcount_title }}{% endif %}</p>
|
||||||
<p>Tagi: {% for tag in page.taxonomy.tag %}<a href="{{ theme_config.blog.slug }}/tag:{{tag}}">{{ tag }}</a> {% endfor %}</p>
|
<p>Tagi: {% for tag in page.taxonomy.tag %}<a href="{{ theme_config.blog.slug }}/tag:{{tag}}">{{ tag }}</a> {% endfor %}</p>
|
||||||
</div>
|
</div>
|
||||||
{{ page.content | raw }}
|
{{ page.content | raw }}
|
||||||
|
|||||||
Reference in New Issue
Block a user