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

栏目: 软件资讯 · 发布时间: 7年前

内容简介:VuePress 1.0.0-alpha.38 发布了,VuePress 是一个由 Vue 驱动的轻量级静态网站生成器,它是为了满足 Vue 自己的项目文档需求而创建的。 更新内容如下: Bug Fixes $plugin-pwa: 设置 service worker 的当前注册范...

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 禁用搜索框

更新日志


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

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

Web Security, Privacy and Commerce, 2nd Edition

Web Security, Privacy and Commerce, 2nd Edition

Simson Garfinkel / O'Reilly Media / 2002-01-15 / USD 44.95

Since the first edition of this classic reference was published, World Wide Web use has exploded and e-commerce has become a daily part of business and personal life. As Web use has grown, so have ......一起来看看 《Web Security, Privacy and Commerce, 2nd Edition》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具