2.0.4 • Published 10 years ago

docpad-plugin-link v2.0.4

Weekly downloads
15
License
-
Repository
github
Last release
10 years ago

Link Plugin for DocPad

PayPayl donate button Flattr donate button

Summary

Take the document'sid and generate the corresponding html link.

Purpose

Prevents the breaking of links when a document is moved to a different directory or gets renamed while also keeping the link DRY since the link title and text is also pulled from the document's meta data.

Install

npm install --save docpad-plugin-link

Install for testing

git clone https://github.com/oleersoy/docpad-plugin-link.git
cd docpad-plugin-link
npm install
make compile

Test

make test

Configuration

Override the following defaults when necessary:

# ...
{
	templateData:
		site:
			url: 'http://localhost:9778/base'
}
# ...

Examples

Run the tests to see the below executed.

Documents LocationDocument IDDocument titleCallReturned
root_document.md.eco1Root Meta Data Title for 1@link(1)<%- @link(1)%>
root_document.md.eco1Root Meta Data Title for 1@link(1, {title: "Custom Title 1"})<%- @link(1, {title: "Custom Title 1"})%>
root_document.md.eco1Root Meta Data Title for 1@link(1, {text: "Custom Text 1"})<%- @link(1, {text: "Custom Text 1"})%>
root_document.md.eco1Root Meta Data Title for 1@link(1, {title: "Custom Title 1", text: " Custom Text 1"})<%- @link(1, {title: "Custom Title 1", text: "Custom Text 1"})%>
sub/sub_document.md.eco2Sub Meta Data Title for 2@link(2)<%- @link(2)%>
sub/sub_document.md.eco2Sub Meta Data Title for 2@link(2, {title: "Custom Title 2"})<%- @link(2, {title: "Custom Title 2"})%>
sub/sub_document.md.eco2Sub Meta Data Title for 2@link(2, {text: "Custom Text 2"})<%- @link(2, {text: "Custom Text 2"})%>
sub/sub_document.md.eco2Sub Meta Data Title for 2@link(2, {title: "Custom Title 2", text: " Custom Text 2"})<%- @link(2, {title: "Custom Title 2", text: "Custom Text 2"})%>

License

See License.md file Copyright © 2013+ Ole Ersoy

2.0.4

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago