diff --git a/README.md b/README.md index 51d678dd..28089656 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ It is based on the original [LoveIt Theme](https://github.com/dillonzq/LoveIt), [LeaveIt Theme](https://github.com/liuzc/LeaveIt) and [KeepIt Theme](https://github.com/Fastbyte01/KeepIt). -It is mainly based on [LoveIt Theme](https://github.com/dillonzq/LoveIt) that's repository has stopped maintenance, so i just wanna fix it. +**It is mainly based on [LoveIt Theme](https://github.com/dillonzq/LoveIt) that's repository has stopped maintenance, so i just wanna fix it.** ![Hugo Theme FixIt](https://github.com/Lruihao/FixIt/raw/master/images/Apple-Devices-Preview.png) diff --git a/assets/css/_page/_friends.scss b/assets/css/_page/_friends.scss new file mode 100644 index 00000000..f9acfe73 --- /dev/null +++ b/assets/css/_page/_friends.scss @@ -0,0 +1,63 @@ +/** + * @Description: Style of layout named 'Friend links'. + * @Author: lruihao.cn + * @Updated: 2021/9/20 19:26 + */ + +.friend-links { + margin-top: 1rem; + display: flex; + flex-direction: row; + justify-content: space-between; + flex-wrap: wrap; +} +@media (max-width: 576px) { + .friend-links { + justify-content: space-around; + } +} +.friend-link { + width: 150px; + height: 200px; + font-size: 1rem; + text-align: center; + background: rgba(255,255,255,0.3); + box-sizing: border-box; + box-shadow: 3px 3px 5px #aaa; + border-radius: 5px; + border:none; + transition-duration: 0.3s; + margin-bottom: 1rem; + display: flex; + flex-direction: column; + justify-content: space-between; +} +.friend-link:hover { + background: #fff; + transform: scale(1.03); + box-shadow: 0 0 3px #aaa; +} +.friend-avatar { + object-fit: cover; + object-position: center; + width: 100%!important; + height: 150px!important; + border-radius: 5px; + margin: 0; + padding: 0; +} +.friend-nickname{ + display: block; + position: relative; + color: #2bbc8a; + font-weight: bold; + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + line-height: 18px; + margin-bottom: 1rem; +} +.friend-nickname:hover { + color: #d480aa; +} \ No newline at end of file diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss index 0cd511fc..579c85d9 100644 --- a/assets/css/_page/_index.scss +++ b/assets/css/_page/_index.scss @@ -20,3 +20,4 @@ @import "_archive"; @import "_home"; @import "_404"; +@import "_friends"; diff --git a/assets/css/_page/_single.scss b/assets/css/_page/_single.scss index 6d550cc2..ceef74d6 100644 --- a/assets/css/_page/_single.scss +++ b/assets/css/_page/_single.scss @@ -52,7 +52,7 @@ } .content { - > h2 { + > h1, > h2 { font-size: 1.5rem; & code { @@ -273,6 +273,7 @@ @import "../_partial/_single/mapbox"; @import "../_partial/_single/music"; @import "../_partial/_single/bilibili"; + @import "../_partial/_single/cardlink"; hr { margin: 1rem 0; diff --git a/assets/css/_partial/_archive/_terms.scss b/assets/css/_partial/_archive/_terms.scss index 1f63a47d..d1cd3d4c 100644 --- a/assets/css/_partial/_archive/_terms.scss +++ b/assets/css/_partial/_archive/_terms.scss @@ -71,6 +71,7 @@ width: 4em; text-align: right; color: $global-font-secondary-color; + white-space: nowrap; [theme=dark] & { color: $global-font-secondary-color-dark; diff --git a/assets/css/_partial/_footer.scss b/assets/css/_partial/_footer.scss index 21a89e8c..c5417b02 100644 --- a/assets/css/_partial/_footer.scss +++ b/assets/css/_partial/_footer.scss @@ -14,6 +14,10 @@ footer { .icp-br { display: none; } + + .fa-ban { + color: Tomato; + } } } diff --git a/assets/css/_partial/_single/_cardlink.scss b/assets/css/_partial/_single/_cardlink.scss new file mode 100644 index 00000000..d516a8e1 --- /dev/null +++ b/assets/css/_partial/_single/_cardlink.scss @@ -0,0 +1,97 @@ +//卡片式链接样式 cardlink + +.card-link,.card-link:hover { + text-decoration: none; + border: none!important; + color: inherit!important +} + +.card-link { + position: relative; + display: block; + margin: 1em auto; + width: 390px; + box-sizing: border-box; + border-radius: 12px; + max-width: 100%; + overflow: hidden; + color: inherit; + text-decoration: none +} + +.ztext { + word-break: break-word; + line-height: 1.6 +} + +.card-link-backdrop { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-image: url(/lib/img/card-link-bg.jpg); + background-repeat: no-repeat; + -webkit-filter: blur(20px); + filter: blur(20px); + background-size: cover; + background-position: center +} + +.card-link,.card-link:hover { + text-decoration: none; + border: none!important; + color: inherit!important +} + +.card-link-content { + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px; + border-radius: inherit; + background-color: rgba(246,246,246,0.88) +} + +.card-link-text { + overflow: hidden +} + +.card-link-title { + display: -webkit-box; + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + max-height: calc(16px * 1.25 * 2); + font-size: 16px; + font-weight: 500; + line-height: 1.25; + color: #1a1a1a +} + +.card-link-meta { + display: flex; + margin-top: 4px; + font-size: 14px; + line-height: 20px; + color: #999; + white-space: nowrap +} + +.card-link-url { + display: inline-flex; + align-items: center; +} + +.card-link-imageCell { + margin-left: 8px; + border-radius: 6px +} + +.card-link-image { + display: block; + width: 60px; + height: 60px; + border-radius: inherit +} \ No newline at end of file diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml new file mode 100644 index 00000000..ea822a00 --- /dev/null +++ b/i18n/zh-TW.toml @@ -0,0 +1,203 @@ +# Translations for Traditional Chinese +# 簡體中文的翻譯 +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# === baseof == +[backToTop] +other = "回到頂部" + +[viewComments] +other = "查看評論" +# === baseof == + +# === Post === +[posts] +other = "文章" +# === Post === + +# === Taxonomy === +[allSome] +other = "所有{{ .Some }}" + +[tag] +other = "標籤" + +[tags] +other = "標籤" + +[category] +other = "分類" + +[categories] +other = "分類" + +[years] +other = "年度總結" +# === Taxonomy === + +# === Pagination === +[more] +other = "更多" +# === Pagination === + +# === partials/header.html === +[selectLanguage] +other = "選擇語言" + +[switchTheme] +other = "切換主題" +# === partials/header.html === + +# === partials/footer.html === +[poweredBySome] +other = "由 {{ .Hugo }} 強力驅動 | 主題 - {{ .Theme }}" +# === partials/footer.html === + +# === partials/comment.html === +[valineLang] +other = "zh-TW" + +[valinePlaceholder] +other = "你的評論 ..." + +[facebookLanguageCode] +other = "zh-TW" +# === partials/comment.html === + +# === partials/assets.html === +[search] +other = "搜尋" + +[searchPlaceholder] +other = "搜尋文章標題或內容..." + +[clear] +other = "清空" + +[cancel] +other = "取消" + +[noResultsFound] +other = "沒有找到結果" + +[lunrLanguageCode] +other = "zh" + +[lunrLanguageLib] +other = "lib/lunr/lunr.zh.js" + +[lunrSegmentitLib] +other = "lib/lunr/lunr.segmentit.js" + +[copyToClipboard] +other = "複製到剪貼板" + +[cookieconsentMessage] +other = "本網站使用 Cookies 來改善您的流覽體驗." + +[cookieconsentDismiss] +other = "同意" + +[cookieconsentLink] +other = "瞭解更多" +# === partials/assets.html === + +# === partials/plugin/share.html === +[shareOn] +other = "分享到" +# === partials/plugin/share.html === + +# === posts/single.html === +[contents] +other = "目錄" + +[publishedOnDate] +other = "發佈於 {{ .Date }}" + +[includedInCategories] +other = "收錄於 {{ .Categories }}" + +[wordCount] +other = "約 {{ .Count }} 字" + +[readingTime] +other = "預計閱讀 {{ .Count }} 分鐘" + +[views] +other = "次閱讀" + +[author] +other = "作者" + +[updatedOnDate] +other = "更新於 {{ .Date }}" + +[readMarkdown] +other = "閱讀原始文檔" + +[back] +other = "返回" + +[home] +other = "主頁" + +[readMore] +other = "閱讀全文" +# === posts/single.html === + +# === 404.html === +[pageNotFound] +other = "找不到網頁" + +[pageNotFoundText] +other = "抱歉,您要查找的頁面不存在。" +# === 404.html === + +# === shortcodes/admonition.html === +[note] +other = "注意" + +[abstract] +other = "摘要" + +[info] +other = "信息" + +[tip] +other = "技巧" + +[success] +other = "成功" + +[question] +other = "問題" + +[warning] +other = "警告" + +[failure] +other = "失敗" + +[danger] +other = "危險" + +[bug] +other = "Bug" + +[example] +other = "示例" + +[quote] +other = "引用" +# === shortcodes/admonition.html === + +# === shortcodes/version.html === +[new] +other = "新增" + +[changed] +other = "更改" + +[deleted] +other = "刪除" +# === shortcodes/version.html === diff --git a/layouts/friends/single.html b/layouts/friends/single.html new file mode 100644 index 00000000..83c5b5af --- /dev/null +++ b/layouts/friends/single.html @@ -0,0 +1,42 @@ +{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}} + +{{- define "content" -}} +{{- $params := .Scratch.Get "params" -}} +
+ {{- /* Title */ -}} +

+ {{- .Title -}} +

+ + {{- /* Subtitle */ -}} + {{- with $params.subtitle -}} +

{{ . }}

+ {{- end -}} + + {{- /* Friend links */ -}} + {{- $loading := resources.Get "svg/loading.svg" | minify -}} + + + + {{- /* Content */ -}} +
+ {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}} +
+ + {{- /* Comment */ -}} + {{- partial "comment.html" . -}} +
+{{- end -}} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ca4b7850..f0fe6c5b 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -7,12 +7,19 @@ {{- safeHTML . -}} {{- end -}} - - {{- /* Hugo and LoveIt */ -}} + + {{- /* Hugo and FixIt */ -}} {{- if ne .Site.Params.footer.hugo false -}} {{- end -}} diff --git a/layouts/partials/init.html b/layouts/partials/init.html index fdb50d3e..504b25aa 100644 --- a/layouts/partials/init.html +++ b/layouts/partials/init.html @@ -1,12 +1,12 @@ -{{- .Scratch.Set "version" "0.2.10" -}} +{{- .Scratch.Set "version" "0.2.11" -}} -{{- /* LoveIt theme version detection */ -}} +{{- /* FixIt theme version detection */ -}} {{- $VERSION := "0.2.X" -}} {{- if eq .Site .Sites.First -}} {{- if not .Site.Params.version -}} - {{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 LoveIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}} + {{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the FixIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 FixIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}} {{- else if ne .Site.Params.version $VERSION -}} - {{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/dillonzq/LoveIt/releases\n" .Site.Params.version $VERSION) -}} + {{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/Lruihao/FixIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/Lruihao/FixIt/releases\n" .Site.Params.version $VERSION) -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/plugin/cardlink.html b/layouts/partials/plugin/cardlink.html new file mode 100644 index 00000000..2fa65d1b --- /dev/null +++ b/layouts/partials/plugin/cardlink.html @@ -0,0 +1,24 @@ +{{- $rel := "" -}} + + + + + + {{- with .Content -}} + {{- . | safeHTML -}} + {{- end -}} + + + + + + + + {{ .Destination | safeURL }} + + + + card-link icon + + + \ No newline at end of file diff --git a/layouts/partials/rss/item.html b/layouts/partials/rss/item.html index 28256b49..ea08a6e0 100644 --- a/layouts/partials/rss/item.html +++ b/layouts/partials/rss/item.html @@ -10,7 +10,7 @@ {{- .Page.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}} - {{- .params.author | default (T "author") -}} + {{- $params.author | default (T "author") -}} {{- .Page.Permalink -}} diff --git a/layouts/shortcodes/cardlink.html b/layouts/shortcodes/cardlink.html new file mode 100644 index 00000000..96dc4327 --- /dev/null +++ b/layouts/shortcodes/cardlink.html @@ -0,0 +1,15 @@ +{{- $destination := cond .IsNamedParams (.Get "href") (.Get 0) -}} +{{- with dict "Path" $destination "Resources" .Page.Resources | partial "function/resource.html" -}} + {{- $destination = .RelPermalink -}} +{{- end -}} +{{- $options := dict "Destination" $destination -}} +{{- if .IsNamedParams -}} + {{- $options = dict "Content" (.Get "content") | merge $options -}} + {{- $options = dict "Title" (.Get "title") | merge $options -}} + {{- $options = dict "Class" (.Get "class") | merge $options -}} + {{- $options = dict "Rel" (.Get "rel") | merge $options -}} +{{- else -}} + {{- $options = dict "Content" (.Get 1 | default (.Get 0)) | merge $options -}} + {{- $options = dict "Title" (.Get 2) | merge $options -}} +{{- end -}} +{{- partial "plugin/cardlink.html" $options -}} diff --git a/static/lib/img/card-link-bg.jpg b/static/lib/img/card-link-bg.jpg new file mode 100644 index 00000000..e34661ac Binary files /dev/null and b/static/lib/img/card-link-bg.jpg differ diff --git a/static/lib/img/linkicon.png b/static/lib/img/linkicon.png new file mode 100644 index 00000000..8f68aa5e Binary files /dev/null and b/static/lib/img/linkicon.png differ