VuePress 1.0.0-alpha.38 发布,轻量级静态网站生成器

栏目: 编程语言 · 发布时间: 6年前

内容简介:VuePress 1.0.0-alpha.38 发布了,VuePress 是一个由 Vue 驱动的轻量级静态网站生成器,它是为了满足 Vue 自己的项目文档需求而创建的。更新内容如下:

VuePress 1.0.0-alpha.38 发布了,VuePress 是一个由 Vue 驱动的轻量级静态网站生成器,它是为了满足 Vue 自己的项目文档需求而创建的。

VuePress 1.0.0-alpha.38 发布,轻量级静态网站生成器

更新内容如下:

Bug Fixes

  • $plugin-pwa:设置 service worker 的当前注册范围

  • $theme-default:侧栏组项目不能包含空子项

Features

  • $core:支持全局布局

    可以通过 siteConfig 或 themeEntryFile 使用自定义全局布局组件:

    module.exports = {
      globalLayout: '/path/to/your/global/vue/sfc'
    }

    以下是默认全局布局组件的内容,设置全局 header 和 footer 的示例:

    <template>
      <div id="global-layout">
        <header><h1>Header</h1></header>
        <component :is="layout"/>
        <footer><h1>Footer</h1></footer>
      </div>
    </template>
    
    <script>
    export default {
      computed: {
        layout () {
          if (this.$page.path) {
            if (this.$vuepress.isLayoutExists(this.$page.frontmatter.layout)) {
              return this.$page.frontmatter.layout
            }
            return 'Layout'
          }
          return 'NotFound'
        }
      }
    }
    </script>

    还可以按惯例直接创建组件 .vuepress/components/GlobalLayout.vue 或 themePath/layouts/GlobalLayout.vue,无需任何配置。加载优先级如下:

    • siteConfig

    • siteAgreement

    • themeEntryFile

    • themeAgreement

    • default

  • $theme-default:通过 frontmatter 禁用搜索框

更新日志


以上所述就是小编给大家介绍的《VuePress 1.0.0-alpha.38 发布,轻量级静态网站生成器》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Masterminds of Programming

Masterminds of Programming

Federico Biancuzzi、Chromatic / O'Reilly Media / 2009-03-27 / USD 39.99

Description Masterminds of Programming features exclusive interviews with the creators of several historic and highly influential programming languages. Think along with Adin D. Falkoff (APL), Jame......一起来看看 《Masterminds of Programming》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

SHA 加密
SHA 加密

SHA 加密工具