feat: add switch for astro badge.
This commit is contained in:
parent
a043141456
commit
e2064c2fa9
@ -30,8 +30,11 @@ const Options = z
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
settings: z.object({
|
settings: z.object({
|
||||||
|
footer: z.object({
|
||||||
initialYear: z.number().max(2024),
|
initialYear: z.number().max(2024),
|
||||||
icpNo: z.string().optional(),
|
icpNo: z.string().optional(),
|
||||||
|
astroBadge: z.boolean().default(true),
|
||||||
|
}),
|
||||||
locale: z.string().optional().default('zh-CN'),
|
locale: z.string().optional().default('zh-CN'),
|
||||||
timeZone: z.string().optional().default('Asia/Shanghai'),
|
timeZone: z.string().optional().default('Asia/Shanghai'),
|
||||||
timeFormat: z.string().optional().default('yyyy-MM-dd HH:mm:ss'),
|
timeFormat: z.string().optional().default('yyyy-MM-dd HH:mm:ss'),
|
||||||
@ -149,8 +152,11 @@ const options: z.input<typeof Options> = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
settings: {
|
settings: {
|
||||||
|
footer: {
|
||||||
initialYear: 2011,
|
initialYear: 2011,
|
||||||
icpNo: '皖ICP备2021002315号-2',
|
icpNo: '皖ICP备2021002315号-2',
|
||||||
|
astroBadge: true,
|
||||||
|
},
|
||||||
locale: 'zh-CN',
|
locale: 'zh-CN',
|
||||||
timeZone: 'Asia/Shanghai',
|
timeZone: 'Asia/Shanghai',
|
||||||
timeFormat: 'yyyy-MM-dd',
|
timeFormat: 'yyyy-MM-dd',
|
||||||
|
@ -5,38 +5,44 @@ import { DateTime } from 'luxon';
|
|||||||
|
|
||||||
<footer class="footer border-top border-light text-xs text-center py-4 py-xl-5">
|
<footer class="footer border-top border-light text-xs text-center py-4 py-xl-5">
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<span>Copyright © {options.settings.initialYear}-{DateTime.now().setZone(options.settings.timeZone).year}</span>
|
<span>
|
||||||
|
Copyright © {options.settings.footer.initialYear}-{DateTime.now().setZone(options.settings.timeZone).year}
|
||||||
|
</span>
|
||||||
<a href={import.meta.env.SITE} title={options.title} rel="home">
|
<a href={import.meta.env.SITE} title={options.title} rel="home">
|
||||||
{options.title}
|
{options.title}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
options.settings.icpNo && (
|
options.settings.footer.icpNo && (
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank" title="ICP 备案">
|
<a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank" title="ICP 备案">
|
||||||
{options.settings.icpNo}
|
{options.settings.footer.icpNo}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
options.settings.footer.astroBadge && (
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<a href="https://astro.build" target="_blank" rel="nofollow"
|
<a href="https://astro.build" target="_blank" rel="nofollow">
|
||||||
><svg class="astro-badge" fill="none" width="120" height="20" viewBox="0 0 120 20">
|
<svg class="astro-badge" fill="none" width="120" height="20" viewBox="0 0 120 20">
|
||||||
<title>Astro Badge</title>
|
<title>Astro Badge</title>
|
||||||
<rect width="119" height="19" x=".5" y=".5" fill="#404b69" rx="3.5"></rect>
|
<rect width="119" height="19" x=".5" y=".5" fill="#404b69" rx="3.5" />
|
||||||
<rect width="119" height="19" x=".5" y=".5" fill="url(#a)" fill-opacity=".5" rx="3.5"></rect>
|
<rect width="119" height="19" x=".5" y=".5" fill="url(#a)" fill-opacity=".5" rx="3.5" />
|
||||||
<path
|
<path
|
||||||
fill="#fff"
|
fill="#fff"
|
||||||
d="M9.07 13V6.79h1.86c1.44 0 2.14.54 2.14 1.63 0 .52-.16.98-.76 1.22v.25c.74.21.96.76.96 1.4 0 1.14-.72 1.71-2.15 1.71H9.07Zm.91-.8h1.14c.85 0 1.2-.29 1.2-1 0-.7-.36-.98-1.2-.98H9.98v1.98Zm0-2.75h.97c.84 0 1.2-.27 1.2-.93 0-.67-.35-.94-1.2-.94h-.97v1.87Zm6.69 3.7c-1.4 0-2.06-.8-2.06-2.45V6.8h.9v3.83c0 1.16.35 1.64 1.16 1.64.8 0 1.15-.48 1.15-1.64V6.79h.9v3.92c0 1.64-.66 2.43-2.05 2.43ZM20.2 13v-.83h1.58V7.62H20.2v-.83h4.09v.83H22.7v4.55h1.59V13H20.2Zm5.96 0V6.79h.9v5.38h2.86V13h-3.76Zm6.78 0V7.62h-1.77v-.83h4.45v.83h-1.76V13h-.92Zm9.57 0-.59-6.21h.88l.4 5.23.23.03L44 8.5h1.1l.57 3.55.25-.03.38-5.23h.88L46.59 13h-1.43l-.48-3.37h-.27L43.93 13H42.5Zm5.57 0v-.83h1.59V7.62h-1.59v-.83h4.09v.83h-1.58v4.55h1.58V13h-4.09Zm7.16 0V7.62h-1.76v-.83h4.45v.83h-1.77V13h-.92Zm7.2 0v-2.77h-2.32V13h-.91V6.79h.9V9.4h2.33V6.79h.9V13h-.9Zm10.38.87c-.5-.46-.64-1.4-.44-2.1.36.44.86.57 1.38.65.8.12 1.58.08 2.32-.29l.25-.15c.07.2.1.4.07.61-.06.5-.31.9-.71 1.19-.16.12-.33.22-.5.33-.5.34-.64.74-.45 1.33l.02.06a1.33 1.33 0 0 1-.6-.5c-.14-.24-.22-.5-.22-.78 0-.13 0-.27-.02-.4-.04-.33-.2-.48-.49-.48a.57.57 0 0 0-.6.46l-.01.07Zm-2.84-2.22s1.47-.71 2.95-.71l1.12-3.45c.04-.16.16-.28.3-.28.13 0 .26.12.3.28l1.11 3.45a6.3 6.3 0 0 1 2.96.71L76.2 4.83c-.07-.2-.2-.33-.36-.33h-3c-.17 0-.29.13-.36.33l-2.51 6.82Zm15.55-.99c0 .6-.75.97-1.8.97-.67 0-.91-.17-.91-.52 0-.37.3-.55.97-.55.61 0 1.14.01 1.74.09v.01Zm0-.74a7.85 7.85 0 0 0-1.6-.14c-1.95 0-2.87.46-2.87 1.54 0 1.11.63 1.54 2.09 1.54 1.23 0 2.06-.31 2.37-1.07h.05l-.02.5c0 .4.07.43.4.43h1.51c-.08-.23-.13-.9-.13-1.46 0-.61.03-1.08.03-1.7 0-1.26-.76-2.07-3.15-2.07-1.02 0-2.16.18-3.03.44.08.34.2 1.04.26 1.5a6.64 6.64 0 0 1 2.64-.51c1.14 0 1.46.26 1.46.79v.2Zm4.18 1.09c-.2.03-.49.03-.78.03-.3 0-.58 0-.77-.03l-.01.2c0 1.05.69 1.66 3.1 1.66 2.27 0 3-.6 3-1.66 0-1-.48-1.5-2.64-1.61-1.68-.08-1.82-.26-1.82-.47 0-.24.21-.37 1.34-.37 1.16 0 1.48.16 1.48.5v.07a16.91 16.91 0 0 1 1.55 0v-.2c0-1.23-1.02-1.63-3-1.63-2.23 0-2.99.55-2.99 1.61 0 .96.6 1.55 2.75 1.64 1.58.05 1.75.23 1.75.47 0 .26-.25.38-1.36.38-1.28 0-1.6-.18-1.6-.54v-.05Zm7.28-4.41a6.43 6.43 0 0 1-2.3 1.27c.02.31.02.88.02 1.2h.55l-.02 1.8c0 1.1.59 1.95 2.42 1.95a8.4 8.4 0 0 0 1.92-.22 16.4 16.4 0 0 1-.17-1.52c-.38.13-.86.2-1.39.2-.73 0-1.03-.2-1.03-.79V9.1c.95 0 1.9.02 2.45.04a18 18 0 0 1 .03-1.48l-2.45.02c0-.37.02-.72.03-1.07h-.06Zm4.94 2.21.02-1.16h-1.66a102.96 102.96 0 0 1 0 5.08h1.9a41.9 41.9 0 0 1-.04-2.08c0-1.14.46-1.46 1.51-1.46.49 0 .84.06 1.14.16.01-.42.1-1.25.14-1.62-.31-.1-.66-.15-1.08-.15-.9-.01-1.56.36-1.87 1.24l-.06-.01Zm8.27 1.34c0 .91-.66 1.34-1.7 1.34-1.03 0-1.7-.4-1.7-1.34 0-.94.68-1.29 1.7-1.29 1.03 0 1.7.38 1.7 1.3Zm1.73-.04c0-1.82-1.42-2.63-3.43-2.63-2.02 0-3.39.81-3.39 2.63 0 1.8 1.28 2.78 3.38 2.78 2.12 0 3.44-.97 3.44-2.78Z"
|
d="M9.07 13V6.79h1.86c1.44 0 2.14.54 2.14 1.63 0 .52-.16.98-.76 1.22v.25c.74.21.96.76.96 1.4 0 1.14-.72 1.71-2.15 1.71H9.07Zm.91-.8h1.14c.85 0 1.2-.29 1.2-1 0-.7-.36-.98-1.2-.98H9.98v1.98Zm0-2.75h.97c.84 0 1.2-.27 1.2-.93 0-.67-.35-.94-1.2-.94h-.97v1.87Zm6.69 3.7c-1.4 0-2.06-.8-2.06-2.45V6.8h.9v3.83c0 1.16.35 1.64 1.16 1.64.8 0 1.15-.48 1.15-1.64V6.79h.9v3.92c0 1.64-.66 2.43-2.05 2.43ZM20.2 13v-.83h1.58V7.62H20.2v-.83h4.09v.83H22.7v4.55h1.59V13H20.2Zm5.96 0V6.79h.9v5.38h2.86V13h-3.76Zm6.78 0V7.62h-1.77v-.83h4.45v.83h-1.76V13h-.92Zm9.57 0-.59-6.21h.88l.4 5.23.23.03L44 8.5h1.1l.57 3.55.25-.03.38-5.23h.88L46.59 13h-1.43l-.48-3.37h-.27L43.93 13H42.5Zm5.57 0v-.83h1.59V7.62h-1.59v-.83h4.09v.83h-1.58v4.55h1.58V13h-4.09Zm7.16 0V7.62h-1.76v-.83h4.45v.83h-1.77V13h-.92Zm7.2 0v-2.77h-2.32V13h-.91V6.79h.9V9.4h2.33V6.79h.9V13h-.9Zm10.38.87c-.5-.46-.64-1.4-.44-2.1.36.44.86.57 1.38.65.8.12 1.58.08 2.32-.29l.25-.15c.07.2.1.4.07.61-.06.5-.31.9-.71 1.19-.16.12-.33.22-.5.33-.5.34-.64.74-.45 1.33l.02.06a1.33 1.33 0 0 1-.6-.5c-.14-.24-.22-.5-.22-.78 0-.13 0-.27-.02-.4-.04-.33-.2-.48-.49-.48a.57.57 0 0 0-.6.46l-.01.07Zm-2.84-2.22s1.47-.71 2.95-.71l1.12-3.45c.04-.16.16-.28.3-.28.13 0 .26.12.3.28l1.11 3.45a6.3 6.3 0 0 1 2.96.71L76.2 4.83c-.07-.2-.2-.33-.36-.33h-3c-.17 0-.29.13-.36.33l-2.51 6.82Zm15.55-.99c0 .6-.75.97-1.8.97-.67 0-.91-.17-.91-.52 0-.37.3-.55.97-.55.61 0 1.14.01 1.74.09v.01Zm0-.74a7.85 7.85 0 0 0-1.6-.14c-1.95 0-2.87.46-2.87 1.54 0 1.11.63 1.54 2.09 1.54 1.23 0 2.06-.31 2.37-1.07h.05l-.02.5c0 .4.07.43.4.43h1.51c-.08-.23-.13-.9-.13-1.46 0-.61.03-1.08.03-1.7 0-1.26-.76-2.07-3.15-2.07-1.02 0-2.16.18-3.03.44.08.34.2 1.04.26 1.5a6.64 6.64 0 0 1 2.64-.51c1.14 0 1.46.26 1.46.79v.2Zm4.18 1.09c-.2.03-.49.03-.78.03-.3 0-.58 0-.77-.03l-.01.2c0 1.05.69 1.66 3.1 1.66 2.27 0 3-.6 3-1.66 0-1-.48-1.5-2.64-1.61-1.68-.08-1.82-.26-1.82-.47 0-.24.21-.37 1.34-.37 1.16 0 1.48.16 1.48.5v.07a16.91 16.91 0 0 1 1.55 0v-.2c0-1.23-1.02-1.63-3-1.63-2.23 0-2.99.55-2.99 1.61 0 .96.6 1.55 2.75 1.64 1.58.05 1.75.23 1.75.47 0 .26-.25.38-1.36.38-1.28 0-1.6-.18-1.6-.54v-.05Zm7.28-4.41a6.43 6.43 0 0 1-2.3 1.27c.02.31.02.88.02 1.2h.55l-.02 1.8c0 1.1.59 1.95 2.42 1.95a8.4 8.4 0 0 0 1.92-.22 16.4 16.4 0 0 1-.17-1.52c-.38.13-.86.2-1.39.2-.73 0-1.03-.2-1.03-.79V9.1c.95 0 1.9.02 2.45.04a18 18 0 0 1 .03-1.48l-2.45.02c0-.37.02-.72.03-1.07h-.06Zm4.94 2.21.02-1.16h-1.66a102.96 102.96 0 0 1 0 5.08h1.9a41.9 41.9 0 0 1-.04-2.08c0-1.14.46-1.46 1.51-1.46.49 0 .84.06 1.14.16.01-.42.1-1.25.14-1.62-.31-.1-.66-.15-1.08-.15-.9-.01-1.56.36-1.87 1.24l-.06-.01Zm8.27 1.34c0 .91-.66 1.34-1.7 1.34-1.03 0-1.7-.4-1.7-1.34 0-.94.68-1.29 1.7-1.29 1.03 0 1.7.38 1.7 1.3Zm1.73-.04c0-1.82-1.42-2.63-3.43-2.63-2.02 0-3.39.81-3.39 2.63 0 1.8 1.28 2.78 3.38 2.78 2.12 0 3.44-.97 3.44-2.78Z"
|
||||||
></path>
|
/>
|
||||||
<rect width="119" height="19" x=".5" y=".5" stroke="url(#b)" rx="3.5"></rect>
|
<rect width="119" height="19" x=".5" y=".5" stroke="url(#b)" rx="3.5" />
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient id="a" x1="0" x2="88.9" y1="20" y2="-43.52" gradientUnits="userSpaceOnUse">
|
<linearGradient id="a" x1="0" x2="88.9" y1="20" y2="-43.52" gradientUnits="userSpaceOnUse">
|
||||||
<stop stop-color="#404b69"></stop>
|
<stop stop-color="#404b69" />
|
||||||
<stop offset="1" stop-color="#404b69"></stop>
|
<stop offset="1" stop-color="#404b69" />
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
</footer>
|
</footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user