0.2.3 • Published 10 years ago

uncanny v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

uncanny.js

Generate/compile static files based on file extension. Operates primarily off of config.json in the main directory as such:

{
  "source": "/home/coolguy/blog",
  "target": "/var/www/coolguysblog"
}

If they don't already exist, the following directories will be created in both source and target:

  • blogs/
  • styles/
  • scripts/
  • templates/

Whenever a file is updated in source, the corresponding file will be updated in target.


The blogs/ directory accepts:

  • 2015-10-21-blog-name.md parsed as Markdown using marked into HTML (named as .htm). The timestamp at the beginning will be used as the date of the post, if a md file is saved in the source/blogs/ directory without a timestamp, uncanny will attempt to rename it to work.
  • layout.ejs used to render every blog post into HTML, so you can make it pretty. Output will be target/blog-name.html. Available to the layout is the standard uncanny object as well as a blog object that contains:

    • year: year of the post,
    • month: month of the post,
    • day: numerical day of the post,
    • name: name of blog (with dashes),
    • title: title of the blog (generated),
    • target: location of the file,
    • content: Markdown-parsed content,
    • source: filename of original blog

The templates/ directory accepts:

  • .ejs parsed as ejs using ejs' official node module. Each template is passed the uncanny object containing:

    • version: current running version of uncanny
    • scripts, styles, templates: arrays of filenames from within corresponding directories.
    • blogs: array of blog objects as described above

The scripts/ directory accepts:

  • File extensions appended with .min such as .min.js will be run through UglifyJS before being placed in the target.

The styles/ directory accepts:

  • File extensions appended with .min such as .min.styl or .min.css will be run through Sqwish before being placed in the target.

Further configuration options include:

  • syncOnInit to compile and copy all files from the source directory into the target on startup. Default is false.
  • watchDotFile to watch and compile dotfiles.
  • customDirs an array of additional directories to watch and sync. Currently, files synced via the customDirs config option are not mutated in any way.
  • ignoreCase to allow for case-insensitive extensions, default is false.
  • optimizeImages to run smush against images in the images/ directory. Default is false
  • run with uncanny --watch to persist and watch directories.

Built on top of freud.

License

MIT

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago