diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss index 1a8d7f1..5eae6f2 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/custom.scss @@ -55,23 +55,98 @@ } } -@media (min-width: 1024px) { - .article-list--compact.links { - display: grid; - grid-template-columns: 1fr 1fr; - background: none; - box-shadow: none; +.links-section { + margin-bottom: 10px; +} - article { - background: var(--card-background); - border: none; - box-shadow: var(--shadow-l2); - margin-bottom: 8px; - border-radius: 10px; - &:nth-child(odd) { - margin-right: 8px; - } - } +.links-section__header { + margin-bottom: 30px; + padding-bottom: 16px; + border-bottom: 2px solid var(--card-separator-color); + + h1 { + margin: 0; + color: var(--card-text-color-main); + font-size: 2.2rem; + } +} + +.links-grid { + display: grid; + grid-template-columns: 1fr; + gap: 20px; +} + +.link-card { + min-width: 0; + min-height: 132px; + overflow: hidden; + border-radius: var(--card-border-radius); + background: var(--card-background); + box-shadow: var(--shadow-l1); + transition: transform 0.2s ease, box-shadow 0.2s ease; + + &:hover { + transform: translateY(-2px); + box-shadow: var(--shadow-l2); + } + + > a { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 132px; + padding: 24px 28px; + gap: 24px; + } +} + +.link-card__details { + min-width: 0; +} + +.link-card__title { + margin: 0 0 8px; + overflow: hidden; + color: var(--card-text-color-main); + font-size: 1.8rem; + font-weight: 700; + text-overflow: ellipsis; + white-space: nowrap; +} + +.link-card__description { + margin: 0; + overflow: hidden; + color: var(--card-text-color-secondary); + font-size: 1.5rem; + text-overflow: ellipsis; + white-space: nowrap; +} + +.link-card__image { + flex: 0 0 72px; + width: 72px; + height: 72px; + + img { + display: block; + width: 100%; + height: 100%; + border-radius: 12px; + object-fit: cover; + } +} + +@media (min-width: 768px) { + .links-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } +} + +@media (min-width: 1280px) { + .links-grid { + grid-template-columns: repeat(3, minmax(0, 1fr)); } } diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml new file mode 100644 index 0000000..96b5e48 --- /dev/null +++ b/config/_default/hugo.toml @@ -0,0 +1,17 @@ +baseURL = "https://www.taurusxin.com" +locale = "zh" +defaultContentLanguage = "zh" +hasCJKLanguage = true +theme = "hugo-theme-stack" +title = "TaurusXin 的独立博客" +timeout = "60s" + +[services.disqus] +shortname = "taurusxin" + +[pagination] +pagerSize = 10 + +[permalinks] +post = "/:slug/" +page = "/:slug/" diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..6cba4d2 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,16 @@ +[goldmark.renderer] +unsafe = true + +[tableOfContents] +endLevel = 4 +ordered = true +startLevel = 2 + +[highlight] +noClasses = false +codeFences = true +guessSyntax = true +lineNoStart = 1 +lineNos = true +lineNumbersInTable = true +tabWidth = 4 diff --git a/config/_default/menu.toml b/config/_default/menu.toml new file mode 100644 index 0000000..bb3c8f2 --- /dev/null +++ b/config/_default/menu.toml @@ -0,0 +1,74 @@ +[[main]] +identifier = "home" +name = "首页" +url = "/" +weight = 1 +[main.params] +icon = "home" + +[[main]] +identifier = "moments" +name = "拾光" +url = "https://moments.taurusxin.com" +weight = 5 +[main.params] +icon = "moments" +newTab = true + +[[main]] +identifier = "travellings" +name = "开往" +url = "https://www.travellings.cn/go.html" +weight = 6 +[main.params] +icon = "travellings" +newTab = true + +[[main]] +identifier = "rss" +name = "RSS" +url = "/index.xml" +weight = 10 +[main.params] +icon = "rss" +newTab = true + +[[social]] +identifier = "github" +name = "GitHub" +url = "https://github.com/taurusxin" +weight = 1 +[social.params] +icon = "brand-github" + +[[social]] +identifier = "bilibili" +name = "Bilibili" +url = "https://space.bilibili.com/4360325" +weight = 2 +[social.params] +icon = "bilibili" + +[[social]] +identifier = "music" +name = "网易云音乐" +url = "https://music.163.com/#/user/home?id=260531598" +weight = 3 +[social.params] +icon = "music" + +[[social]] +identifier = "mail" +name = "电邮" +url = "mailto:i@taurusxin.com" +weight = 4 +[social.params] +icon = "mail" + +[[social]] +identifier = "travellings" +name = "开往" +url = "https://www.travellings.cn/go.html" +weight = 5 +[social.params] +icon = "travellings" diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..b255a60 --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,100 @@ +mainSections = ["post"] +featuredImageField = "image" +rssFullContent = true +favicon = "" +SortBy = "default" + +[footer] +since = 2018 +customText = "Made with ❤️ in Hangzhou
浙ICP备2022025362号-1" + +[dateFormat] +published = ":date_full" +lastUpdated = ":date_full" + +[sidebar] +emoji = "🍉" +subtitle = "永远年轻 永远热泪盈眶" +compact = false +avatar = "img/avatar.png" + +[article] +headingAnchor = false +math = false +toc = true +readingTime = true + +[article.list] +showTags = false + +[article.license] +enabled = true +default = "Licensed under CC BY-NC-SA 4.0" + +[article.mermaid] +look = "classic" +lightTheme = "default" +darkTheme = "dark" +securityLevel = "strict" +htmlLabels = true +transparentBackground = false + +[article.alertIcon] +note = "" +tip = "" +important = "" +warning = "⚠️" +caution = "" + +[comments] +enabled = true +provider = "artalk" + +[comments.artalk] +serverUrl = "https://artalk.taurusxin.com" +site = "TaurusXin 的独立博客" +darkMode = "auto" + +[widgets] +homepage = [ + { type = "search" }, + { type = "archives", params = { limit = 5 } }, + { type = "categories", params = { limit = 10 } }, + { type = "tag-cloud", params = { limit = 10 } }, + { type = "status", params = { start = "2018-08-04", format = "yyyy 年 MM 月 dd 日" } }, +] +page = [ + { type = "toc" }, +] + +[opengraph.twitter] +site = "" +card = "summary_large_image" + +[colorScheme] +toggle = true +default = "auto" + +[imageProcessing] +autoOrient = false + +[imageProcessing.external] +timeout = "30s" + +[imageProcessing.thumbnail] +enabled = true + +[imageProcessing.content] +widths = [800, 1600, 2400] +enabled = false + +[cookies] +enabled = false +showSettings = true + +[cookies.categories] +analytics = false +functional = true + +[render.image.externalLink] +enabled = true diff --git a/config/_default/related.toml b/config/_default/related.toml new file mode 100644 index 0000000..69017a1 --- /dev/null +++ b/config/_default/related.toml @@ -0,0 +1,11 @@ +includeNewer = true +threshold = 60 +toLower = false + +[[indices]] +name = "tags" +weight = 100 + +[[indices]] +name = "categories" +weight = 200 diff --git a/data/external.toml b/data/external.toml index 7af0949..c35c01a 100644 --- a/data/external.toml +++ b/data/external.toml @@ -16,4 +16,4 @@ Lightbox = "https://cdn.jsdelivr.net/npm/photoswipe@5.4.4/dist/photoswipe-lightb [Artalk] Style = "https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.css" -Script = "https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.js" +Script = "https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.mjs" diff --git a/hugo.toml b/hugo.toml deleted file mode 100644 index 8a00f98..0000000 --- a/hugo.toml +++ /dev/null @@ -1,318 +0,0 @@ -baseURL = "https://www.taurusxin.com" -locale = "zh" -defaultContentLanguage = "zh" -hasCJKLanguage = true -theme = "hugo-theme-stack" -title = "TaurusXin 的独立博客" -timeout = "60s" - -[services.disqus] -shortname = "taurusxin" - -[pagination] -pagerSize = 10 - -[permalinks] -post = "/:slug/" -page = "/:slug/" - -[params] -mainSections = ["post"] -featuredImageField = "image" -rssFullContent = true -favicon = "" -SortBy = "default" - -[params.footer] -since = 2018 -customText = "Made with ❤️ in Hangzhou
浙ICP备2022025362号-1" - -[params.dateFormat] -published = ":date_full" -lastUpdated = ":date_full" - -[params.sidebar] -emoji = "🍉" -subtitle = "永远年轻 永远热泪盈眶" -compact = false -avatar = "img/avatar.png" - -[params.article] -headingAnchor = false -math = false -toc = true -readingTime = true - -[params.article.list] -showTags = false - -[params.article.license] -enabled = true -default = "Licensed under CC BY-NC-SA 4.0" - -[params.article.mermaid] -look = "classic" -lightTheme = "default" -darkTheme = "dark" -securityLevel = "strict" -htmlLabels = true -transparentBackground = false - -[params.article.alertIcon] -note = "" -tip = "" -important = "" -warning = "⚠️" -caution = "" - -[params.comments] -enabled = true -provider = "artalk" - -[params.comments.artalk] -serverUrl = "https://artalk.taurusxin.com" -site = "TaurusXin 的独立博客" -darkMode = "auto" - -[params.comments.disqusjs] -shortname = "taurusxin" -apiUrl = "" -apiKey = "" -admin = "" -adminLabel = "" - -[params.comments.utterances] -repo = "" -issueTerm = "pathname" -label = "" - -[params.comments.beaudar] -repo = "" -issueTerm = "pathname" -label = "" -theme = "" - -[params.comments.remark42] -host = "" -site = "" -locale = "en" -max_shown_comments = 15 -show_email_subscription = true - -[params.comments.vssue] -platform = "" -owner = "" -repo = "" -clientId = "" -clientSecret = "" -autoCreateIssue = false - -[params.comments.waline] -serverURL = "" -lang = "" -pageview = "" -avatar = "" -emoji = ["https://unpkg.com/@waline/emojis@1.0.1/weibo"] -requiredMeta = ["name", "email", "url"] - -[params.comments.waline.locale] -admin = "Admin" -placeholder = "" - -[params.comments.twikoo] -envId = "" -region = "" -path = "" -lang = "" - -[params.comments.cactus] -defaultHomeserverUrl = "https://matrix.cactus.chat:8448" -serverName = "cactus.chat" -siteName = "" - -[params.comments.giscus] -repo = "" -repoID = "" -category = "" -categoryID = "" -mapping = "title" -lightTheme = "light" -darkTheme = "dark_dimmed" -reactionsEnabled = 1 -emitMetadata = 0 -inputPosition = "top" -lang = "en" -strict = 0 -loading = "lazy" - -[params.comments.gitalk] -owner = "" -admin = "" -repo = "" -clientID = "" -clientSecret = "" -proxy = "" - -[params.comments.cusdis] -host = "https://cusdis.com" -id = "" - -[params.comments.comentario] -url = "" -autoInit = false -autoNonInteractiveSso = false -cssOverride = "" -lang = "" -liveUpdate = false -maxLevel = 0 -noFonts = false -theme = "" - -[params.widgets] -homepage = [ - { type = "search" }, - { type = "archives", params = { limit = 5 } }, - { type = "categories", params = { limit = 10 } }, - { type = "tag-cloud", params = { limit = 10 } }, - { type = "status", params = { start = "2018-08-04", format = "yyyy 年 MM 月 dd 日" } }, -] -page = [ - { type = "toc" }, -] - -[params.opengraph.twitter] -site = "" -card = "summary_large_image" - -[params.colorScheme] -toggle = true -default = "auto" - -[params.imageProcessing] -autoOrient = false - -[params.imageProcessing.external] -timeout = "30s" - -[params.imageProcessing.thumbnail] -enabled = true - -[params.imageProcessing.content] -widths = [800, 1600, 2400] -enabled = false - -[params.cookies] -enabled = false -showSettings = true - -[params.cookies.categories] -analytics = false -functional = true - -[params.render.image.externalLink] -enabled = true - -[[menu.main]] -identifier = "home" -name = "首页" -url = "/" -weight = 1 -[menu.main.params] -icon = "home" - -[[menu.main]] -identifier = "moments" -name = "拾光" -url = "https://moments.taurusxin.com" -weight = 5 -[menu.main.params] -icon = "moments" -newTab = true - -[[menu.main]] -identifier = "travellings" -name = "开往" -url = "https://www.travellings.cn/go.html" -weight = 6 -[menu.main.params] -icon = "travellings" -newTab = true - -[[menu.main]] -identifier = "rss" -name = "RSS" -url = "/index.xml" -weight = 10 -[menu.main.params] -icon = "rss" -newTab = true - -[[menu.social]] -identifier = "github" -name = "GitHub" -url = "https://github.com/taurusxin" -weight = 1 -[menu.social.params] -icon = "brand-github" - -[[menu.social]] -identifier = "bilibili" -name = "Bilibili" -url = "https://space.bilibili.com/4360325" -weight = 2 -[menu.social.params] -icon = "bilibili" - -[[menu.social]] -identifier = "music" -name = "网易云音乐" -url = "https://music.163.com/#/user/home?id=260531598" -weight = 3 -[menu.social.params] -icon = "music" - -[[menu.social]] -identifier = "mail" -name = "电邮" -url = "mailto:i@taurusxin.com" -weight = 4 -[menu.social.params] -icon = "mail" - -[[menu.social]] -identifier = "travellings" -name = "开往" -url = "https://www.travellings.cn/go.html" -weight = 5 -[menu.social.params] -icon = "travellings" - -[related] -includeNewer = true -threshold = 60 -toLower = false - -[[related.indices]] -name = "tags" -weight = 100 - -[[related.indices]] -name = "categories" -weight = 200 - -[markup.goldmark.renderer] -unsafe = true - -[markup.tableOfContents] -endLevel = 4 -ordered = true -startLevel = 2 - -[markup.highlight] -noClasses = false -codeFences = true -guessSyntax = true -lineNoStart = 1 -lineNos = true -lineNumbersInTable = true -tabWidth = 4 diff --git a/layouts/_partials/comments/provider/artalk.html b/layouts/_partials/comments/provider/artalk.html deleted file mode 100644 index 23d091c..0000000 --- a/layouts/_partials/comments/provider/artalk.html +++ /dev/null @@ -1,31 +0,0 @@ -{{- $style := resources.Get "scss/partials/comments/artalk.scss" | toCSS | minify -}} -{{- with .Site.Params.comments.artalk -}} -{{- $serverUrl := default .server .serverUrl -}} - - - - - -
- - -{{- end -}}