share param data structure changed

This commit is contained in:
zzossig 2020-01-24 23:35:34 +09:00
parent 955de477b7
commit 03e830df20
4 changed files with 94 additions and 48 deletions

View File

@ -182,6 +182,23 @@
padding: 0 1rem; padding: 0 1rem;
@include animation('slide-in-down .2s .3s 1 ease-in both'); @include animation('slide-in-down .2s .3s 1 ease-in both');
.title {
a {
@include themify($themes) {
color: themed('title-color');
@include on-event {
color: themed('link-hover');
}
}
}
}
.subtitle {
@include themify($themes) {
color: themed('meta-color');
}
}
&__flexbox { &__flexbox {
@include flexbox(); @include flexbox();
margin-top: 1rem; margin-top: 1rem;
@ -193,6 +210,28 @@
overflow-wrap: break-word; overflow-wrap: break-word;
} }
&__tag {
font-size: 0.8rem;
line-height: 0.8rem;
padding: 0.25rem;
margin: 0 0.25rem;
border: none;
border-radius: 0.2rem;
text-transform: capitalize;
cursor: pointer;
@include themify($themes) {
color: themed('body-color');
background-color: themed('taxo-tags-background-color');
}
&--wrapper {
margin-top: 0.75rem;
@include flexbox();
}
}
hr { hr {
@include themify($themes) { @include themify($themes) {
border-top: 1px solid themed('hr-color'); border-top: 1px solid themed('hr-color');

View File

@ -1,48 +1,46 @@
{{ if ($.Param "share") }} {{ if $.Param "share" }}
{{ if gt (len ($.Param "share").options) 0 }} <div class="donation">
<div class="donation">
<div class="donation__message"> <div class="donation__message">
{{ i18n "share-message" }} {{ i18n "share-message" }}
</div> </div>
<div class="donation__icons"> <div class="donation__icons">
{{ $ctx := . }} {{ $ctx := . }}
{{ $site := .Site }} {{ $site := .Site }}
{{ range $.Param "share.options" }} {{ range $.Param "share" }}
{{ if eq (lower .) "facebook" }} {{ if eq (lower .name) "facebook" }}
<a href="https://www.facebook.com/sharer/sharer.php?u={{ $ctx.Permalink | absLangURL }}" title="{{ i18n "facebook" | default "Facebook" }}" aria-label="{{ . }}" class="donation__item" target="_blank" rel="noreferrer"> <a href="https://www.facebook.com/sharer/sharer.php?u={{ $ctx.Permalink | absLangURL }}" title="{{ i18n "facebook" | default "Facebook" }}" aria-label="Facebook Share Button" class="donation__item" target="_blank" rel="noreferrer">
{{ partial "svgs/share/facebook.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/facebook.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "twitter" }} {{ else if eq (lower .name) "twitter" }}
<a href="https://twitter.com/intent/tweet?text={{ $ctx.Title }}&url={{ $ctx.Permalink | absLangURL }}{{ with $ctx.Params.tags }}&hashtags={{ delimit . "," }}{{ end }}{{ with $ctx.Params.author }}&via={{ . }}{{ end }}" title="{{ i18n "twitter" | default "Twitter" }}" aria-label="{{ . }}" class="donation__item" target="_blank" rel="noreferrer"> <a href="https://twitter.com/intent/tweet?text={{ $ctx.Title }}&url={{ $ctx.Permalink | absLangURL }}{{ with $ctx.Params.tags }}&hashtags={{ delimit . "," }}{{ end }}&via={{ .username | default $ctx.Params.author }}" title="{{ i18n "twitter" | default "Twitter" }}" aria-label="Twitter Share Button" class="donation__item" target="_blank" rel="noreferrer">
{{ partial "svgs/share/twitter.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/twitter.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "reddit" }} {{ else if eq (lower .name) "reddit" }}
<a href="https://www.reddit.com/submit?url={{ $ctx.Permalink | absLangURL }}&amp;title={{ $ctx.Title }}" target="_blank" rel="noreferer" title="{{ i18n "reddit" | default "Reddit" }}" aria-label="{{ . }}" onclick="window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(document.URL) + '&amp;title=' + encodeURIComponent(document.title)); return false;" class="donation__item"> <a href="https://www.reddit.com/submit?url={{ $ctx.Permalink | absLangURL }}&amp;title={{ $ctx.Title }}" target="_blank" rel="noreferer" title="{{ i18n "reddit" | default "Reddit" }}" aria-label="Reddit Share Button" onclick="window.open('http://www.reddit.com/submit?url=' + encodeURIComponent(document.URL) + '&amp;title=' + encodeURIComponent(document.title)); return false;" class="donation__item">
{{ partial "svgs/share/reddit.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/reddit.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "linkedin" }} {{ else if eq (lower .name) "linkedin" }}
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{ $ctx.Permalink | absLangURL }}&title={{ $ctx.Title }} &summary={{ $ctx.Description }}&source={{ $site.Params.Description }}" target="_blank" rel="noreferer" title="{{ i18n "linkedin" | default "LinkedIn" }}" aria-label="{{ . }}" class="donation__item"> <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ $ctx.Permalink | absLangURL }}&title={{ $ctx.Title }} &summary={{ $ctx.Description }}&source={{ $site.Params.Description }}" target="_blank" rel="noreferer" title="{{ i18n "linkedin" | default "LinkedIn" }}" aria-label="LinkedIn Share Button" class="donation__item">
{{ partial "svgs/share/linkedin.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/linkedin.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "tumblr" }} {{ else if eq (lower .name) "tumblr" }}
<a href="http://tumblr.com/widgets/share/tool?canonicalUrl={{ $ctx.Permalink | absLangURL }}&data-title={{ $ctx.Title }}&data-content={{ $ctx.Description }}" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "tumblr" | default "Tumblr" }}" aria-label="{{ . }}"> <a href="http://tumblr.com/widgets/share/tool?canonicalUrl={{ $ctx.Permalink | absLangURL }}&data-title={{ $ctx.Title }}&data-content={{ $ctx.Description }}" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "tumblr" | default "Tumblr" }}" aria-label="Tumblr Share Button">
{{ partial "svgs/share/tumblr.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/tumblr.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "weibo" }} {{ else if eq (lower .name) "weibo" }}
<a href="javascript:void(function(){var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='http://service.weibo.com/share/share.php?url='+e(d.location.href)+'&title='+e(d.title),x=function(){if(!window.open(r,'weibo','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "weibo" | default "Weibo" }}" aria-label="{{ . }}"> <a href="javascript:void(function(){var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='http://service.weibo.com/share/share.php?url='+e(d.location.href)+'&title='+e(d.title),x=function(){if(!window.open(r,'weibo','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "weibo" | default "Weibo" }}" aria-label="Weibo Share Button">
{{ partial "svgs/share/weibo.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/weibo.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "douban" }} {{ else if eq (lower .name) "douban" }}
<a href="javascript:void(function(){var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='https://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',w=450,h=330,x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width='+w+',height='+h+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "douban" | default "Douban" }}" aria-label="{{ . }}"> <a href="javascript:void(function(){var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='https://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',w=450,h=330,x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width='+w+',height='+h+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "douban" | default "Douban" }}" aria-label="Douban Share Button">
{{ partial "svgs/share/douban.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/douban.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ else if eq (lower .) "line" }} {{ else if eq (lower .name) "line" }}
<a href="https://social-plugins.line.me/lineit/share?url={{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "line" | default "Line" }}" aria-label="{{ . }}"> <a href="https://social-plugins.line.me/lineit/share?url={{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferer" title="{{ i18n "line" | default "Line" }}" aria-label="Line Share Button">
{{ partial "svgs/share/line.svg" (dict "width" 35 "height" 35) }} {{ partial "svgs/share/line.svg" (dict "width" 35 "height" 35) }}
</a> </a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
</div> </div>
{{ end }}
{{ end }} {{ end }}

View File

@ -6,6 +6,15 @@
<h5 class="title h6"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5> <h5 class="title h6"><a href='{{ .Permalink }}'> {{ .Title }}</a> </h5>
<h6 class="subtitle caption"><time title="{{ i18n "tooltip-written" }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time> {{ if .GitInfo }} <time title="{{ i18n "tooltip-modified" }}"> &middot; 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time> {{ end }} <span title="{{ i18n "tooltip-reading-time" }}"> &middot; ☕ {{ .ReadingTime }} {{ i18n "reading-time" }}</span>{{ with .Params.Author }}&middot; <span title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>{{ end }}</h6> <h6 class="subtitle caption"><time title="{{ i18n "tooltip-written" }}">📅 {{ .Date.Format (i18n "summary-dateformat") }} </time> {{ if .GitInfo }} <time title="{{ i18n "tooltip-modified" }}"> &middot; 📝 {{ .Lastmod.Format (i18n "summary-dateformat") }} </time> {{ end }} <span title="{{ i18n "tooltip-reading-time" }}"> &middot; ☕ {{ .ReadingTime }} {{ i18n "reading-time" }}</span>{{ with .Params.Author }}&middot; <span title="{{ i18n "single-writtenBy" }}">{{if $params.AuthorEmoji }}{{ $params.AuthorEmoji }}{{ else }}✍️{{ end }}&nbsp;{{ . }}</span>{{ end }}</h6>
</header> </header>
<div class="summary-compact__tag--wrapper">
{{ range $params.tags }}
{{ if . }}
<a href="{{ "tags/" | relLangURL }}{{ . | urlize }}" class="summary-compact__tag">
{{ . }}
</a>
{{ end }}
{{ end }}
</div>
</div> </div>
</div> </div>
<hr /> <hr />