From 5b1a6aa6ce045c7d176acc9e34ecf64e15da7ae9 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 4 Oct 2024 02:35:55 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20=E8=B0=83=E6=95=B4=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=99=A8=E5=89=AF=E6=A0=87=E9=A2=98=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _content.gotmpl | 7 ++++++- i18n/en.toml | 1 + i18n/zh-CN.toml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/_content.gotmpl b/_content.gotmpl index 5bb58e2..4e5ceb2 100644 --- a/_content.gotmpl +++ b/_content.gotmpl @@ -59,6 +59,11 @@ -}} {{- $categories := $group.categories | default $projectsAdapters.categories -}} {{- $collections := $group.collections | default $projectsAdapters.collections -}} + {{- $subtitle := T "projects.source" (dict + "Name" $repoInfo.full_name + "Link" $repoInfo.html_url + "Website" $repoInfo.homepage + ) -}} {{- $params := dict "fromAdapters" "projects" "author" $author @@ -68,7 +73,7 @@ "lightgallery" true "capitalizeTitles" false "toc" (dict "ordered" false) - "subtitle" ($repoInfo.homepage | default $repoInfo.html_url) + "subtitle" $subtitle "sourceURL" (add $readme.html_url "?plain=1") "editURL" (replace $readme.html_url "/blob/" "/edit/" ) "LinkToReport" false diff --git a/i18n/en.toml b/i18n/en.toml index 3af27ab..934c3b2 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -4,6 +4,7 @@ [projects] relatedArticles = "Related Articles" errorGetGhRepo = "failed to fetch repo info from GitHub API, Please check the network!" +source = "Source: [{{ .Name }}]({{ .Link }}){{ with .Website }}
Website: <{{ . }}>{{ end }}" poweredBy = "This page is powered by Component Projects." [projects.totalStarCount] diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index e12c464..2b61b8c 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -5,6 +5,7 @@ [projects] relatedArticles = "相关文章" errorGetGhRepo = "从 GitHub API 获取仓库信息失败,请检查网络!" +source = "来源:[{{ .Name }}]({{ .Link }}){{ with .Website }}
网站:<{{ . }}>{{ end }}" poweredBy = "本页面由 Component Projects 强力驱动。" [projects.totalStarCount]