博客搭建日记
经过我这段时间的不懈努力,我的博客终于是优化的七七八八了😁
真是可喜可贺,在今年的最后一天把博客优化完毕,优化教程可以看我的文章
还有一个就是,有些人下面上一章和下一章点击之后会显示404,其实要解决也非常简单,只要在目录/src/components/PrevNextArticle/PrevNextArticle.astro里面把以下代码
<section class="vh-otarticle">
<a class="art-item" style={`background-image: url('${prev.cover}')`} href={prev.id}><span class="vh-ellipsis line-2">{prev.title}</span></a>
<a class="art-item" style={`background-image: url('${next.cover}')`} href={next.id}><span class="vh-ellipsis line-2">{next.title}</span></a>
</section>替换成下面的代码
<section class="vh-otarticle">
{prev && <a class="art-item" style={`background-image: url('${prev.cover}')`} href={prev.id === "#" ? "#" : `/article/${prev.id}`}><span class="vh-ellipsis line-2">{prev.title}</span></a>}
{next && <a class="art-item" style={`background-image: url('${next.cover}')`} href={next.id === "#" ? "#" : `/article/${next.id}`}><span class="vh-ellipsis line-2">{next.title}</span></a>}
</section>就可以解决了~
还有就是动态页面,你可能会发现编辑了动态之后,头像和名字还是别人的,其实只要在src/scripts/talking.ts这个文件中,将对应的图床链接、名字换成你自己的就可以
