mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-05-15 00:02:57 -05:00
Compare commits
4 Commits
d41f3facd7
...
a172b1ea21
Author | SHA1 | Date | |
---|---|---|---|
a172b1ea21 | |||
93d9164c6a | |||
72ebcf134a | |||
effd3a265b |
@ -274,6 +274,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Social media share buttons */
|
||||||
|
.share-buttons {
|
||||||
|
background: var(--background-2);
|
||||||
|
margin: 25px 0;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-buttons a {
|
||||||
|
background-color: var(--background-4);
|
||||||
|
padding: 4px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-buttons svg {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Back to top */
|
/* Back to top */
|
||||||
#back-to-top {
|
#back-to-top {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -4,8 +4,6 @@ markup:
|
|||||||
lineNos: true
|
lineNos: true
|
||||||
|
|
||||||
params:
|
params:
|
||||||
faviconICO: favicon.ico
|
|
||||||
faviconPNG: favicon.png
|
|
||||||
readingtime: true
|
readingtime: true
|
||||||
|
|
||||||
taxonomies:
|
taxonomies:
|
||||||
|
@ -20,9 +20,9 @@ params:
|
|||||||
# these are for the OpenGraph/Twitter embeds in Hugo
|
# these are for the OpenGraph/Twitter embeds in Hugo
|
||||||
description: Example website for bobatheme
|
description: Example website for bobatheme
|
||||||
|
|
||||||
# these are for favicons in bobatheme (defaults are shown here)
|
# these are for favicons in bobatheme (disabled by default)
|
||||||
# faviconICO: favicon.ico
|
# faviconSVG: favicon.svg
|
||||||
# faviconPNG: favicon.png
|
# appleTouchPNG: apple-touch-icon.png
|
||||||
|
|
||||||
# show reading time (enabled by default)
|
# show reading time (enabled by default)
|
||||||
# readingtime: true
|
# readingtime: true
|
||||||
@ -34,6 +34,14 @@ params:
|
|||||||
# display a "Latest Posts" section on the homepage below its content
|
# display a "Latest Posts" section on the homepage below its content
|
||||||
homepageLatestPosts: true
|
homepageLatestPosts: true
|
||||||
|
|
||||||
|
# social media share icons
|
||||||
|
# shareButtons:
|
||||||
|
# twitter: true
|
||||||
|
# facebook: true
|
||||||
|
# linkedin: true
|
||||||
|
# reddit: true
|
||||||
|
# telegram: true
|
||||||
|
|
||||||
# footer: >-
|
# footer: >-
|
||||||
# Some example text for the footer.
|
# Some example text for the footer.
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ partial "series-box.html" . }}
|
||||||
|
|
||||||
{{ if or .NextInSection .PrevInSection }}
|
{{ if or .NextInSection .PrevInSection }}
|
||||||
<div class="prevnext">
|
<div class="prevnext">
|
||||||
{{ with .NextInSection }}
|
{{ with .NextInSection }}
|
||||||
@ -62,7 +64,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "series-box.html" . }}
|
{{ if .Site.Params.shareButtons }}
|
||||||
|
{{ partial "share.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $related := .Site.RegularPages.Related . | first 10 }}
|
{{ $related := .Site.RegularPages.Related . | first 10 }}
|
||||||
{{ with $related }}
|
{{ with $related }}
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Site.Params.faviconICO }}
|
{{ with .Site.Params.faviconSVG }}
|
||||||
<link rel="icon" type="image/x-icon" href="{{ . | absURL }}" />
|
<link rel="icon" href="{{ . | absURL }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Site.Params.faviconPNG }}
|
{{ with .Site.Params.appleTouchPNG }}
|
||||||
<link rel="icon" type="image/png" href="{{ . | absURL }}" />
|
<link rel="apple-touch-icon" href="{{ . | absURL }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .IsHome }}
|
{{ if .IsHome }}
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
{{- $icon := $icon_resource.Content -}}
|
{{- $icon := $icon_resource.Content -}}
|
||||||
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
|
||||||
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
|
||||||
|
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
|
||||||
{{- $icon | safeHTML -}}
|
{{- $icon | safeHTML -}}
|
||||||
|
50
layouts/partials/share.html
Normal file
50
layouts/partials/share.html
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<div class="share-buttons">
|
||||||
|
{{ if .Site.Params.shareButtons.twitter }}
|
||||||
|
<a class="twitter-share"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
|
||||||
|
{{- partial "icon.html" "twitter" -}}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Site.Params.shareButtons.facebook }}
|
||||||
|
<a class="facebook-share"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
|
||||||
|
{{- partial "icon.html" "facebook" -}}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Site.Params.shareButtons.linkedin }}
|
||||||
|
<a class="linkedin-share"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
|
||||||
|
{{- partial "icon.html" "linkedin" -}}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Site.Params.shareButtons.reddit }}
|
||||||
|
<a class="reddit-share"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
|
||||||
|
{{- partial "icon.html" "reddit" -}}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* Telegram icon doesn't have `viewbox` set, which breaks the sizing.
|
||||||
|
https://stackoverflow.com/q/72073399/19003757
|
||||||
|
https://github.com/michaelampr/jam/issues/39
|
||||||
|
{{ if .Site.Params.shareButtons.telegram }}
|
||||||
|
<a class="telegram-share"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
|
||||||
|
{{- partial "icon.html" "telegram" -}}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
*/}}
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user