Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docpad-plugin-cleanurls

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docpad-plugin-cleanurls

Adds support for clean urls to DocPad

  • 2.7.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Clean URLs Plugin for DocPad

Build Status NPM version Dependency Status Development Dependency Status
Gittip donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Adds support for clean URLs to DocPad

Install

docpad install cleanurls

Usage/Configure

static

In non-static environments we work by setting the document's url to it's clean url. This means that redirection occurs on the dynamic server level.

For the static environment (i.e. when running docpad with the --env static flag, e.g. running docpad generate --env static) we will set the static plugin configuration option to true. This will in addition to performing redirections via the built-in dynamic server within DocPad for speed, we will also write special static redirection HTML files to the output directory, that will redirect the user to the new clean location (e.g. the document pages/welcome.html will not we outputted to pages/welcome/index.html, with pages/welcome.html now being a special HTML redirect document to the clean location).

If you would like to always use the static mode, you can set the static plugin configuration option to true by doing:

plugins:
	cleanurls:
		static: true

If you would like to disable the static mode for the static environment, you can do so by doing:

environments:
	static:
		plugins:
			cleanurls:
				static: false

trailingSlashes

Enable this plugin configuration option to generate document.urls like '/beep/' instead of /beep. Defaults to false.

collectionName

You can use this plugin configuration option (defaults to html) to tell the cleanurls plugin to use your own custom collection for which documents to apply cleanurls to.

For insstance, if you are wanting to remove all cleanurls for all documents that have cleanurls: false in the meta data, then you could do the following in your docpad configuration file:

# Define a custom collection for cleanurls that ignores the documents we don't want
collections:
	cleanurls: ->
		@getCollection('html').findAllLive(cleanurls: $ne: false)

# Tell our clean urls plugin to use this collection
plugins:
	cleanurls:
		collectionName: 'cleanurls'

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gittip donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © 2012+ Bevry Pty Ltd us@bevry.me (http://bevry.me)
Copyright © 2011 Benjamin Lupton b@lupton.cc (http://balupton.com)

Keywords

FAQs

Package last updated on 13 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc