Git Product home page Git Product logo

stex's Introduction

Stex: Static sites from Express apps

Note: This is very alpha. Mirror mode works but build mode is still lacking some big parts. Proceed with caution.

Stex is a static site generator tht works with existing Express apps, by looking at the routes you have defined and building static versions of each page.

It operates in two different modes:

  • online/mirror mode: produce a static page for each URL that is requested through the app; think of it as "live spidering" your site as users user it.

  • offline/build mode: given a list of possible pages (basically, URL parameter values mapped against the routes defined), build out all possible static pages. As of v0.0.1 this mode is not complete.

Why another static site generator?

There are a million great static site generators for Node.js out there. Unfortunately, they all seem to share one glaring fault: they're all frameworks, meaning you have to build your site around the product rather than just including the library and using it.

I wanted a simple solution that you could drop in to an existing Express app in a couple of hours and easily configure.

Examples

See examples/stupid-content-management for an example of a braindead content management system which works seamlessly as a static site generator as well.

Limitations

  • Not safe to use when the page output includes personal data. In the future perhaps we could turn off online mode when certain cookies are set, etc.

  • Mostly useful for GET routes (this is configurable; see the methods option)

  • Requires an annoying/agonizing list of URL parameters for offline build mode (i.e., all valid user IDs or blog post slugs that may wind up in URLs). Luckily these are usually trivially available in your database somewhere if you care to look.

stex's People

Stargazers

RSSDavidGero avatar

Watchers

Thomas Lackner avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.