From 6ec9a6fc1d43c8d2a1495e147157dc545175b129 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 27 Jun 2015 01:04:51 +0200 Subject: Generate static pages with a watcher and serve files with a simple http server --- router.js | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 router.js (limited to 'router.js') diff --git a/router.js b/router.js deleted file mode 100644 index 2aac572..0000000 --- a/router.js +++ /dev/null @@ -1,52 +0,0 @@ -(function () { - - this.addEventListener('hashchange', router); - this.addEventListener('load', router); - - function router() { - const url = location.hash.slice(2) || 'presentation'; - const contentElement = document.getElementById('content'); - const htmlElement = document.querySelector('html'); - addClass(htmlElement, 'waitCursor'); - fetchFile('Pages/' + url + '.md', function(contentMd) { - removeClass(htmlElement, 'waitCursor'); - contentElement.innerHTML = markdown.toHTML(contentMd); - }, function() { - const notFoundPage = '