From 3be6c45b4d0ee64c651b6a18f21218625f9402f0 Mon Sep 17 00:00:00 2001 From: AUTplayed Date: Sun, 21 Oct 2018 02:31:33 +0200 Subject: [PATCH] final attempt for github pages --- README.md | 7 +++++-- {docs => demo}/index.html | 2 +- {docs => demo}/ldf.js | 0 {docs => demo}/package-lock.json | 0 {docs => demo}/package.json | 0 {docs => demo}/pages/controls/controls.html | 0 {docs => demo}/pages/controls/controls.js | 0 {docs => demo}/pages/helloworld/helloworld.css | 0 {docs => demo}/pages/helloworld/helloworld.html | 0 {docs => demo}/pages/index/index.html | 0 {docs => demo}/pages/login/icon.png | Bin {docs => demo}/pages/login/login.css | 0 {docs => demo}/pages/login/login.html | 0 {docs => demo}/test.js | 0 ldf.js | 2 +- 15 files changed, 7 insertions(+), 4 deletions(-) rename {docs => demo}/index.html (89%) rename {docs => demo}/ldf.js (100%) rename {docs => demo}/package-lock.json (100%) rename {docs => demo}/package.json (100%) rename {docs => demo}/pages/controls/controls.html (100%) rename {docs => demo}/pages/controls/controls.js (100%) rename {docs => demo}/pages/helloworld/helloworld.css (100%) rename {docs => demo}/pages/helloworld/helloworld.html (100%) rename {docs => demo}/pages/index/index.html (100%) rename {docs => demo}/pages/login/icon.png (100%) rename {docs => demo}/pages/login/login.css (100%) rename {docs => demo}/pages/login/login.html (100%) rename {docs => demo}/test.js (100%) diff --git a/README.md b/README.md index 3f9aba5..8f35aa9 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ ldf.nav("login"); You can include css and js in your html files just like normal, they will also be dynamically loaded. -For a small demonstration, check out the `docs` directory. +For a small demonstration, check out the `demo` directory, [or check it out live.](https://autplayed.github.io/ldf/demo/) **Notes:** @@ -79,6 +79,9 @@ LDF currently allows for some configuration. ldf.notfound = "
Page not Found
"; // The directory your pages are stored on the server, default is /pages ldf.pagedir = "/pages"; +// A base url that is prepended for every navigation +// Used in my case for github pages since that has a required base url +ldf.baseurl = ""; // The css selector string LDF will wait on before displaying the page. // By default it waits for all stylesheets and all elements with a src attribute (like images), but not scripts. ldf.waitselector = "link[rel='stylesheet'],:not(script)[src]"; @@ -95,7 +98,7 @@ In order for the refresh function to work, you will have to include a special ca You have to look at the request if it's not `/` but a request to a page, and send back your `index.html`. But you can't just always send back `index.html` when the requested file isn't found, unless you want your site to break if a user visits a missing page, since LDF relies on getting an error from a request to a missing page. -A small implementation of this I used in the docs/example project (with nodejs and express) looks like this: +A small implementation of this I used in the demo/example project (with nodejs and express) looks like this: ```javascript // Static resources diff --git a/docs/index.html b/demo/index.html similarity index 89% rename from docs/index.html rename to demo/index.html index 19359de..e09254a 100644 --- a/docs/index.html +++ b/demo/index.html @@ -10,7 +10,7 @@

My Website