vue.js - 允许 html/markdown 在 VuePress 中作为页脚
问题描述
我正在尝试将 html/markdown 添加到 VuePress 默认主题中的页脚变量。我想在链接到我的网站的页脚中添加 url。但是,我找不到将 url 添加到页脚的方法。你能告诉我我该怎么做吗?这是我的主要内容:
—
home: true
footer: Developed by [John Doe ](http://mywebsite.com). || Powered by VuePress
---
我怎样才能做到这一点?根据 Github 中的这个issue,这个功能仍然不可用,但是,必须有一个解决方法吗?
解决方案
无需复制主题:
可以在 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/>
推荐阅读
- php - 我对第三方登录感到困惑
- swift - 登录后如何将 instagram 用户重定向到我的 Xcode 应用程序
- powershell - Internet 重新连接脚本“您不能在空值表达式上调用方法”错误
- angular - 如何在角度材料选择中显示图标
和相同的选择 - android - 记录视图库在android中无法正常工作
- c# - 替代已弃用的线程挂起方法?
- python-3.x - 图标题设置在底部
- android - Open/link new activity after Click on "GoogleSignInButton" in Android Studio (Connected with Firebase)
- apache - 如何通过可选锁定自动过滤器等功能来保护 Apache poi sxssf 表
- angular - httpClient.get() 方法不获取数据