NoJs version now generates a index.html page
No longer is nojs/pages/* generated. Instead pages are generated to nojs/pageName; where pageName is the name of the page (with extension changed to html) with the exception that if the page is named "home.markdown" it will be generated as index.html in the nojs folder. Fixed links in templates accordingly.
This commit is contained in:
parent
610d11903b
commit
de5b144286
11
site.hs
11
site.hs
|
@ -212,13 +212,20 @@ main = hakyllWith myConfig $ do
|
|||
>>= loadAndApplyTemplate "templates/default-nojs.html" newsNojsCtx
|
||||
>>= relativizeUrls
|
||||
|
||||
-- This route is used for the initial pass of the pages (nav-gen) and the final nojs page output
|
||||
let pagesNoJsRoute = customRoute (\r -> if toFilePath r == "pages/home.markdown"
|
||||
then "pages/index.markdown"
|
||||
else toFilePath r) `composeRoutes`
|
||||
gsubRoute "pages" (const "nojs") `composeRoutes`
|
||||
setExtension "html"
|
||||
|
||||
match "pages/*" $ version "nav-gen" $ do
|
||||
route $ customRoute (\r -> "nojs" </> toFilePath r) `composeRoutes` setExtension "html"
|
||||
route $ pagesNoJsRoute
|
||||
compile $ pandocCompiler
|
||||
>>= loadAndApplyTemplate "templates/page.html" defaultContext
|
||||
|
||||
match "pages/*" $ version "nojs" $ do
|
||||
route $ customRoute (\r -> "nojs" </> toFilePath r) `composeRoutes` setExtension "html"
|
||||
route $ pagesNoJsRoute
|
||||
compile $ do
|
||||
-- Show a slideshow of news using js..limit to the 3 most recent posts
|
||||
recentNews <- loadAllSnapshots ("news/**" .&&. hasVersion "nojs") "content"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div id="noscript-alert" class="container">
|
||||
<div class="alert alert-danger">
|
||||
<h1>This site requires javascript!</h1>
|
||||
<p>If you insist on not using javascript we provide a simplified website <a class="alert-link" href="nojs/pages/home.html">here</a></p>
|
||||
<p>If you insist on not using javascript we provide a simplified website <a class="alert-link" href="nojs/pages">here</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/nojs/pages/home.html">RekahSoft</a>
|
||||
<a class="navbar-brand" href="/nojs">RekahSoft</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
|
Loading…
Reference in New Issue