Skip to content

THIS PACKAGE IS IN BEING DEPRECATED - the new version will be available at: speclate/router

License

Notifications You must be signed in to change notification settings

simonmcmanus/speclate-router

Repository files navigation

speclate-router

Greenkeeper badge

Client side router for speclate.

Given a speclate spec (github.com/simonmcmanus/speclate) Generates a page.js router:

Example

var router = require('speclate-router');
var spec = {
    '/': {
        page: 'home'
    }
};

router(spec, {
  before: function () {
      // before the page change.
  },
  after: function () {
      // after the page change.
    $('html,body').scrollTop($('#container'))
  },
  error: function (err) {
      location.reload()
  }
});

Notes

  • / gets replaces for /index.html

For an example see:

https://github.com/lnug/lnug.github.io/blob/master/client/index.js

About

THIS PACKAGE IS IN BEING DEPRECATED - the new version will be available at: speclate/router

Resources

License

Stars

Watchers

Forks

Packages

No packages published