Preface#
After installing the front-end Kami of mx-space, it was found that the copyright statement at the bottom of the website is © 2020-2023
, and after flipping through the documents for a long time, I couldn't find where it can be changed.
I had to look at the source code and found that the year setting of this thing is actually hard-coded, without any configuration options.
So I had to modify it myself and then recompile it.
Modification#
Find the kami/src/components/layouts/BasicLayout/Footer/index.tsx
under the Kami source code directory, and find this piece of code around line 53
<p>
© {thisYear !== 2020 && '2020-'}
{thisYear}{' '}
<a href={kamiConfig.site.footer.homePage ?? '#'} target="_blank">
{name}
</a>
.{' '}
<span title={`${motto.content} -- ${motto.author}`}>
{motto.content}
</span>
</p>
Replace © {thisYear !== 2020 && '2020-'}
with the current year
When the author wrote this article in 2023, the modified content should be © {thisYear !== 2023 && '2023-'}
After the modification, execute the following commands in the Kami repository directory to rebuild and restart the server
pnpm build
pnpm prod:pm2
After completion, clear the browser cache, reopen the page, and the bottom of the page will change to © 2023
References#
- [GitHub] mx-space/kami: https://github.com/mx-space/kami
This article is synchronized updated by Mix Space to xLog
The original link is https://bdovo.cc/posts/experiences/Edit_Copyright_in_mx-space