0.1.3 • Published 5 years ago
vuepress-plugin-remote-url v0.1.3
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 = {
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
.