mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 12:12:39 +00:00
♻️ Refactor: refactor site footer and params.footer.powered config
This commit is contained in:
@@ -20,10 +20,6 @@ footer {
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.fixit-icon {
|
||||
top: 0.25em;
|
||||
}
|
||||
|
||||
.animate-icon {
|
||||
color: #dc143c;
|
||||
animation: icon-animate 1.33s ease-in-out infinite;
|
||||
|
||||
@@ -17,11 +17,12 @@ img.emoji {
|
||||
vertical-align: -0.1em;
|
||||
}
|
||||
|
||||
.hugo-icon,
|
||||
.fixit-icon {
|
||||
display: inline-block;
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
line-height: 1.5em;
|
||||
height: 1.2em;
|
||||
width: 1.2em;
|
||||
line-height: 1.2em;
|
||||
position: relative;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1"><defs><style>.fixit-ban{opacity:.9;}</style></defs><path d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z" fill="#358C3C" class="fixit-bug"/><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z" fill="#FF6347" class="fixit-ban"/></svg>
|
||||
|
Before Width: | Height: | Size: 968 B |
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" version="1.1">
|
||||
<defs>
|
||||
<style>.fixit-ban{opacity:.9;}</style>
|
||||
</defs>
|
||||
<path
|
||||
d="M159.12 338.69l24.8-16.54a78.87 78.87 0 0 1-6.77-22.72l-30.88 4.41a16 16 0 0 1-4.54-31.68l34.27-4.9v-.76l98.94 98.95a76.89 76.89 0 0 1-71.68-17.73l-26.39 17.59c-.15.11-.31.21-.47.31a16 16 0 0 1-17.28-26.93zm224.72-48.42a16 16 0 0 0-13.57-18.11l-34.27-4.9V244.9l34.27-4.9a16 16 0 1 0-4.54-31.68l-30.54 4.36a79.31 79.31 0 0 0-6.85-22.85l24.54-16.36a16 16 0 1 0-17.29-26.93l-.46.31-26 17.34a79.9 79.9 0 0 0-102.64-3l139.83 139.88 19.41 2.77a16 16 0 0 0 18.11-13.57z"
|
||||
fill="#358C3C" class="fixit-bug" />
|
||||
<path
|
||||
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 432c-101.46 0-184-82.54-184-184a182.84 182.84 0 0 1 33.38-105.37l256 256A182.86 182.86 0 0 1 256 440zm150.62-78.63l-256-256A182.84 182.84 0 0 1 256 72c101.46 0 184 82.54 184 184a182.84 182.84 0 0 1-33.38 105.37z"
|
||||
fill="#FF6347" class="fixit-ban" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 370 391" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FF4088;stroke:#C9177E;stroke-width:27;}
|
||||
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M207.5,22.4L321.9,89c13.5,7.9,21.9,22.4,21.9,38v136.4c0,17.3-9.3,33.3-24.5,41.8l-113.5,63.9
|
||||
c-15.1,8.5-33.5,8.4-48.5-0.2L52.8,308.8c-16.4-9.5-26.6-27-26.6-45.9V133.4c0-19.1,9.9-36.8,26.1-46.8l102.8-63.5
|
||||
C171.1,13.2,191.3,13,207.5,22.4z"/>
|
||||
<polygon class="st1" points="105.6,298.2 105.6,91 149,91 149,166.5 220.9,166.5 220.9,91 264.4,91 264.4,298.2 220.9,298.2
|
||||
220.9,207.6 149,207.6 149,298.2 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 787 B |
@@ -400,22 +400,23 @@ enableEmoji = true
|
||||
# FixIt 0.2.17 | CHANGED Custom content (HTML format is supported)
|
||||
# For advanced use, see parameter `params.customFilePath.footer`
|
||||
custom = ""
|
||||
# whether to show Hugo and theme info
|
||||
hugo = true
|
||||
# whether to show copyright info
|
||||
copyright = true
|
||||
# whether to show the author
|
||||
author = true
|
||||
# Site creation year
|
||||
since = ""
|
||||
# FixIt 0.2.14 | NEW whether to show total word count of site content
|
||||
wordCount = true
|
||||
# FixIt 0.2.12 | NEW Public network security only in China (HTML format is supported)
|
||||
gov = ""
|
||||
# ICP info only in China (HTML format is supported)
|
||||
icp = ""
|
||||
# license info (HTML format is supported)
|
||||
license = ""
|
||||
# FixIt 0.3.0 | NEW whether to show Hugo and theme info
|
||||
[params.footer.powered]
|
||||
enable = true
|
||||
hugoLogo = true
|
||||
themeLogo = true
|
||||
# FixIt 0.2.17 | CHANGED Site creation time
|
||||
[params.footer.siteTime]
|
||||
enable = false
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
{{- if ne .Site.Params.footer.enable false -}}
|
||||
{{- $footerConfig := .Site.Params.footer -}}
|
||||
|
||||
{{- if ne $footerConfig.enable false -}}
|
||||
<footer class="footer">
|
||||
<div class="footer-container">
|
||||
{{- /* Custom Content */ -}}
|
||||
{{- partial (.Scratch.Get "customFilePath").footer . -}}
|
||||
|
||||
{{- /* Hugo and FixIt */ -}}
|
||||
{{- if ne .Site.Params.footer.hugo false -}}
|
||||
<div class="footer-line powered{{ with .Site.Params.footer.order.powered }} order-{{ . }}{{ end }}">
|
||||
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreferrer" title="Hugo %v">Hugo</a>` hugo.Version -}}
|
||||
{{- $theme := printf `<a href="https://github.com/hugo-fixit/FixIt" target="_blank" rel="external" title="FixIt %v"><img class="fixit-icon" src="%v" alt="FixIt logo" /> FixIt</a>`
|
||||
(.Scratch.Get "version")
|
||||
(resources.Get "fixit.svg" | minify).RelPermalink
|
||||
-}}
|
||||
{{- /* Powered by Hugo and Theme - FixIt */ -}}
|
||||
{{- if ne $footerConfig.powered.enable false -}}
|
||||
<div class="footer-line powered{{ with $footerConfig.order.powered }} order-{{ . }}{{ end }}">
|
||||
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreferrer" title="Hugo %v">{hugoLogo}Hugo</a>` hugo.Version -}}
|
||||
{{- $theme := printf `<a href="https://github.com/hugo-fixit/FixIt" target="_blank" rel="external" title="FixIt %v">{themeLogo}FixIt</a>` (.Scratch.Get "version") -}}
|
||||
{{- if $footerConfig.powered.hugoLogo -}}
|
||||
{{- $hugoLogo := printf `<img class="hugo-icon" src="%v" alt="Hugo logo" /> ` (resources.Get "svg/hugo.svg" | minify).RelPermalink -}}
|
||||
{{- $hugo = replace $hugo "{hugoLogo}" $hugoLogo -}}
|
||||
{{- end -}}
|
||||
{{- if $footerConfig.powered.themeLogo -}}
|
||||
{{- $themeLogo := printf `<img class="fixit-icon" src="%v" alt="FixIt logo" /> ` (resources.Get "svg/fixit.svg" | minify).RelPermalink -}}
|
||||
{{- $theme = replace $theme "{themeLogo}" $themeLogo -}}
|
||||
{{- end -}}
|
||||
{{- $hugo = replace $hugo "{hugoLogo}" "" -}}
|
||||
{{- $theme = replace $theme "{themeLogo}" "" -}}
|
||||
{{- dict "Hugo" $hugo "Theme" $theme | T "footer.poweredBySome" | safeHTML }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.footer.copyright | or .Site.Params.footer.author | or .Site.Params.footer.license -}}
|
||||
<div class="footer-line copyright{{ with .Site.Params.footer.order.copyright }} order-{{ . }}{{ end }}" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
{{- if $footerConfig.copyright | or $footerConfig.author | or $footerConfig.license -}}
|
||||
<div class="footer-line copyright{{ with $footerConfig.order.copyright }} order-{{ . }}{{ end }}" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
{{- /* Copyright year */ -}}
|
||||
{{- if ne .Site.Params.footer.copyright false -}}
|
||||
{{- if ne $footerConfig.copyright false -}}
|
||||
{{ dict "Class" "fa-regular fa-copyright fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ with .Site.Params.footer.since -}}
|
||||
{{ with $footerConfig.since -}}
|
||||
<span itemprop="copyrightYear">
|
||||
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
|
||||
</span>
|
||||
@@ -31,22 +40,22 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Author */ -}}
|
||||
{{- if ne .Site.Params.footer.author false -}}
|
||||
{{- if ne $footerConfig.author false -}}
|
||||
<span class="author" itemprop="copyrightHolder">
|
||||
{{ partial "plugin/link.html" (dict "Destination" ($.Site.Params.author.link | default (.Scratch.Get "homeRelPermalink")) "Content" .Site.Params.author.name) -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* License */ -}}
|
||||
{{- with .Site.Params.footer.license -}}
|
||||
{{- with $footerConfig.license -}}
|
||||
<span class="license footer-divider">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- $siteTime := .Scratch.Get "siteTime" -}}
|
||||
{{- if $siteTime.enable | or .Site.Params.footer.wordCount -}}
|
||||
<div class="footer-line statistics{{ with .Site.Params.footer.order.statistics }} order-{{ . }}{{ end }}">
|
||||
{{- if $siteTime.enable -}}
|
||||
<div class="footer-line statistics{{ with $footerConfig.order.statistics }} order-{{ . }}{{ end }}">
|
||||
{{- if $siteTime.enable | and $siteTime.value -}}
|
||||
{{- with $siteTime -}}
|
||||
<span class="site-time" title='{{ T "footer.siteRunning" }}'>
|
||||
@@ -63,7 +72,7 @@
|
||||
{{- /* 不蒜子 */ -}}
|
||||
{{- if eq .Site.Params.ibruce.enable true -}}
|
||||
{{- $loading := dict "Class" "fa-solid fa-spinner fa-spin fa-fw" | partial "plugin/icon.html" -}}
|
||||
<div class="footer-line visitor{{ with .Site.Params.footer.order.visitor }} order-{{ . }}{{ end }}">
|
||||
<div class="footer-line visitor{{ with $footerConfig.order.visitor }} order-{{ . }}{{ end }}">
|
||||
<span id="busuanzi_container_site_uv" title='{{ T "footer.siteUV" }}'>
|
||||
{{- dict "Class" "fa-regular fa-user fa-fw" | partial "plugin/icon.html" -}} <span id="busuanzi_value_site_uv">{{ $loading }}</span>{{- /* NO_SPACING */ -}}
|
||||
</span>
|
||||
@@ -74,15 +83,15 @@
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.footer.gov | or .Site.Params.footer.icp -}}
|
||||
<div class="footer-line beian{{ with .Site.Params.footer.order.beian }} order-{{ . }}{{ end }}">
|
||||
{{- if $footerConfig.gov | or $footerConfig.icp -}}
|
||||
<div class="footer-line beian{{ with $footerConfig.order.beian }} order-{{ . }}{{ end }}">
|
||||
{{- /* GOV */ -}}
|
||||
{{- with .Site.Params.footer.gov -}}
|
||||
{{- with $footerConfig.gov -}}
|
||||
<span class="gov">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ICP */ -}}
|
||||
{{- with .Site.Params.footer.icp -}}
|
||||
{{- with $footerConfig.icp -}}
|
||||
<span class="icp footer-divider">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user