jondashkyle / nanopage

super handy utilities for traversing flat content state
Apache License 2.0
42 stars 4 forks source link

Restructuring #14

Open jondashkyle opened 6 years ago

jondashkyle commented 6 years ago

Added all sorts of fun stuff here.

Still need some work, but though to create a pull request to begin tracking progress for what’s being discussed for content state. For example, we should determine what utilities we’d like file to expose. Perhaps something related to sizes and dimensions?

jondashkyle commented 6 years ago

Can now start messing with this by using the next tag on npm.

npm i nanopage@next --save
jondashkyle commented 6 years ago

A fun new one. Both the page() and file() methods accept a glob in addition to a path (string) and state (obj).

var images = page('../*.jpg').toArray()
jondashkyle commented 6 years ago

Relative urls have also been introduced.

var parentTitle = page('../').value('title')

This has been published as next2 to npm under the @next tag.