site: use a hamlet template, simplify
This commit is contained in:
parent
7d070711f7
commit
99300c6f45
40
site/site.hamlet
Normal file
40
site/site.hamlet
Normal file
@ -0,0 +1,40 @@
|
||||
!!!
|
||||
<html
|
||||
<head
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>#{title}
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css" />
|
||||
<style
|
||||
<link rel="stylesheet" type="text/css" href="/js/highslide/highslide.css" />
|
||||
<script type="text/javascript" src="/js/highslide/highslide.js"></script>
|
||||
<script type="text/javascript">
|
||||
hs.graphicsDir = '/js/highslide/graphics/';
|
||||
hs.outlineType = 'rounded-black';
|
||||
hs.captionEval = 'this.thumb.title';
|
||||
|
||||
<body
|
||||
<div style="text-align:center;"
|
||||
<!-- <a href="/"><img src="/logo.jpg" border="0" ALT="" /></a> -->
|
||||
<div#navigation
|
||||
<a href="/README.html">Home</a>
|
||||
<a href="/DOWNLOAD.html">Download</a>
|
||||
<a href="/MANUAL.html">Docs</a>
|
||||
<a href="/DEVELOPMENT.html">Development</a>
|
||||
<a href="/NEWS.html">News</a>
|
||||
<a href="/SCREENSHOTS.html">Screenshots</a>
|
||||
<a href="http://demo.hledger.org">Demo</a>
|
||||
|
||||
#{body}
|
||||
|
||||
<div#footer
|
||||
<hr />
|
||||
© 2007-2011 <a href="http://joyful.com/">Simon Michael</a> and contributors
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');
|
||||
document.write(unescape('%3Cscript src=\'' + gaJsHost + 'google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E'));
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker('UA-3456280-3');
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
@ -22,12 +22,12 @@ main = do
|
||||
symlinkIndexHtml
|
||||
symlinkProfsDir
|
||||
hakyll $ do
|
||||
match "templates/*" $ compile templateCompiler
|
||||
match "*.hamlet" hamlet
|
||||
match "*.md" page
|
||||
match "css/*" css
|
||||
match "images/*" file
|
||||
match "js/**" file
|
||||
match "robots.txt" file
|
||||
match "*.md" page
|
||||
|
||||
symlinkPagesFromParentDir = do
|
||||
fs <- filter (".md" `isSuffixOf`) `fmap` getDirectoryContents ".."
|
||||
@ -35,11 +35,12 @@ symlinkPagesFromParentDir = do
|
||||
symlinkIndexHtml = ensureSiteDir >> system "ln -sf README.html _site/index.html"
|
||||
symlinkProfsDir = ensureSiteDir >> system "ln -sf ../../profs _site/profs"
|
||||
ensureSiteDir = system "mkdir -p _site"
|
||||
hamlet = compile templateCompiler
|
||||
file = route idRoute >> compile copyFileCompiler
|
||||
css = route idRoute >> compile compressCssCompiler
|
||||
page = do
|
||||
route $ setExtension "html"
|
||||
compile $ pageCompilerWith pandocParserState pandocWriterOptions >>> applyTemplateCompiler "templates/default.html" >>> relativizeUrlsCompiler
|
||||
compile $ pageCompilerWith pandocParserState pandocWriterOptions >>> applyTemplateCompiler "site.hamlet" >>> relativizeUrlsCompiler
|
||||
|
||||
pandocParserState = defaultParserState {-
|
||||
-- stateParseRaw = False, -- ^ Parse raw HTML and LaTeX?
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>hledger.org - $title$</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css" />
|
||||
<script type="text/javascript" src="/js/highslide/highslide.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/highslide/highslide.css" />
|
||||
<script type="text/javascript">
|
||||
hs.graphicsDir = '/js/highslide/graphics/';
|
||||
hs.outlineType = 'rounded-black';
|
||||
hs.captionEval = 'this.thumb.title';
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align:center;">
|
||||
<!-- <a href="/"><img src="/logo.jpg" border="0" ALT="" /></a> -->
|
||||
</div>
|
||||
<div id="navigation">
|
||||
<a href="/README.html">Home</a>
|
||||
<a href="/DOWNLOAD.html">Download</a>
|
||||
<a href="/MANUAL.html">Docs</a>
|
||||
<a href="/DEVELOPMENT.html">Development</a>
|
||||
<a href="/NEWS.html">News</a>
|
||||
<a href="/SCREENSHOTS.html">Screenshots</a>
|
||||
<a href="http://demo.hledger.org">Demo</a>
|
||||
</div>
|
||||
$body$
|
||||
|
||||
<div id="footer">
|
||||
<hr />
|
||||
© 2007-2011 <a href="http://joyful.com/">Simon Michael</a> and contributors
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');
|
||||
document.write(unescape('%3Cscript src=\'' + gaJsHost + 'google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E'));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker('UA-3456280-3');
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user