1.0.2 • Published 5 years ago

quik-pages v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

quik-pages

A plug-in for quik-server that makes it easy to manage webpages Handles history for single-page-apps and also adds pages to the JSX chain

How do I use it?

Add the plugin to quik server let quikPageManager = server.quikAdd("quik-pages") Then in your main frontend file (website.jsx)

let yourHomePageElementOrFunctionThatReturnsAnElement = document.createElement("body")
// add all your pages here
pageManager.pages = {
    Home : yourHomePageElementOrFunctionThatReturnsAnElement
}

// tell it what you want to do when a specific page is loaded
pageManger.load = (pageName) => {
    if (pageName == "home" || pageName == "") {
        document.body = pageManager.Home
    }
}

// load the current page after loading this file for the first time
pageManager.load() // no arguments = use current page url

// tell it what you want to do when a specific page is loaded pageManger.load = (pageName) => { if (pageName == "home" || pageName == "") { document.body = } } // load the current page after loading this file for the first time pageManager.load() // no arguments = use current page url

1.0.2

5 years ago

1.0.0

5 years ago