Skip to content

Commit 5b1a6aa

Browse files
committed
Feat: 调整内容适配器副标题显示的内容
1 parent 2fa4250 commit 5b1a6aa

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

_content.gotmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
-}}
6060
{{- $categories := $group.categories | default $projectsAdapters.categories -}}
6161
{{- $collections := $group.collections | default $projectsAdapters.collections -}}
62+
{{- $subtitle := T "projects.source" (dict
63+
"Name" $repoInfo.full_name
64+
"Link" $repoInfo.html_url
65+
"Website" $repoInfo.homepage
66+
) -}}
6267
{{- $params := dict
6368
"fromAdapters" "projects"
6469
"author" $author
@@ -68,7 +73,7 @@
6873
"lightgallery" true
6974
"capitalizeTitles" false
7075
"toc" (dict "ordered" false)
71-
"subtitle" ($repoInfo.homepage | default $repoInfo.html_url)
76+
"subtitle" $subtitle
7277
"sourceURL" (add $readme.html_url "?plain=1")
7378
"editURL" (replace $readme.html_url "/blob/" "/edit/" )
7479
"LinkToReport" false

i18n/en.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[projects]
55
relatedArticles = "Related Articles"
66
errorGetGhRepo = "failed to fetch repo info from GitHub API, Please check the network!"
7+
source = "Source: [{{ .Name }}]({{ .Link }}){{ with .Website }}<br>Website: <{{ . }}>{{ end }}"
78
poweredBy = "This page is powered by <a href=\"https://github.com/hugo-fixit/component-projects\">Component Projects</a>."
89

910
[projects.totalStarCount]

i18n/zh-CN.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[projects]
66
relatedArticles = "相关文章"
77
errorGetGhRepo = "从 GitHub API 获取仓库信息失败,请检查网络!"
8+
source = "来源:[{{ .Name }}]({{ .Link }}){{ with .Website }}<br>网站:<{{ . }}>{{ end }}"
89
poweredBy = "本页面由 <a href=\"https://github.com/hugo-fixit/component-projects\">Component Projects</a> 强力驱动。"
910

1011
[projects.totalStarCount]

0 commit comments

Comments
 (0)