Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Hosted on #410

Merged
merged 3 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ enableEmoji = true
# whether to show Hugo and theme info
# 是否显示 Hugo 和主题信息
hugo = true
# Hosted on (HTML format is supported)
# 托管服务信息 (支持 HTML 格式)
# <a title="Github Pages" href="https://docs.github.com/en/pages/" target="_blank" rel="noopener noreffer">GitHub Pages</a>
hostedOn = ''
HEIGE-PCloud marked this conversation as resolved.
Show resolved Hide resolved
# whether to show copyright info
# 是否显示版权信息
copyright = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ Please open the code block below to view the complete sample configuration :(far
custom = ''
# {{< version 0.2.0 >}} whether to show Hugo and theme info
hugo = true
# {{< version 0.2.14 >}} Hosted on (HTML format is supported)
# <a title="Github Pages" href="https://docs.github.com/en/pages/" target="_blank" rel="noopener noreffer">GitHub Pages</a>
hostedOn = ''
# {{< version 0.2.0 >}} whether to show copyright info
copyright = true
# {{< version 0.2.0 >}} whether to show the author
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ hugo
custom = ''
# {{< version 0.2.0 >}} 是否显示 Hugo 和主题信息
hugo = true
# {{< version 0.2.14 >}} 托管服务信息 (支持 HTML 格式)
# <a title="Github Pages" href="https://docs.github.com/en/pages/" target="_blank" rel="noopener noreffer">GitHub Pages</a>
hostedOn = ''
# {{< version 0.2.0 >}} 是否显示版权信息
copyright = true
# {{< version 0.2.0 >}} 是否显示作者
Expand Down
10 changes: 8 additions & 2 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ other = "Auto"
# === partials/header.html ===

# === partials/footer.html ===
[poweredBySome]
other = "Powered by {{ .Hugo }} | Theme - {{ .Theme }}"
[poweredBy]
other = "Powered by {{ .Hugo }}"

[hostedOn]
other = "Hosted on {{ .Host }}"

[theme]
other = "Theme - {{ .Theme }}"
# === partials/footer.html ===

# === partials/comment.html ===
Expand Down
10 changes: 8 additions & 2 deletions i18n/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ other = "Cambia el tema"
# === partials/header.html ===

# === partials/footer.html ===
[poweredBySome]
other = "Provisto por {{ .Hugo }} | Tema - {{ .Theme }}"
[poweredBy]
other = "Provisto por {{ .Hugo }}"

[hostedOn]
other = "Alejado en {{ .Host }}"

[theme]
other = "Tema - {{ .Theme }}"
# === partials/footer.html ===

# === partials/comment.html ===
Expand Down
10 changes: 8 additions & 2 deletions i18n/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ other = "跟随系统"
# === partials/header.html ===

# === partials/footer.html ===
[poweredBySome]
other = "由 {{ .Hugo }} 强力驱动 | 主题 - {{ .Theme }}"
[poweredBy]
other = "由 {{ .Hugo }} 强力驱动"

[hostedOn]
other = "托管在 {{ .Host }} 上"

[theme]
other = "主题 - {{ .Theme }}"
# === partials/footer.html ===

# === partials/comment.html ===
Expand Down
22 changes: 17 additions & 5 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@
</div>
{{- end -}}

{{- /* Hugo and DoIt */ -}}
{{- /* Hugo, Host and DoIt */ -}}
{{- $post_info := slice -}}
{{- if ne .Site.Params.footer.hugo false -}}
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %v">Hugo</a>` hugo.Version -}}
{{- $e := dict "Hugo" $hugo | T "poweredBy" -}}
{{- $post_info = $post_info | append $e -}}
{{- end -}}
{{- with .Site.Params.footer.hostedon -}}
{{- $e := dict "Host" . | T "hostedOn" -}}
{{- $post_info = $post_info | append $e -}}
{{- end -}}
{{- if ne .Site.Params.footer.hugo false -}}
{{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/HEIGE-PCloud/DoIt" target="_blank" rel="noopener noreffer" title="DoIt %v"><i class="far fa-edit fa-fw"></i> DoIt</a>` -}}
{{- $e := dict "Theme" $theme | T "theme" -}}
{{- $post_info = $post_info | append $e -}}
{{- end -}}
{{- with $post_info -}}
<div class="footer-line">
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %v">Hugo</a>` hugo.Version -}}
{{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/HEIGE-PCloud/DoIt" target="_blank" rel="noopener noreffer" title="DoIt %v"><i class="far fa-edit fa-fw"></i> DoIt</a>` -}}
{{- dict "Hugo" $hugo "Theme" $theme | T "poweredBySome" | safeHTML }}
{{ delimit . "&nbsp;|&nbsp;" | safeHTML }}
</div>
{{- end -}}

<div class="footer-line">
{{- /* Copyright year */ -}}
{{- if ne .Site.Params.footer.copyright false -}}
Expand Down