教你把Powered by NotionNext去除

我雖然好不容易有了自己的blog,但是這個blog是基於NotionNext打造,blog底部會有powered by NotionNext的字體,我覺得很礙眼(我的blog居然可以通往別的網站
?),所以我教你如何移除。

github設定

打開你的github倉庫

打開

1
/themes/hexo/components/**Footer.js**

其中的hexo換成你設定的主題

螢幕截圖_20240724_221336.png

原本程式是

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { siteConfig } from '@/lib/config'

const Footer = ({ title }) => {
const d = new Date()
const currentYear = d.getFullYear()
const since = siteConfig('SINCE')
const copyrightDate = parseInt(since) < currentYear ? since + '-' + currentYear : currentYear

return (
<footer
className='relative z-10 dark:bg-black flex-shrink-0 bg-hexo-light-gray justify-center text-center m-auto w-full leading-6 text-gray-600 dark:text-gray-100 text-sm p-6'
>
{/* <DarkModeButton/> */}

<i className='fas fa-copyright' /> {`${copyrightDate}`} <span><i className='mx-1 animate-pulse fas fa-heart'/> <a href={siteConfig('LINK')} className='underline font-bold dark:text-gray-300 '>{siteConfig('AUTHOR')}</a>.<br/>

{siteConfig('BEI_AN') && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{siteConfig('BEI_AN')}</a><br/></>}

<span className='hidden busuanzi_container_site_pv'>
<i className='fas fa-eye'/><span className='px-1 busuanzi_value_site_pv'> </span> </span>
<span className='pl-2 hidden busuanzi_container_site_uv'>
<i className='fas fa-users'/> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
<h1 className='text-xs pt-4 text-light-400 dark:text-gray-400'>{title} {siteConfig('BIO') && <>|</>} {siteConfig('BIO')}</h1>
<p className='text-xs pt-2 text-light-500 dark:text-gray-500'>Powered by <a href='https://github.com/tangly1024/NotionNext' className='dark:text-gray-300'>NotionNext {siteConfig('VERSION')}</a>.</p></span><br/>

</footer>
)
}

export default Footer

找到這行

1
<p className='text-xs pt-2 text-light-500 dark:text-gray-500'>Powered by <a href='https://github.com/tangly1024/NotionNext' className='dark:text-gray-300'>NotionNext {siteConfig('VERSION')}</a>.</p></span><br/>

這行就是顯示Powered by NotionNext ,等等先不要刪掉這一行,如果刪除反而還是會顯示,只須將程式「改造」就可以了

可以看到程式有

1.Powered by

2.

3.NotionNext

4.{siteConfig(‘VERSION’)}

只須「2」中的連結換成你自己的blog

「3」換成你自己的名字

「4」刪除

廣告,請繼續閱讀
就可以得到(底下是我的範例)

1
<p className='text-xs pt-2 text-light-500 dark:text-gray-500'>Powered by <a href='https://www.leaftechblog.cloudns.biz/' className='dark:text-gray-300'>Leaf</a>.</p></span><br/>

螢幕截圖_20240724_222854.png

完成!

📎 参考文章

  • https://github.com/tangly1024/NotionNext/discussions/2299
  • https://www.dsuper.xyz/article/cdn_acc#85a9d43846c04fc6988d04d82581fffd

這篇文章有幫助到你?幫我訂閱我的yt頻道吧!
贊助我?!(bitcoin:bc1q02d6mzgrm7alc7m62fw0nuj3ndx0h4mtsp6j8z)

leaftech (leaftech)

0%