Merge pull request #352 from tabinurie/customicon

Add option to change default emoji icons
This commit is contained in:
zzossig 2020-11-14 21:44:21 +09:00 committed by GitHub
commit a703d0e3c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 37 deletions

View File

@ -45,6 +45,15 @@ paginateWindow = 1
talksPaginate = 5
talksGroupByDate = "2006"
pubPaginate = 20
writtenTimeIcon = "📅"
modifiedTimeIcon = "📝"
readingTimeIcon = "☕"
authorIcon = "✍️"
pagePvIcon = "👀"
pinIcon = "📌"
tagIcon = "🏷️"
publicationIcon = "📚"
typeIcon = "🎯"
# whoami
myname = "zzossig"

View File

@ -1,14 +1,14 @@
{{ $params := .Params }}
<div class="single__infos">
<time class="single__info" title="{{ i18n "tooltip-written" }}">📅&nbsp;{{ .Date.Format (i18n "single-dateformat") }} </time>
<time class="single__info" title="{{ i18n "tooltip-written" }}">{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }}&nbsp;{{ .Date.Format (i18n "single-dateformat") }} </time>
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
&nbsp;&middot;&nbsp; <time class="single__info" title="{{ i18n "tooltip-modified" }}"> 📝&nbsp;{{ .Lastmod.Format (i18n "single-dateformat") }} </time>
&nbsp;&middot;&nbsp; <time class="single__info" title="{{ i18n "tooltip-modified" }}"> {{ ($.Site.Params.modifiedTimeIcon | safeHTML) | default "📝" }}&nbsp;{{ .Lastmod.Format (i18n "single-dateformat") }} </time>
{{ end }}
&nbsp;&middot;&nbsp; <span class="single__info" title="{{ i18n "tooltip-reading-time" }}">&nbsp;{{ .ReadingTime }}&nbsp;{{ i18n "reading-time" }} </span>
&nbsp;&middot;&nbsp; <span class="single__info" title="{{ i18n "tooltip-reading-time" }}"> {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "" }}&nbsp;{{ .ReadingTime }}&nbsp;{{ i18n "reading-time" }} </span>
{{ with .Params.Author }}
&nbsp;&middot;&nbsp; <span class="single__info" title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>
&nbsp;&middot;&nbsp; <span class="single__info" title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }}&nbsp;{{ . }}</span>
{{ end }}
<span class="single__info">
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} &middot; 👀<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} &middot; {{ ($.Site.Params.pagePvIcon | safeHTML) | default "👀" }}<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
</span>
</div>
</div>

View File

@ -1,9 +1,9 @@
{{ $taxo := "tags" }}
<ul class="single__tags caption">
{{ if .Params.tags }}
🏷️
{{ ($.Site.Params.tagIcon | safeHTML) | default "🏷️" }}
{{ end }}
{{ range (.GetTerms "tags") }}
<li><a href="{{ .Permalink }}" class="single__tag" title="{{ .LinkTitle }}">#{{ .LinkTitle }}</a></li>
{{ end }}
</ul>
</ul>

View File

@ -1 +1 @@
<span class="caption pub__meta">📅 {{ if .Params.publishDate }}{{ dateFormat (i18n "pub-dateformat") .Params.publishDate }}{{ end }}</span>{{ with .Params.authors }}<span class="caption pub__meta">✍️ {{ delimit . ", " }}</span>{{ end }}{{ with .Params.publication }}<span class="caption pub__meta">📚 {{ . }}</span>{{ end }}{{ with .Params.ENTRYTYPE }}<span class="caption pub__meta" data-entry-type="{{ . }}">🎯 {{ . }}</span>{{ end }}
<span class="caption pub__meta">{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }} {{ if .Params.publishDate }}{{ dateFormat (i18n "pub-dateformat") .Params.publishDate }}{{ end }}</span>{{ with .Params.authors }}<span class="caption pub__meta">{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }} {{ delimit . ", " }}</span>{{ end }}{{ with .Params.publication }}<span class="caption pub__meta">{{ ($.Site.Params.publicationIcon | safeHTML) | default "📚" }} {{ . }}</span>{{ end }}{{ with .Params.ENTRYTYPE }}<span class="caption pub__meta" data-entry-type="{{ . }}">{{ ($.Site.Params.typeIcon | safeHTML) | default "🎯" }} {{ . }}</span>{{ end }}

View File

@ -47,28 +47,28 @@
if (obj.publishDate) {
var dateSpan = document.createElement('span');
dateSpan.className = 'caption pub__meta';
dateSpan.innerText = '📅 ' + obj.publishDate.slice(0, 10);
dateSpan.innerText = '{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }} ' + obj.publishDate.slice(0, 10);
metaDiv.appendChild(dateSpan);
}
if (obj.authors) {
var authorsSpan = document.createElement('span');
authorsSpan.className = 'caption pub__meta';
authorsSpan.innerText = '✍️ ' + obj.authors.toString();
authorsSpan.innerText = '{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }} ' + obj.authors.toString();
metaDiv.appendChild(authorsSpan);
}
if (obj.publication) {
var pubSpan = document.createElement('span');
pubSpan.className = 'caption pub__meta';
pubSpan.innerText = '📚 ' + obj.publication;
pubSpan.innerText = '{{ ($.Site.Params.publicationIcon | safeHTML) | default "📚" }} ' + obj.publication;
metaDiv.appendChild(pubSpan);
}
if (obj.ENTRYTYPE) {
var typeSpan = document.createElement('span');
typeSpan.className = 'caption pub__meta';
typeSpan.innerText = '🎯 ' + obj.ENTRYTYPE;
typeSpan.innerText = '{{ ($.Site.Params.typeIcon | safeHTML) | default "🎯" }} ' + obj.ENTRYTYPE;
metaDiv.appendChild(typeSpan);
}
@ -76,7 +76,7 @@
if (obj.tags && obj.tags.length) {
tagsUl = document.createElement('ul');
tagsUl.setAttribute('class', 'pub__tags caption');
tagsUl.innerHTML = '&nbsp;🏷️';
tagsUl.innerHTML = '&nbsp;{{ ($.Site.Params.tagIcon | safeHTML) | default "🏷️" }}';
for (var i = 0; i < obj.tags.length; i++) {
var tagLi = document.createElement('li');
@ -147,28 +147,28 @@
if (obj.item.publishDate) {
var dateSpan = document.createElement('span');
dateSpan.className = 'caption pub__meta';
dateSpan.innerText = '📅 ' + obj.item.publishDate.slice(0, 10);
dateSpan.innerText = '{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }} ' + obj.item.publishDate.slice(0, 10);
metaDiv.appendChild(dateSpan);
}
if (obj.item.authors) {
var authorsSpan = document.createElement('span');
authorsSpan.className = 'caption pub__meta';
authorsSpan.innerText = '✍️ ' + obj.item.authors.toString();
authorsSpan.innerText = '{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }} ' + obj.item.authors.toString();
metaDiv.appendChild(authorsSpan);
}
if (obj.item.publication) {
var pubSpan = document.createElement('span');
pubSpan.className = 'caption pub__meta';
pubSpan.innerText = '📚 ' + obj.item.publication;
pubSpan.innerText = '{{ ($.Site.Params.publicationIcon | safeHTML) | default "📚" }} ' + obj.item.publication;
metaDiv.appendChild(pubSpan);
}
if (obj.item.ENTRYTYPE) {
var typeSpan = document.createElement('span');
typeSpan.className = 'caption pub__meta';
typeSpan.innerText = '🎯 ' + obj.item.ENTRYTYPE;
typeSpan.innerText = '{{ ($.Site.Params.typeIcon | safeHTML) | default "🎯" }} ' + obj.item.ENTRYTYPE;
metaDiv.appendChild(typeSpan);
}
@ -176,7 +176,7 @@
if (obj.item.tags && obj.item.tags.length) {
tagsUl = document.createElement('ul');
tagsUl.setAttribute('class', 'pub__tags caption');
tagsUl.innerHTML = '&nbsp;🏷️';
tagsUl.innerHTML = '&nbsp;{{ ($.Site.Params.tagIcon | safeHTML) | default "🏷️" }}';
for (var j = 0; j < obj.item.tags.length; j++) {
var tagLi = document.createElement('li');
@ -331,4 +331,4 @@
// shave
shave('.pub__summary', 150);
});
</script>
</script>

View File

@ -1,14 +1,14 @@
<article class="summary-card" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
<header>
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}{{ ($.Site.Params.pinIcon | safeHTML) | default "📌" }}&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h6 class="subtitle caption">
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅{{ .Date.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }}{{ .Date.Format (i18n "summary-dateformat") }} </time>
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.modifiedTimeIcon | safeHTML) | default "📝" }} {{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
{{ end }}
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; ☕ {{ .ReadingTime }} {{ i18n "reading-time" }}</span>
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "" }} {{ .ReadingTime }} {{ i18n "reading-time" }}</span>
{{ with $.Param "author" }}
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $.Param "AuthorEmoji" }}{{ $.Param "AuthorEmoji" }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $.Param "AuthorEmoji" }}{{ $.Param "AuthorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }}&nbsp;{{ . }}</span>
{{ end }}
</h6>
</header>
@ -45,4 +45,4 @@
{{ end }}
</div>
<hr />
</article>
</article>

View File

@ -17,15 +17,15 @@
<div class="summary-classic__content">
<header>
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h5 class="title h5"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}{{ ($.Site.Params.pinIcon | safeHTML) | default "📌" }}&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h6 class="subtitle caption">
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅&nbsp;{{ .Date.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }}&nbsp;{{ .Date.Format (i18n "summary-dateformat") }} </time>
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; 📝&nbsp;{{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.modifiedTimeIcon | safeHTML) | default "📝" }}&nbsp;{{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
{{ end }}
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot;&nbsp;{{ .ReadingTime }}&nbsp;{{ i18n "reading-time" }} </span>
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "" }}&nbsp;{{ .ReadingTime }}&nbsp;{{ i18n "reading-time" }} </span>
{{ with $.Param "author" }}
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $.Param "authorEmoji" }}{{ $.Param "authorEmoji" }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }}&nbsp;{{ . }}</span>
{{ end }}
</h6>
</header>
@ -56,4 +56,4 @@
</div>
<hr />
</article>
</article>

View File

@ -3,15 +3,15 @@
{{ $params := .Params }}
<div class="summary-compact__meta">
<header>
<h5 class="title h6"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}📌&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h5 class="title h6"><a href='{{ .Permalink }}'>{{- with .Params.pinned -}}{{ ($.Site.Params.pinTimeIcon | safeHTML) | default "📌" }}&nbsp;{{- end -}}{{ .Title }}</a> </h5>
<h6 class="subtitle caption">
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-written" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ ($.Site.Params.writtenTimeIcon | safeHTML) | default "📅" }} {{ .Date.Format (i18n "summary-dateformat") }} </time>
{{ if ne (.Date.Format (i18n "summary-dateformat")) (.Lastmod.Format (i18n "summary-dateformat")) }}
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
<time title="{{ i18n "tooltip-modified" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.modifiedTimeIcon | safeHTML) | default "📝" }} {{ .Lastmod.Format (i18n "summary-dateformat") }} </time>
{{ end }}
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; ☕ {{ .ReadingTime }} {{ i18n "reading-time" }}</span>
<span title="{{ i18n "tooltip-reading-time" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}"> &middot; {{ ($.Site.Params.readingTimeIcon | safeHTML) | default "" }} {{ .ReadingTime }} {{ i18n "reading-time" }}</span>
{{ with $params.Author }}
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>
&middot; <span title="{{ i18n "single-writtenBy" }}" dir="{{ if ne ($.Param "languagedir") "rtl" }}ltr{{ else }}rtl{{ end }}">{{ if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}{{ ($.Site.Params.authorIcon | safeHTML) | default "✍️" }}{{ end }}&nbsp;{{ . }}</span>
{{ end }}
</h6>
</header>