https://github.com/grassator/docpad-plugin-datefromfilename
DocPad plugin for specifying document dates at the beginning of their filenames
https://github.com/grassator/docpad-plugin-datefromfilename
Last synced: 10 months ago
JSON representation
DocPad plugin for specifying document dates at the beginning of their filenames
- Host: GitHub
- URL: https://github.com/grassator/docpad-plugin-datefromfilename
- Owner: grassator
- Created: 2013-03-10T09:57:45.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-12-10T12:12:57.000Z (about 9 years ago)
- Last Synced: 2025-02-23T09:38:52.105Z (11 months ago)
- Language: CoffeeScript
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Date from Filename Plugin for DocPad
This plugin provides support for [DocPad](https://docpad.org) for specifying
document dates at the beginning of their filenames.
## Install
```
npm install --save docpad-plugin-datefromfilename
```
## Usage
To use, simply prepend document file name with date formatted like `YYYY-MM-DD`
separated from base name with either nothing, space, `-` or `_`. In the end
basename (without extension) of your file should look something like this:
```
2013-03-10_my-awesome-page
```
## Configuration
By default, this plugin does not remove date part from output filename. This can be changed in your [DocPad configuration file](http://docpad.org/docs/config) by adding something similar to the following:
``` coffee
plugins:
datefromfilename:
removeDate: true
```
You can customize the regular expression used to parse dates from filenames with `dateRegExp`:
```coffee
plugins:
datefromfilename:
dateRegExp: /\b(\d{4})-(\d{2})-(\d{2})-/
```
## License
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)