vuepress-plugin-remote-url

0.1.3 • Public • Published

vuepress-plugin-remote-url

A VuePress plugin to handle urls of remote repository.

This plugin is for VuePress 1.x.

Install

  • yarn

    yarn add -D vuepress-plugin-remote-url

  • npm

    npm install --save-dev vuepress-remote-url

Usage

// .vuepress/config.js
module.exports = (option, ctx) => {
    plugins: [
        "remote-url",
        // ...
    ],
    // ...
}

This plugin finds repository information automatically from local vsc config files (e.g. .git/ directory.)

Then each $page object has remoteUrl property:

// $page of sourceDir/index.md
{
    title: "title",
    // ...
    regularPath: "/",
    remoteUrl: {
        view: "https://github.com/someone/somerepo/blob/master/path/to/sourceDir/index.md",
        raw: "https://github.com/someone/somerepo/raw/master/path/to/sourceDir/index.md",
        edit: "(same)",
        blame: "(as)",
        history: "(above)"
    }
}

NOTE: If the page is generated by some plugin, the value of remoteUrl property is null.

Package Sidebar

Install

npm i vuepress-plugin-remote-url

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

8.06 kB

Total Files

4

Last publish

Collaborators

  • gnqg