Skip to content

Aphorica/vuepress-plugin-netlifycms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vuepress-plugin-netlifycms

Add a header tag to main page for DemoMacro's [https://github.com/DemoMacro/VuePress-NetlifyCMS](Vuepress CMS) project.

Rationale

In the instructions under the heading Add the Netlify Identity Widget, you need to asd the specified <script> tag to the head section of the site's main page.

There is no easy way to do that, short of writing a plugin, which this is. This is essentially a clone of the file:///home/dev/web/vuepress-plugins/vuepress-plugin-headertags repo, with a modification to place the tag only on the main page.

This is mainly an exercise for me to learn how to write vuepress plugins, so it serves a dual purpose. Enjoy.

Install

yarn add vuepress-plugin-netlifycms -D

(Note the -D is very important...)

Usage

In .vuepress/config.js:

module.exports = {
  plugins: [
    [
      'vuepress-plugin-netlifycms',
      {
        headerTags: ['<script src="https://cdn.jsdelivr.net/npm/netlify-identity-widget@1.5.2/build/netlify-identity-widget.min.js"></script>']
      }
    ]
  ]
}

I'm leaving the script source reference here rather than hard-coding it in the plugin in case the version number changes (or something else changes.)

About

Add required script tag to main page header

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published