1
0
Fork 0
mirror of https://github.com/dillonzq/LoveIt.git synced 2025-03-26 00:17:00 +01:00

Merge pull request from dillonzq/feature/fontawesome_toc

feat(toc): support fontawesome and ruby in TOC
This commit is contained in:
Dillon 2020-02-22 00:37:36 +08:00 committed by GitHub
commit 0d83302529
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 615 additions and 576 deletions

View file

@ -54,7 +54,6 @@
@import "../_partial/_single/toc";
.content {
h1,
h2,
h3,
h4,
@ -66,22 +65,7 @@
.dark-theme & {
font-weight: bolder;
}
}
h2 > a:first-child::before {
content: "#";
margin-right: .3125rem;
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
}
h3,
h4,
h5,
h6 {
& > a:first-child::before {
content: "|";
margin-right: .3125rem;
@ -93,6 +77,10 @@
}
}
h2 > a:first-child::before {
content: "#";
}
p {
font-size: 1rem;
margin: .5rem 0;

View file

@ -59,31 +59,47 @@
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
display: inline;
h2,
h3,
h4,
h5,
h6,
p {
font-size: 1rem;
display: inline;
&::after {
content: "\A";
white-space: pre;
&::after {
content: "\A";
white-space: pre;
}
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 2;
h2,
h3,
h4,
h5,
h6 {
line-height: 2;
&::before {
content: "|";
margin-right: .3125rem;
color: $single-link-color;
.dark-theme & {
color: $single-link-color-dark;
}
}
}
h2 {
font-size: 1.2rem;
&::before {
content: "#";
}
}
}
.post-footer {

View file

@ -14,6 +14,10 @@
font-weight: 700;
}
.admonition-content {
margin: .5rem 0;
}
i.icon {
font-size: 16px;
color: map-get($admonition-color-map, 'note');

View file

@ -131,3 +131,21 @@
}
}
}
.toc {
ruby {
background: $code-background-color;
rt {
color: $global-font-secondary-color;
}
.dark-theme & {
background: $code-background-color-dark;
rt {
color: $global-font-secondary-color-dark;
}
}
}
}

View file

@ -9,6 +9,16 @@ theme = "LoveIt"
# 主题目录
themesDir = "../.."
# whether to use robots.txt
# 是否使用 robots.txt
enableRobotsTXT = true
# whether to use git commit log to generate lastmod record
# 是否使用 git 信息来生成文章的上次修改时间
enableGitInfo = false
# whether to use emoji code
# 是否使用 emoji 代码
enableEmoji = true
[languages]
[languages.en]
weight = 1
@ -16,16 +26,10 @@ themesDir = "../.."
languageCode = "en"
# website title
title = "LoveIt Theme"
# whether to use git commit log to generate lastmod record
enableGitInfo = false
# whether to include chinese/japanese/korean
hasCJKLanguage = false
# default amount of posts in each pages
paginate = 12
# whether to use emoji code
enableEmoji = true
# whether to use robots.txt
enableRobotsTXT = true
# [UA-XXXXXXXX-X] google analytics code
googleAnalytics = ""
# copyright description used only for seo schema
@ -311,16 +315,10 @@ themesDir = "../.."
languageCode = "zh"
# 网站标题
title = "LoveIt 主题"
# 是否使用 git 信息来生成文章的上次修改时间
enableGitInfo = false
# 是否包括中日韩文字
hasCJKLanguage = true
# 默认每页列表显示的文章数目
paginate = 12
# 是否使用 emoji 代码
enableEmoji = true
# 是否使用 robots.txt
enableRobotsTXT = true
# [UA-XXXXXXXX-X] 谷歌分析代号
googleAnalytics = ""
# 版权描述,仅仅用于 SEO

View file

@ -22,7 +22,7 @@ comment: false
dev: true
---
## This is a test page
## :(fas fa-rocket): This is a test page
[https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/](https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/)

View file

@ -46,10 +46,10 @@ other = "Powered by %s"
other = "Theme - "
# === partials/footer.html ===
# === partials/post/share.html ===
# === partials/plugin/share.html ===
[share]
other = "Share on"
# === partials/post/share.html ===
# === partials/plugin/share.html ===
# === posts/single.html ===
[toc]

View file

@ -46,10 +46,10 @@ other = "由 %s 强力驱动"
other = "主题 - "
# === partials/footer.html ===
# === partials/post/share.html ===
# === partials/plugin/share.html ===
[share]
other = "分享到"
# === partials/post/share.html ===
# === partials/plugin/share.html ===
# === posts/single.html ===
[toc]

View file

@ -1,5 +1,5 @@
<figure>
{{- partial "function/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
{{- with .Title | default .Text -}}
<figcaption class="image-caption">
{{- . | safeHTML -}}

View file

@ -1,3 +1,2 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- $options := dict "href" .Destination "title" .Title "content" .Text -}}
{{- partial "plugin/link.html" $options -}}

View file

@ -9,7 +9,7 @@
{{- /* Content */ -}}
<div class="content">
{{- partial "function/content.html" .Content -}}
{{- partial "single/content.html" .Content -}}
</div>
</div>
{{- end -}}

View file

@ -3,7 +3,7 @@
{{- with .Params.featuredImage -}}
<div class="featured-image-preview">
{{- $image := $.Params.featuredImagePreview | default . -}}
{{- partial "function/image.html" (dict "src" $image "alt" "featured image") -}}
{{- partial "plugin/image.html" (dict "src" $image "alt" "featured image") -}}
</div>
{{- end -}}
@ -44,7 +44,7 @@
{{- /* Summary content */ -}}
<div class="content">
{{- partial "function/content.html" .Summary -}}
{{- partial "single/content.html" .Summary -}}
</div>
{{- /* Footer */ -}}

View file

@ -0,0 +1,9 @@
{{- /* Checkbox unchecked */ -}}
{{- $REin := `<input disabled="" type="checkbox">` -}}
{{- $REout := `<i class="far fa-check-square fa-fw"></i>` -}}
{{- $content := replaceRE $REin $REout . -}}
{{- /* Checkbox checked */ -}}
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
{{- $REout = `<i class="far fa-square fa-fw"></i>` -}}
{{- return replaceRE $REin $REout $content -}}

View file

@ -1,28 +0,0 @@
{{- /* Font Awesome */ -}}
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
{{- $REin := `:\(([\w- ]+?)\):` -}}
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
{{- $content := replaceRE $REin $REout . -}}
{{- /* Ruby */ -}}
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
{{- $content = replaceRE $REin $REout $content -}}
{{- /* Checkbox */ -}}
{{- $REin = `<input disabled="" type="checkbox">` -}}
{{- $REout = `<i class="far fa-check-square fa-fw"></i>` -}}
{{- $content = replaceRE $REin $REout $content -}}
{{- /* Checkbox checked */ -}}
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
{{- $REout = `<i class="far fa-square fa-fw"></i>` -}}
{{- $content = replaceRE $REin $REout $content -}}
{{- /* Fix <sup>[return]</sup> */ -}}
{{- $REin = `<sup>\[return\]</sup>` -}}
{{- $REout = `↩︎` -}}
{{- $content = replaceRE $REin $REout $content -}}
{{- $content | safeHTML -}}

View file

@ -0,0 +1,5 @@
{{- /* Font Awesome */ -}}
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
{{- $REin := `:\(([\w- ]+?)\):` -}}
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
{{- return replaceRE $REin $REout . -}}

View file

@ -1,3 +0,0 @@
<a href="{{ index . `href` | safeURL }}" rel="me noopener noreffer" target="_blank" title="{{ index . `title` }}">
{{- partial "function/icon.html" . -}}
</a>

View file

@ -0,0 +1,5 @@
{{- /* Ruby */ -}}
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
{{- $REin := `\[(.+?)\]\^\((.+?)\)` -}}
{{- $REout := `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
{{- return replaceRE $REin $REout . -}}

View file

@ -32,7 +32,7 @@
<div class="home-social-links">
{{- if .Site.Params.home.profile.social -}}
{{- partial "home/social.html" . -}}
{{- partial "plugin/social.html" . -}}
{{- end -}}
</div>
</div>

View file

@ -1,432 +0,0 @@
{{- /* 001: Github */ -}}
{{- with .Site.Params.Social.Github -}}
{{- $options := dict "href" (printf "https://github.com/%s" .) "title" "GitHub" -}}
{{- $options = dict "class" "fab fa-github-alt fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 002: LinkedIn */ -}}
{{- with .Site.Params.Social.LinkedIn -}}
{{- $options := dict "href" (printf "https://linkedin.com/in/%s" .) "title" "LinkedIn" -}}
{{- $options = dict "class" "fab fa-linkedin fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 003: Twitter */ -}}
{{- with .Site.Params.Social.Twitter -}}
{{- $options := dict "href" (printf "https://twitter.com/%s" .) "title" "Twitter" -}}
{{- $options = dict "class" "fab fa-twitter fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 004: Instagram */ -}}
{{- with .Site.Params.Social.Instagram -}}
{{- $options := dict "href" (printf "https://www.instagram.com/%s" .) "title" "Instagram" -}}
{{- $options = dict "class" "fab fa-instagram fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 005: Facebook */ -}}
{{- with .Site.Params.Social.Facebook -}}
{{- $options := dict "href" (printf "https://facebook.com/%s" .) "title" "Facebook" -}}
{{- $options = dict "class" "fab fa-facebook fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 006: Telegram */ -}}
{{- with .Site.Params.Social.Telegram -}}
{{- $options := dict "href" (printf "https://t.me/%s" .) "title" "Telegram" -}}
{{- $options = dict "class" "fab fa-telegram-plane fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 007: Medium */ -}}
{{- with .Site.Params.Social.Medium -}}
{{- $options := dict "href" (printf "https://medium.com/%s" .) "title" "Medium" -}}
{{- $options = dict "class" "fab fa-medium fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 008: Medium */ -}}
{{- with .Site.Params.Social.Gitlab -}}
{{- $options := dict "href" (printf "https://gitlab.com/%s" .) "title" "GitLab" -}}
{{- $options = dict "class" "fab fa-gitlab fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 009: YouTube Legacy */ -}}
{{- with .Site.Params.Social.Youtubelegacy -}}
{{- $options := dict "href" (printf "https://www.youtube.com/user/%s" .) "title" "YouTube" -}}
{{- $options = dict "class" "fab fa-youtube fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 010: YouTube Custom */ -}}
{{- with .Site.Params.Social.Youtubecustom -}}
{{- $options := dict "href" (printf "https://www.youtube.com/c/%s" .) "title" "YouTube" -}}
{{- $options = dict "class" "fab fa-youtube fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 011: Youtube Channel */ -}}
{{- with .Site.Params.Social.Youtubechannel -}}
{{- $options := dict "href" (printf "https://www.youtube.com/channel/%s" .) "title" "YouTube" -}}
{{- $options = dict "class" "fab fa-youtube fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 012: Tumblr */ -}}
{{- with .Site.Params.Social.Tumblr -}}
{{- $options := dict "href" (printf "https://%s.tumblr.com" .) "title" "Tumblr" -}}
{{- $options = dict "class" "fab fa-tumblr fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 013: Quora */ -}}
{{- with .Site.Params.Social.Quora -}}
{{- $options := dict "href" (printf "https://www.quora.com/profile/%s" .) "title" "Quora" -}}
{{- $options = dict "class" "fab fa-quora fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 014: Keybase */ -}}
{{- with .Site.Params.Social.Keybase -}}
{{- $options := dict "href" (printf "https://keybase.io/%s" .) "title" "Keybase" -}}
{{- $options = dict "class" "fab fa-keybase fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 015: Pinterest */ -}}
{{- with .Site.Params.Social.Pinterest -}}
{{- $options := dict "href" (printf "https://www.pinterest.com/%s" .) "title" "Pinterest" -}}
{{- $options = dict "class" "fab fa-pinterest fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 016: Reddit */ -}}
{{- with .Site.Params.Social.Reddit -}}
{{- $options := dict "href" (printf "https://www.reddit.com/user/%s" .) "title" "Reddit" -}}
{{- $options = dict "class" "fab fa-reddit fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 017: CodePen */ -}}
{{- with .Site.Params.Social.Codepen -}}
{{- $options := dict "href" (printf "https://codepen.io/%s" .) "title" "CodePen" -}}
{{- $options = dict "class" "fab fa-codepen fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 018: freeCodeCamp */ -}}
{{- with .Site.Params.Social.FreeCodeCamp -}}
{{- $options := dict "href" (printf "https://freecodecamp.org/%s" .) "title" "freeCodeCamp" -}}
{{- $options = dict "class" "fab fa-free-code-camp fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 019: Bitbucket */ -}}
{{- with .Site.Params.Social.Bitbucket -}}
{{- $options := dict "href" (printf "https://bitbucket.org/%s" .) "title" "Bitbucket" -}}
{{- $options = dict "class" "fab fa-bitbucket fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 020: Stack Overflow */ -}}
{{- with .Site.Params.Social.Stackoverflow -}}
{{- $options := dict "href" (printf "https://stackoverflow.com/users/%s" .) "title" "Stack Overflow" -}}
{{- $options = dict "class" "fab fa-stack-overflow fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 021: 微博 */ -}}
{{- with .Site.Params.Social.Weibo -}}
{{- $options := dict "href" (printf "https://weibo.com/%s" .) "title" "微博" -}}
{{- $options = dict "class" "fab fa-weibo fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 022: OK.RU */ -}}
{{- with .Site.Params.Social.Odnoklassniki -}}
{{- $options := dict "href" (printf "https://ok.ru/%s" .) "title" "OK.RU" -}}
{{- $options = dict "class" "fab fa-odnoklassniki fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 023: VK */ -}}
{{- with .Site.Params.Social.VK -}}
{{- $options := dict "href" (printf "https://vk.com/%s" .) "title" "VK" -}}
{{- $options = dict "class" "fab fa-vk fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 024: Flickr */ -}}
{{- with .Site.Params.Social.Flickr -}}
{{- $options := dict "href" (printf "https://www.flickr.com/photos/%s" .) "title" "Flickr" -}}
{{- $options = dict "class" "fab fa-flickr fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 025: Xing */ -}}
{{- with .Site.Params.Social.Xing -}}
{{- $options := dict "href" (printf "https://www.xing.com/profile/%s" .) "title" "Xing" -}}
{{- $options = dict "class" "fab fa-xing fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 026: Snapchat */ -}}
{{- with .Site.Params.Social.Snapchat -}}
{{- $options := dict "href" (printf "https://www.snapchat.com/add/%s" .) "title" "Snapchat" -}}
{{- $options = dict "class" "fab fa-snapchat fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 027: SoundCloud */ -}}
{{- with .Site.Params.Social.Soundcloud -}}
{{- $options := dict "href" (printf "https://soundcloud.com/%s" .) "title" "SoundCloud" -}}
{{- $options = dict "class" "fab fa-soundcloud fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 028: Spotify */ -}}
{{- with .Site.Params.Social.Spotify -}}
{{- $options := dict "href" (printf "https://open.spotify.com/user/%s" .) "title" "Spotify" -}}
{{- $options = dict "class" "fab fa-spotify fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 029: Bandcamp */ -}}
{{- with .Site.Params.Social.Bandcamp -}}
{{- $options := dict "href" (printf "https://%s.bandcamp.com/" .) "title" "Bandcamp" -}}
{{- $options = dict "class" "fab fa-bandcamp fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 030: PayPal */ -}}
{{- with .Site.Params.Social.Paypal -}}
{{- $options := dict "href" (printf "https://paypal.me/%s" .) "title" "PayPal" -}}
{{- $options = dict "class" "fab fa-paypal fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 031: 500px */ -}}
{{- with .Site.Params.Social.Fivehundredpx -}}
{{- $options := dict "href" (printf "https://500px.com/%s" .) "title" "500px" -}}
{{- $options = dict "class" "fab fa-500px fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 032: Mix */ -}}
{{- with .Site.Params.Social.Mix -}}
{{- $options := dict "href" (printf "https://mix.com/%s" .) "title" "Mix" -}}
{{- $options = dict "class" "fab fa-mix fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 033: Goodreads */ -}}
{{- with .Site.Params.Social.Goodreads -}}
{{- $options := dict "href" (printf "https://www.goodreads.com/user/show/%s" .) "title" "Goodreads" -}}
{{- $options = dict "class" "fab fa-goodreads fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 034: Last.fm */ -}}
{{- with .Site.Params.Social.Lastfm -}}
{{- $options := dict "href" (printf "https://www.last.fm/user/%s" .) "title" "Last.fm" -}}
{{- $options = dict "class" "fab fa-lastfm fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 035: Foursquare */ -}}
{{- with .Site.Params.Social.Foursquare -}}
{{- $options := dict "href" (printf "https://foursquare.com/%s" .) "title" "Foursquare" -}}
{{- $options = dict "class" "fab fa-foursquare fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 036: Hacker News */ -}}
{{- with .Site.Params.Social.Hackernews -}}
{{- $options := dict "href" (printf "https://news.ycombinator.com/user?id=%s" .) "title" "Hacker News" -}}
{{- $options = dict "class" "fab fa-hacker-news fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 037: Kickstarter */ -}}
{{- with .Site.Params.Social.Kickstarter -}}
{{- $options := dict "href" (printf "https://kickstarter.com/profile/%s" .) "title" "Kickstarter" -}}
{{- $options = dict "class" "fab fa-kickstarter fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 038: Patreon */ -}}
{{- with .Site.Params.Social.Patreon -}}
{{- $options := dict "href" (printf "https://patreon.com/%s" .) "title" "Patreon" -}}
{{- $options = dict "class" "fab fa-patreon fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 039: Steam */ -}}
{{- with .Site.Params.Social.Steam -}}
{{- $options := dict "href" (printf "https://steamcommunity.com/id/%s" .) "title" "Steam" -}}
{{- $options = dict "class" "fab fa-steam fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 040: Twitch */ -}}
{{- with .Site.Params.Social.Twitch -}}
{{- $options := dict "href" (printf "https://www.twitch.tv/%s" .) "title" "Twitch" -}}
{{- $options = dict "class" "fab fa-twitch fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 041: Strava */ -}}
{{- with .Site.Params.Social.Strava -}}
{{- $options := dict "href" (printf "https://www.strava.com/athletes/%s" .) "title" "Strava" -}}
{{- $options = dict "class" "fab fa-strava fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 042: Skype */ -}}
{{- with .Site.Params.Social.Skype -}}
{{- $options := dict "href" (printf "skype:%s" .) "title" "Skype" -}}
{{- $options = dict "class" "fab fa-skype fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 043: WhatsApp */ -}}
{{- with .Site.Params.Social.Whatsapp -}}
{{- $options := dict "href" (printf "https://wa.me/%s" .) "title" "WhatsApp" -}}
{{- $options = dict "class" "fab fa-whatsapp fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 044: 知乎 */ -}}
{{- with .Site.Params.Social.Zhihu -}}
{{- $options := dict "href" (printf "https://www.zhihu.com/people/%s" .) "title" "知乎" -}}
{{- $options = dict "class" "loveit it-zhihu-line" "type" "other" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 045: Angellist */ -}}
{{- with .Site.Params.Social.Angellist -}}
{{- $options := dict "href" (printf "https://angel.co/%s" .) "title" "Angellist" -}}
{{- $options = dict "class" "fab fa-angellist fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 046: SlideShare */ -}}
{{- with .Site.Params.Social.Slideshare -}}
{{- $options := dict "href" (printf "https://slideshare.com/%s" .) "title" "SlideShare" -}}
{{- $options = dict "class" "fab fa-slideshare fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 047: JSFiddle */ -}}
{{- with .Site.Params.Social.Jsfiddle -}}
{{- $options := dict "href" (printf "https://jsfiddle.com/%s" .) "title" "JSFiddle" -}}
{{- $options = dict "class" "fab fa-jsfiddle fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 048: DeviantArt */ -}}
{{- with .Site.Params.Social.Deviantart -}}
{{- $options := dict "href" (printf "https://%s.deviantart.com/" .) "title" "DeviantArt" -}}
{{- $options = dict "class" "fab fa-deviantart fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 049: Behance */ -}}
{{- with .Site.Params.Social.Behance -}}
{{- $options := dict "href" (printf "https://behance.net/%s" .) "title" "Behance" -}}
{{- $options = dict "class" "fab fa-behance fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 050: Dribbble */ -}}
{{- with .Site.Params.Social.Dribble -}}
{{- $options := dict "href" (printf "https://dribbble.com/%s" .) "title" "Dribbble" -}}
{{- $options = dict "class" "fab fa-dribbble fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 051: WordPress */ -}}
{{- with .Site.Params.Social.Wordpress -}}
{{- $options := dict "href" (printf "https://%s.wordpress.com/" .) "title" "WordPress" -}}
{{- $options = dict "class" "fab fa-wordpress fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 052: Vine */ -}}
{{- with .Site.Params.Social.Vine -}}
{{- $options := dict "href" (printf "https://vine.co/%s" .) "title" "Vine" -}}
{{- $options = dict "class" "fab fa-vine fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 053: Google Scholar */ -}}
{{- with .Site.Params.Social.Googlescholar -}}
{{- $options := dict "href" (printf "https://scholar.google.com/citations?%s" .) "title" "Google Scholar" -}}
{{- $options = dict "class" "fab fa-google fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 054: ResearchGate */ -}}
{{- with .Site.Params.Social.Researchgate -}}
{{- $options := dict "href" (printf "https://www.researchgate.net/profile/%s" .) "title" "ResearchGate" -}}
{{- $options = dict "class" "fab fa-researchgate fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 055: Mastodon */ -}}
{{- with .Site.Params.Social.Mastodon -}}
{{- $MastodonPrefix := $.Site.Params.Social.MastodonPrefix | default "https://mastodon.social" -}}
{{- $options := dict "href" (printf "%s/%s" $MastodonPrefix .) "title" "Mastodon" -}}
{{- $options = dict "class" "fab fa-mastodon fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 054: Dev.To */ -}}
{{- with .Site.Params.Social.Devto -}}
{{- $options := dict "href" (printf "https://dev.to/%s" .) "title" "Dev.To" -}}
{{- $options = dict "class" "fab fa-dev fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 055: Gitea */ -}}
{{- with .Site.Params.Social.Gitea -}}
{{- $options := dict "href" . "title" "Gitea" -}}
{{- $options = dict "class" "fa fa-gitea fa-fw" "type" "fo" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 056: XMPP */ -}}
{{- with .Site.Params.Social.XMPP -}}
{{- $options := dict "href" (printf "xmpp:%s" .) "title" "XMPP" -}}
{{- $options = dict "class" "fa fa-xmpp fa-fw" "type" "fo" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 057: Matrix */ -}}
{{- with .Site.Params.Social.Matrix -}}
{{- $options := dict "href" (printf "https://matrix.to/#/%s" .) "title" "Matrix" -}}
{{- $options = dict "class" "fa fa-matrix-org fa-fw" "type" "fo" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 058: bilibili */ -}}
{{- with .Site.Params.Social.Bilibili -}}
{{- $options := dict "href" (printf "https://space.bilibili.com/%s" .) "title" "bilibili" -}}
{{- $options = dict "class" "loveit it-bilibili-fill" "type" "other" "scratch" $.Scratch | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* 059: Email */ -}}
{{- with .Site.Params.Social.Email -}}
{{- $options := dict "href" (printf "mailto:%s" .) "title" "Email" -}}
{{- $options = dict "class" "far fa-envelope fa-fw" | merge $options -}}
{{- partial "function/icon-link.html" $options -}}
{{- end -}}
{{- /* Custom */ -}}
{{- with .Site.Params.Social.Custom -}}
{{- . | safeHTML -}}
{{- end -}}

View file

@ -1,11 +1,8 @@
{{- $type := index . "type" | default "fa" -}}
{{- $classList := split (index . "class") " " -}}
{{- $scratch := index . "scratch" -}}
{{- /* Font Awesome */ -}}
{{- if eq $type "fa" -}}
<i class="{{ delimit $classList ` ` }}"></i>
{{- /* Fork Awesome */ -}}
{{- else if eq $type "fo" -}}
{{- if eq $type "fo" -}}
{{- $newClassList := slice -}}
{{- range $classList -}}
{{- if eq . "fa" -}}
@ -14,10 +11,12 @@
{{- $newClassList = $newClassList | append (replaceRE `^fa\-(.+)$` `fo-$1` .) -}}
{{- end -}}
{{- end -}}
<i class="{{ delimit $newClassList ` ` }}"></i>
{{- $classList = $newClassList -}}
{{- $scratch.Set "forkawesome" true -}}
{{- /* default is Font Awesome */ -}}
{{- /* Others */ -}}
{{- else -}}
<i class="{{ delimit $classList ` ` }}"></i>
{{- else if ne $type "fa" -}}
{{- $scratch.Set "iconfont" true -}}
{{- end -}}
<i class="{{ delimit $classList ` ` }}"></i>

View file

@ -0,0 +1,9 @@
{{- $href := index . "href" -}}
<a href="{{ $href | safeURL }}"{{ with index . "title" }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix $href "http" }} target="_blank"{{ end }} rel="noopener noreffer{{ with index . `rel` }} {{ . }}{{ end }}">
{{- with index . "icon" -}}
{{- partial "plugin/icon.html" . -}}
{{- end -}}
{{- with index . "content" -}}
{{- . | safeHTML -}}
{{- end -}}
</a>

View file

@ -4,196 +4,196 @@
{{- /* 001: Twitter */ -}}
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Twitter" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-twitter fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-twitter fa-fw") -}}
</a>
{{- end -}}
{{- /* 002: Facebook */ -}}
{{- if .Params.Share.Facebook | default .Site.Params.Share.Facebook | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-facebook-square fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-facebook-square fa-fw") -}}
</a>
{{- end -}}
{{- /* 003: Linkedin */ -}}
{{- if .Params.Share.Linkedin | default .Site.Params.Share.Linkedin | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
{{- partial "function/icon.html" (dict "class" "fab fa-linkedin fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-linkedin fa-fw") -}}
</a>
{{- end -}}
{{- /* 004: WhatsApp */ -}}
{{- if .Params.Share.Whatsapp | default .Site.Params.Share.Whatsapp | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
{{- partial "function/icon.html" (dict "class" "fab fa-whatsapp fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-whatsapp fa-fw") -}}
</a>
{{- end -}}
{{- /* 005: Viber */ -}}
{{- if .Params.Share.Viber | default .Site.Params.Share.Viber | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-viber fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-viber fa-fw") -}}
</a>
{{- end -}}
{{- /* 006: Pinterest */ -}}
{{- if .Params.Share.Pinterest | default .Site.Params.Share.Pinterest | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-pinterest fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-pinterest fa-fw") -}}
</a>
{{- end -}}
{{- /* 007: Tumblr */ -}}
{{- if .Params.Share.Tumblr | default .Site.Params.Share.Tumblr | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-tumblr fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-tumblr fa-fw") -}}
</a>
{{- end -}}
{{- /* 008: Hacker News */ -}}
{{- if .Params.Share.Hackernews | default .Site.Params.Share.Hackernews | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-hacker-news fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-hacker-news fa-fw") -}}
</a>
{{- end -}}
{{- /* 009: Reddit */ -}}
{{- if .Params.Share.Reddit | default .Site.Params.Share.Reddit | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
{{- partial "function/icon.html" (dict "class" "fab fa-reddit fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-reddit fa-fw") -}}
</a>
{{- end -}}
{{- /* 010: VK */ -}}
{{- if .Params.Share.VK | default .Site.Params.Share.VK | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-vk fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-vk fa-fw") -}}
</a>
{{- end -}}
{{- /* 011: Buffer */ -}}
{{- if .Params.Share.Buffer | default .Site.Params.Share.Buffer | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-buffer fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-buffer fa-fw") -}}
</a>
{{- end -}}
{{- /* 012: Xing */ -}}
{{- if .Params.Share.Xing | default .Site.Params.Share.Xing | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-xing fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-xing fa-fw") -}}
</a>
{{- end -}}
{{- /* 013: Line */ -}}
{{- if .Params.Share.Line | default .Site.Params.Share.Line | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-line fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-line fa-fw") -}}
</a>
{{- end -}}
{{- /* 014: Instapaper */ -}}
{{- if .Params.Share.Instapaper | default .Site.Params.Share.Instapaper | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- partial "function/icon.html" (dict "class" "loveit it-instapaper-fill" "type" "other" "scratch" .Scratch) -}}
{{- partial "plugin/icon.html" (dict "class" "loveit it-instapaper-fill" "type" "other" "scratch" .Scratch) -}}
</a>
{{- end -}}
{{- /* 015: Pocket */ -}}
{{- if .Params.Share.Pocket | default .Site.Params.Share.Pocket | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
{{- partial "function/icon.html" (dict "class" "fab fa-get-pocket fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-get-pocket fa-fw") -}}
</a>
{{- end -}}
{{- /* 016: Digg */ -}}
{{- if .Params.Share.Digg | default .Site.Params.Share.Digg | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
{{- partial "function/icon.html" (dict "class" "fab fa-digg fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-digg fa-fw") -}}
</a>
{{- end -}}
{{- /* 017: StumbleUpon */ -}}
{{- if .Params.Share.Stumbleupon | default .Site.Params.Share.Stumbleupon | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-stumbleupon fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-stumbleupon fa-fw") -}}
</a>
{{- end -}}
{{- /* 018: Flipboard */ -}}
{{- if .Params.Share.Flipboard | default .Site.Params.Share.Flipboard | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-flipboard fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-flipboard fa-fw") -}}
</a>
{{- end -}}
{{- /* 019: 微博 */ -}}
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
{{- partial "function/icon.html" (dict "class" "fab fa-weibo fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-weibo fa-fw") -}}
</a>
{{- end -}}
{{- /* 020: 人人 */ -}}
{{- if .Params.Share.Renren | default .Site.Params.Share.Renren | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
{{- partial "function/icon.html" (dict "class" "fab fa-renren fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-renren fa-fw") -}}
</a>
{{- end -}}
{{- /* 021: Myspace */ -}}
{{- if .Params.Share.Myspace | default .Site.Params.Share.Myspace | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- partial "function/icon.html" (dict "class" "loveit it-myspace-fill" "type" "other" "scratch" .Scratch) -}}
{{- partial "plugin/icon.html" (dict "class" "loveit it-myspace-fill" "type" "other" "scratch" .Scratch) -}}
</a>
{{- end -}}
{{- /* 022: Blogger */ -}}
{{- if .Params.Share.Blogger | default .Site.Params.Share.Blogger | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- partial "function/icon.html" (dict "class" "fab fa-blogger fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-blogger fa-fw") -}}
</a>
{{- end -}}
{{- /* 023: 百度 */ -}}
{{- if .Params.Share.Baidu | default .Site.Params.Share.Baidu | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "loveit it-baidu-fill" "type" "other" "scratch" .Scratch) -}}
{{- partial "plugin/icon.html" (dict "class" "loveit it-baidu-fill" "type" "other" "scratch" .Scratch) -}}
</a>
{{- end -}}
{{- /* 024: OK.RU */ -}}
{{- if .Params.Share.Odnoklassniki | default .Site.Params.Share.Odnoklassniki | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-odnoklassniki fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-odnoklassniki fa-fw") -}}
</a>
{{- end -}}
{{- /* 025: Evernote */ -}}
{{- if .Params.Share.Evernote | default .Site.Params.Share.Evernote | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-evernote fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-evernote fa-fw") -}}
</a>
{{- end -}}
{{- /* 026: Skype */ -}}
{{- if .Params.Share.Skype | default .Site.Params.Share.Skype | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- partial "function/icon.html" (dict "class" "fab fa-skype fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-skype fa-fw") -}}
</a>
{{- end -}}
{{- /* 027: Trello */ -}}
{{- if .Params.Share.Trello | default .Site.Params.Share.Trello | eq true -}}
<a href="javascript:void(0);" title="{{ T `share` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- partial "function/icon.html" (dict "class" "fab fa-trello fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-trello fa-fw") -}}
</a>
{{- end -}}
{{- /* 028: Mix */ -}}
{{- if .Params.Share.Mix | default .Site.Params.Share.Mix | eq true -}}
<a href="//mix.com/add?url={{ .Permalink }}&amp;description={{ .Title }}" target="_blank" title="{{ T `share` }} Mix">
{{- partial "function/icon.html" (dict "class" "fab fa-mix fa-fw") -}}
{{- partial "plugin/icon.html" (dict "class" "fab fa-mix fa-fw") -}}
</a>
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,432 @@
{{- /* 001: Github */ -}}
{{- with .Site.Params.Social.Github -}}
{{- $options := dict "href" (printf "https://github.com/%s" .) "title" "GitHub" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-github-alt fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 002: LinkedIn */ -}}
{{- with .Site.Params.Social.LinkedIn -}}
{{- $options := dict "href" (printf "https://linkedin.com/in/%s" .) "title" "LinkedIn" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-linkedin fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 003: Twitter */ -}}
{{- with .Site.Params.Social.Twitter -}}
{{- $options := dict "href" (printf "https://twitter.com/%s" .) "title" "Twitter" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-twitter fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 004: Instagram */ -}}
{{- with .Site.Params.Social.Instagram -}}
{{- $options := dict "href" (printf "https://www.instagram.com/%s" .) "title" "Instagram" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-instagram fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 005: Facebook */ -}}
{{- with .Site.Params.Social.Facebook -}}
{{- $options := dict "href" (printf "https://facebook.com/%s" .) "title" "Facebook" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-facebook fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 006: Telegram */ -}}
{{- with .Site.Params.Social.Telegram -}}
{{- $options := dict "href" (printf "https://t.me/%s" .) "title" "Telegram" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-telegram-plane fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 007: Medium */ -}}
{{- with .Site.Params.Social.Medium -}}
{{- $options := dict "href" (printf "https://medium.com/%s" .) "title" "Medium" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-medium fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 008: Medium */ -}}
{{- with .Site.Params.Social.Gitlab -}}
{{- $options := dict "href" (printf "https://gitlab.com/%s" .) "title" "GitLab" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-gitlab fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 009: YouTube Legacy */ -}}
{{- with .Site.Params.Social.Youtubelegacy -}}
{{- $options := dict "href" (printf "https://www.youtube.com/user/%s" .) "title" "YouTube" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-youtube fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 010: YouTube Custom */ -}}
{{- with .Site.Params.Social.Youtubecustom -}}
{{- $options := dict "href" (printf "https://www.youtube.com/c/%s" .) "title" "YouTube" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-youtube fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 011: Youtube Channel */ -}}
{{- with .Site.Params.Social.Youtubechannel -}}
{{- $options := dict "href" (printf "https://www.youtube.com/channel/%s" .) "title" "YouTube" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-youtube fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 012: Tumblr */ -}}
{{- with .Site.Params.Social.Tumblr -}}
{{- $options := dict "href" (printf "https://%s.tumblr.com" .) "title" "Tumblr" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-tumblr fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 013: Quora */ -}}
{{- with .Site.Params.Social.Quora -}}
{{- $options := dict "href" (printf "https://www.quora.com/profile/%s" .) "title" "Quora" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-quora fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 014: Keybase */ -}}
{{- with .Site.Params.Social.Keybase -}}
{{- $options := dict "href" (printf "https://keybase.io/%s" .) "title" "Keybase" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-keybase fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 015: Pinterest */ -}}
{{- with .Site.Params.Social.Pinterest -}}
{{- $options := dict "href" (printf "https://www.pinterest.com/%s" .) "title" "Pinterest" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-pinterest fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 016: Reddit */ -}}
{{- with .Site.Params.Social.Reddit -}}
{{- $options := dict "href" (printf "https://www.reddit.com/user/%s" .) "title" "Reddit" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-reddit fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 017: CodePen */ -}}
{{- with .Site.Params.Social.Codepen -}}
{{- $options := dict "href" (printf "https://codepen.io/%s" .) "title" "CodePen" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-codepen fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 018: freeCodeCamp */ -}}
{{- with .Site.Params.Social.FreeCodeCamp -}}
{{- $options := dict "href" (printf "https://freecodecamp.org/%s" .) "title" "freeCodeCamp" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-free-code-camp fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 019: Bitbucket */ -}}
{{- with .Site.Params.Social.Bitbucket -}}
{{- $options := dict "href" (printf "https://bitbucket.org/%s" .) "title" "Bitbucket" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-bitbucket fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 020: Stack Overflow */ -}}
{{- with .Site.Params.Social.Stackoverflow -}}
{{- $options := dict "href" (printf "https://stackoverflow.com/users/%s" .) "title" "Stack Overflow" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-stack-overflow fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 021: 微博 */ -}}
{{- with .Site.Params.Social.Weibo -}}
{{- $options := dict "href" (printf "https://weibo.com/%s" .) "title" "微博" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-weibo fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 022: OK.RU */ -}}
{{- with .Site.Params.Social.Odnoklassniki -}}
{{- $options := dict "href" (printf "https://ok.ru/%s" .) "title" "OK.RU" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-odnoklassniki fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 023: VK */ -}}
{{- with .Site.Params.Social.VK -}}
{{- $options := dict "href" (printf "https://vk.com/%s" .) "title" "VK" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-vk fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 024: Flickr */ -}}
{{- with .Site.Params.Social.Flickr -}}
{{- $options := dict "href" (printf "https://www.flickr.com/photos/%s" .) "title" "Flickr" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-flickr fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 025: Xing */ -}}
{{- with .Site.Params.Social.Xing -}}
{{- $options := dict "href" (printf "https://www.xing.com/profile/%s" .) "title" "Xing" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-xing fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 026: Snapchat */ -}}
{{- with .Site.Params.Social.Snapchat -}}
{{- $options := dict "href" (printf "https://www.snapchat.com/add/%s" .) "title" "Snapchat" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-snapchat fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 027: SoundCloud */ -}}
{{- with .Site.Params.Social.Soundcloud -}}
{{- $options := dict "href" (printf "https://soundcloud.com/%s" .) "title" "SoundCloud" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-soundcloud fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 028: Spotify */ -}}
{{- with .Site.Params.Social.Spotify -}}
{{- $options := dict "href" (printf "https://open.spotify.com/user/%s" .) "title" "Spotify" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-spotify fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 029: Bandcamp */ -}}
{{- with .Site.Params.Social.Bandcamp -}}
{{- $options := dict "href" (printf "https://%s.bandcamp.com/" .) "title" "Bandcamp" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-bandcamp fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 030: PayPal */ -}}
{{- with .Site.Params.Social.Paypal -}}
{{- $options := dict "href" (printf "https://paypal.me/%s" .) "title" "PayPal" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-paypal fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 031: 500px */ -}}
{{- with .Site.Params.Social.Fivehundredpx -}}
{{- $options := dict "href" (printf "https://500px.com/%s" .) "title" "500px" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-500px fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 032: Mix */ -}}
{{- with .Site.Params.Social.Mix -}}
{{- $options := dict "href" (printf "https://mix.com/%s" .) "title" "Mix" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-mix fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 033: Goodreads */ -}}
{{- with .Site.Params.Social.Goodreads -}}
{{- $options := dict "href" (printf "https://www.goodreads.com/user/show/%s" .) "title" "Goodreads" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-goodreads fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 034: Last.fm */ -}}
{{- with .Site.Params.Social.Lastfm -}}
{{- $options := dict "href" (printf "https://www.last.fm/user/%s" .) "title" "Last.fm" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-lastfm fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 035: Foursquare */ -}}
{{- with .Site.Params.Social.Foursquare -}}
{{- $options := dict "href" (printf "https://foursquare.com/%s" .) "title" "Foursquare" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-foursquare fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 036: Hacker News */ -}}
{{- with .Site.Params.Social.Hackernews -}}
{{- $options := dict "href" (printf "https://news.ycombinator.com/user?id=%s" .) "title" "Hacker News" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-hacker-news fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 037: Kickstarter */ -}}
{{- with .Site.Params.Social.Kickstarter -}}
{{- $options := dict "href" (printf "https://kickstarter.com/profile/%s" .) "title" "Kickstarter" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-kickstarter fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 038: Patreon */ -}}
{{- with .Site.Params.Social.Patreon -}}
{{- $options := dict "href" (printf "https://patreon.com/%s" .) "title" "Patreon" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-patreon fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 039: Steam */ -}}
{{- with .Site.Params.Social.Steam -}}
{{- $options := dict "href" (printf "https://steamcommunity.com/id/%s" .) "title" "Steam" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-steam fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 040: Twitch */ -}}
{{- with .Site.Params.Social.Twitch -}}
{{- $options := dict "href" (printf "https://www.twitch.tv/%s" .) "title" "Twitch" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-twitch fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 041: Strava */ -}}
{{- with .Site.Params.Social.Strava -}}
{{- $options := dict "href" (printf "https://www.strava.com/athletes/%s" .) "title" "Strava" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-strava fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 042: Skype */ -}}
{{- with .Site.Params.Social.Skype -}}
{{- $options := dict "href" (printf "skype:%s" .) "title" "Skype" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-skype fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 043: WhatsApp */ -}}
{{- with .Site.Params.Social.Whatsapp -}}
{{- $options := dict "href" (printf "https://wa.me/%s" .) "title" "WhatsApp" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-whatsapp fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 044: 知乎 */ -}}
{{- with .Site.Params.Social.Zhihu -}}
{{- $options := dict "href" (printf "https://www.zhihu.com/people/%s" .) "title" "知乎" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "loveit it-zhihu-line" "type" "other" "scratch" $.Scratch) | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 045: Angellist */ -}}
{{- with .Site.Params.Social.Angellist -}}
{{- $options := dict "href" (printf "https://angel.co/%s" .) "title" "Angellist" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-angellist fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 046: SlideShare */ -}}
{{- with .Site.Params.Social.Slideshare -}}
{{- $options := dict "href" (printf "https://slideshare.com/%s" .) "title" "SlideShare" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-slideshare fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 047: JSFiddle */ -}}
{{- with .Site.Params.Social.Jsfiddle -}}
{{- $options := dict "href" (printf "https://jsfiddle.com/%s" .) "title" "JSFiddle" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-jsfiddle fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 048: DeviantArt */ -}}
{{- with .Site.Params.Social.Deviantart -}}
{{- $options := dict "href" (printf "https://%s.deviantart.com/" .) "title" "DeviantArt" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-deviantart fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 049: Behance */ -}}
{{- with .Site.Params.Social.Behance -}}
{{- $options := dict "href" (printf "https://behance.net/%s" .) "title" "Behance" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-behance fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 050: Dribbble */ -}}
{{- with .Site.Params.Social.Dribble -}}
{{- $options := dict "href" (printf "https://dribbble.com/%s" .) "title" "Dribbble" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-dribbble fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 051: WordPress */ -}}
{{- with .Site.Params.Social.Wordpress -}}
{{- $options := dict "href" (printf "https://%s.wordpress.com/" .) "title" "WordPress" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-wordpress fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 052: Vine */ -}}
{{- with .Site.Params.Social.Vine -}}
{{- $options := dict "href" (printf "https://vine.co/%s" .) "title" "Vine" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-vine fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 053: Google Scholar */ -}}
{{- with .Site.Params.Social.Googlescholar -}}
{{- $options := dict "href" (printf "https://scholar.google.com/citations?%s" .) "title" "Google Scholar" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-google fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 054: ResearchGate */ -}}
{{- with .Site.Params.Social.Researchgate -}}
{{- $options := dict "href" (printf "https://www.researchgate.net/profile/%s" .) "title" "ResearchGate" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-researchgate fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 055: Mastodon */ -}}
{{- with .Site.Params.Social.Mastodon -}}
{{- $MastodonPrefix := $.Site.Params.Social.MastodonPrefix | default "https://mastodon.social" -}}
{{- $options := dict "href" (printf "%s/%s" $MastodonPrefix .) "title" "Mastodon" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-mastodon fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 054: Dev.To */ -}}
{{- with .Site.Params.Social.Devto -}}
{{- $options := dict "href" (printf "https://dev.to/%s" .) "title" "Dev.To" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fab fa-dev fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 055: Gitea */ -}}
{{- with .Site.Params.Social.Gitea -}}
{{- $options := dict "href" . "title" "Gitea" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fa fa-gitea fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 056: XMPP */ -}}
{{- with .Site.Params.Social.XMPP -}}
{{- $options := dict "href" (printf "xmpp:%s" .) "title" "XMPP" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fa fa-xmpp fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 057: Matrix */ -}}
{{- with .Site.Params.Social.Matrix -}}
{{- $options := dict "href" (printf "https://matrix.to/#/%s" .) "title" "Matrix" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "fa fa-matrix-org fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 058: bilibili */ -}}
{{- with .Site.Params.Social.Bilibili -}}
{{- $options := dict "href" (printf "https://space.bilibili.com/%s" .) "title" "bilibili" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "loveit it-bilibili-fill" "type" "other" "scratch" $.Scratch) | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* 059: Email */ -}}
{{- with .Site.Params.Social.Email -}}
{{- $options := dict "href" (printf "mailto:%s" .) "title" "Email" "rel" "me" -}}
{{- $options = dict "icon" (dict "class" "far fa-envelope fa-fw") | merge $options -}}
{{- partial "plugin/link.html" $options -}}
{{- end -}}
{{- /* Custom */ -}}
{{- with .Site.Params.Social.Custom -}}
{{- . | safeHTML -}}
{{- end -}}

View file

@ -0,0 +1,9 @@
{{- $content := . -}}
{{- $content = partial "function/fontawesome.html" $content -}}
{{- $content = partial "function/ruby.html" $content -}}
{{- $content = partial "function/checkbox.html" $content -}}
{{- $content | safeHTML -}}

View file

@ -30,7 +30,7 @@
<div class="post-info-share">
{{- if .Site.Params.page.socialShare -}}
<span>
{{- partial "post/share.html" . -}}
{{- partial "plugin/share.html" . -}}
</span>
{{- end -}}
</div>

View file

@ -46,18 +46,18 @@
{{- /* Featured image */ -}}
{{- with .Params.featuredImage -}}
<div class="featured-image">
{{- partial "function/image.html" (dict "src" . "alt" "featured image") -}}
{{- partial "plugin/image.html" (dict "src" . "alt" "featured image") -}}
</div>
{{- end -}}
{{- /* TOC */ -}}
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
<div class="toc-auto" id="toc-auto">
<div class="toc" id="toc-auto">
<h2 class="toc-title">{{ T "toc" }}</h2>
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
</div>
<div class="toc-static" id="toc-static">
<div class="toc" id="toc-static">
<details>
<summary>
<div class="toc-title">
@ -66,7 +66,10 @@
</div>
</summary>
<div class="toc-content" id="toc-content-static">
{{- .TableOfContents -}}
{{- $toc := .TableOfContents -}}
{{- $toc = partial "function/fontawesome.html" $toc -}}
{{- $toc = partial "function/ruby.html" $toc -}}
{{- $toc | safeHTML -}}
</div>
</details>
</div>
@ -74,11 +77,11 @@
{{- /* Content */ -}}
<div class="content">
{{- partial "function/content.html" .Content -}}
{{- partial "single/content.html" .Content -}}
</div>
{{- /* Footer */ -}}
{{- partial "post/footer.html" . -}}
{{- partial "single/footer.html" . -}}
{{- /* Comment */ -}}
<div class="comment">

View file

@ -23,14 +23,18 @@
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
</summary>
{{- end -}}
{{- $inner -}}
<div class="admonition-content">
{{- $inner -}}
</div>
</details>
{{- else -}}
<div class="admonition {{ $type }}">
{{- with .Get "title" -}}
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
{{- end -}}
{{- $inner -}}
<div class="admonition-content">
{{- $inner -}}
</div>
</div>
{{- end -}}
{{- else -}}
@ -42,14 +46,18 @@
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
</summary>
{{- end -}}
{{- $inner -}}
<div class="admonition-content">
{{- $inner -}}
</div>
</details>
{{- else -}}
<div class="admonition {{ $type }}">
{{- with .Get 1 -}}
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
{{- end -}}
{{- $inner -}}
<div class="admonition-content">
{{- $inner -}}
</div>
</div>
{{- end -}}
{{- end -}}

File diff suppressed because one or more lines are too long

View file

@ -94,7 +94,7 @@
initHeaderLink() {
for (let num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.content > h' + num), (header) => {
this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), (header) => {
header.classList.add('headerLink');
header.innerHTML = `<a href="#${header.id}"></a>${header.innerHTML}`;
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long