首页 > 解决方案 > 允许 html/markdown 在 VuePress 中作为页脚

问题描述

我正在尝试将 html/markdown 添加到 VuePress 默认主题中的页脚变量。我想在链接到我的网站的页脚中添加 url。但是,我找不到将 url 添加到页脚的方法。你能告诉我我该怎么做吗?这是我的主要内容:

—

home: true

footer: Developed by [John Doe ](http://mywebsite.com). || Powered by VuePress

---

我怎样才能做到这一点?根据 Github 中的这个issue,这个功能仍然不可用,但是,必须有一个解决方法吗?

标签: vue.jsmarkdownyaml-front-mattervuepress

解决方案


无需复制主题:
可以在 markdown 中使用 vue 组件
缺点:<Footer/>必须在每个页面/降价文件中复制,并且您的页脚在<main>.

创建文件夹/文件.vuepress/components/Footer.vue

<template>
  <footer>
<!-- html in here -->
  </footer>
</template>

<style lang="stylus" scoped>
// css/stylus here or in global stylus file
</script>

在您的降价中添加<Footer/>每个页面的底部。

使用主题副本: -如上所述
创建组件 -控制台:(此处的文档) -转到 -在下面添加Footer.vue
vuepress eject
.vuepress\theme\Layout.vue
</Page><Footer/>


推荐阅读