Add common class for buttons

This commit is contained in:
vimux 2018-11-16 11:45:08 -05:00
parent 6f847bd6d1
commit 6b3d4c831c
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
3 changed files with 19 additions and 11 deletions

View file

@ -1,42 +1,42 @@
{{- if and .IsPage (.Param "share") }} {{- if and .IsPage (.Param "share") }}
<div class="post__share share"> <div class="post__share share">
{{- if .Param "share.facebook" }} {{- if .Param "share.facebook" }}
<a class="share__link" title="{{ T "share-caption" }} Facebook" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Facebook', 'width=800,height=600,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} Facebook" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Facebook', 'width=800,height=600,toolbar=0,status=0'); return false">
{{ partial "svg/facebook.svg" (dict "class" "share__icon" ) }} {{ partial "svg/facebook.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.twitter" }} {{- if .Param "share.twitter" }}
<a class="share__link" title="{{ T "share-caption" }} Twitter" href="https://twitter.com/intent/tweet/?url={{ .Permalink }}&amp;text={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Twitter', 'width=800,height=450,resizable=yes,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} Twitter" href="https://twitter.com/intent/tweet/?url={{ .Permalink }}&amp;text={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Twitter', 'width=800,height=450,resizable=yes,toolbar=0,status=0'); return false">
{{ partial "svg/twitter.svg" (dict "class" "share__icon" ) }} {{ partial "svg/twitter.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.reddit" }} {{- if .Param "share.reddit" }}
<a class="share__link" title="{{ T "share-caption" }} Reddit" href="https://www.reddit.com/submit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Reddit', 'width=832,height=624,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} Reddit" href="https://www.reddit.com/submit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Reddit', 'width=832,height=624,toolbar=0,status=0'); return false">
{{ partial "svg/reddit.svg" (dict "class" "share__icon" ) }} {{ partial "svg/reddit.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.telegram" }} {{- if .Param "share.telegram" }}
<a class="share__link" title="{{ T "share-caption" }} Telegram" href="https://t.me/share/url?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Telegram', 'width=800,height=600,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} Telegram" href="https://t.me/share/url?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Telegram', 'width=800,height=600,toolbar=0,status=0'); return false">
{{ partial "svg/telegram.svg" (dict "class" "share__icon" ) }} {{ partial "svg/telegram.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.linkedin" }} {{- if .Param "share.linkedin" }}
<a class="share__link" title="{{ T "share-caption" }} LinkedIn" href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}&title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} LinkedIn', 'width=640,height=480,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} LinkedIn" href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}&title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} LinkedIn', 'width=640,height=480,toolbar=0,status=0'); return false">
{{ partial "svg/linkedin.svg" (dict "class" "share__icon" ) }} {{ partial "svg/linkedin.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.googleplus" }} {{- if .Param "share.googleplus" }}
<a class="share__link" title="{{ T "share-caption" }} Google+" href="https://plus.google.com/share?url={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Google+', 'width=640,height=480,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} Google+" href="https://plus.google.com/share?url={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} Google+', 'width=640,height=480,toolbar=0,status=0'); return false">
{{ partial "svg/googleplus.svg" (dict "class" "share__icon" ) }} {{ partial "svg/googleplus.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.vk" }} {{- if .Param "share.vk" }}
<a class="share__link" title="{{ T "share-caption" }} VK" href="https://vk.com/share.php?url={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} VK', 'width=640,height=480,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "share-caption" }} VK" href="https://vk.com/share.php?url={{ .Permalink }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "share-caption" }} VK', 'width=640,height=480,toolbar=0,status=0'); return false">
{{ partial "svg/vk.svg" (dict "class" "share__icon" ) }} {{ partial "svg/vk.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}
{{- if .Param "share.pocket" }} {{- if .Param "share.pocket" }}
<a class="share__link" title="{{ T "save-caption" }} Pocket" href="https://getpocket.com/edit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "save-caption" }} Pocket', 'width=480,height=320,toolbar=0,status=0'); return false"> <a class="share__link btn" title="{{ T "save-caption" }} Pocket" href="https://getpocket.com/edit?url={{ .Permalink }}&amp;title={{ .Title }}" target="_blank" rel="noopener noreferrer" onclick="window.open(this.href, '{{ T "save-caption" }} Pocket', 'width=480,height=320,toolbar=0,status=0'); return false">
{{ partial "svg/pocket.svg" (dict "class" "share__icon" ) }} {{ partial "svg/pocket.svg" (dict "class" "share__icon" ) }}
</a> </a>
{{- end }} {{- end }}

View file

@ -2,7 +2,7 @@
{{ $tagsLen := len $.Params.tags }} {{ $tagsLen := len $.Params.tags }}
{{ if gt $tagsLen 0 }} {{ if gt $tagsLen 0 }}
<div class="post__tags"> <div class="post__tags">
{{ range $k, $v := $.Params.tags }}<a class="post__tag" href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">{{ . }}</a>{{ end }} {{ range $k, $v := $.Params.tags }}<a class="post__tag btn" href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">{{ . }}</a>{{ end }}
</div> </div>
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -407,6 +407,16 @@ mark {
text-align: right; text-align: right;
} }
.btn {
background-color: #111;
border-radius: 3px;
}
.btn:hover {
color: #fff;
background-color: #000;
}
/* Header */ /* Header */
.header { .header {
margin: 0 0 .3125rem; margin: 0 0 .3125rem;
@ -692,7 +702,6 @@ mark {
padding: .25rem .5rem; padding: .25rem .5rem;
margin: .25rem; margin: .25rem;
line-height: 1.5; line-height: 1.5;
background: #111;
} }
.toc { .toc {
@ -774,7 +783,6 @@ mark {
.share__link { .share__link {
margin: .25rem; margin: .25rem;
font-size: 0; font-size: 0;
background-color: #111;
} }
.share__link:hover { .share__link:hover {