温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - How can I use markdown in the Homepage layout of the VuePress?
vuepress

其他 - 如何在VuePress的主页布局中使用markdown?

发布于 2020-06-11 09:15:06

Vuepress 主页布局features标签中,由于出现错误,无法使用任何markdown表示法。因此,我想将自定义布局扩展到默认的首页布局,并开始使用markdown。

这可能吗?任何建议都欢迎,谢谢!

查看更多

提问者
Ueda Takeyuki
被浏览
14
Ryan 2020-04-17 03:03

我同意@Sun Haoran回答,但要注意一种添加内容/ html的好方法是使用组件。

我们创建了一个名为HomeFeatures.vue的首页组件。请参阅回购)此外,我们几乎只是从vuepress复制了此内容

<template>
  <div class="features">
    <div class="feature">
      <h2>AccuTerm</h2>
      <p>
        <a href="/accuterm/getting-started/">Getting Started</a><br />
        <a href="/accuterm/license-activation/">Licensing</a><br />
        <a href="/accuterm/desktop/">Desktop</a><br />
        <a href="/accuterm/web/">Web</a><br />
        <a href="/accuterm/mobile/">Mobile</a>
      </p>
    </div>
    <div class="feature">
      <h2>jBASE</h2>
      <p><a href="/jbase/">All Docs</a><br /></p>
    </div>
    <div class="feature">
      <h2>OpenQM</h2>
      <p>Main (Coming Soon!)<br /></p>
    </div>
    <div class="feature">
      <h2>MV Dashboard</h2>
      <p>
        <a href="/mv-dashboard/introduction/">Introduction</a><br />
        <a href="/mv-dashboard/installation-guide/">Installation Guide</a><br />
        <a href="/mv-dashboard/programmers-guide/">Programmers Guide</a>
      </p>
    </div>
    <div class="feature">
      <h2>MV Connect</h2>
      <p>
        <a href="/mv-connect/">Overview</a><br />
        <a href="/mv-connect/get-started/">Getting Started</a><br />
        <a href="/mv-connect/api/">API</a>
      </p>
    </div>
    <div class="feature">
      <h2>Customer Portal</h2>
      <p>
        <a href="/customer-portal/">All Docs</a>
      </p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Features'
};
</script>

并像这样包含它:(请参阅回购

---
home: true
heroImage: /assets/img/logo-grey.png
heroText: Product Documentation
tagline: Welcome to the future
footer: MIT Licensed | Copyright © 2019-present Company Name
---

<HomeFeatures />

如果您想查看实际操作,我们的文档将保存在此处