From 7e4ca6f271b6ae5dd50503e00eea0f4a35a608eb Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 24 Jan 2013 09:19:00 +0100 Subject: Typo & syntax highlighting fixes in tutorial 4 --- web/tutorials/04-compilers.markdown | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'web/tutorials') diff --git a/web/tutorials/04-compilers.markdown b/web/tutorials/04-compilers.markdown index ef2877b..522f817 100644 --- a/web/tutorials/04-compilers.markdown +++ b/web/tutorials/04-compilers.markdown @@ -41,9 +41,11 @@ Templates Let's have a look at a simple template: -

$title$

-
Posted on $date$
- $body$ +```html +

$title$

+
Posted on $date$
+$body$ +``` As you can probably guess, template files just contain text and only the `$` character has special meaning: text between dollar signs ("fields") is replaced @@ -53,7 +55,9 @@ use `$$`. You usually compile the templates from disk using the aptly named `templateCompiler`: - match "templates/*" $ compile templateCompiler +```haskell +match "templates/*" $ compile templateCompiler +``` Notice the lack of `route` here: this is because we don't need to write the templates to your `_site` folder, we just want to use them elsewhere. @@ -86,7 +90,7 @@ And `$title$` like this: ```haskell titleContext :: Context a -titleContext :: field "title" $ \item -> do +titleContext = field "title" $ \item -> do metadata <- getMetadata (itemIdentifier item) return $ fromMaybe "No title" $ M.lookup "title" metadata ``` -- cgit v1.2.3 From 3572779568a8a7131beb88ca6e47108f4ab489c5 Mon Sep 17 00:00:00 2001 From: John Tyree Date: Sun, 27 Jan 2013 19:36:01 +0100 Subject: Fix little typo in tutorial 03. --- web/tutorials/03-rules-routes-compilers.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/tutorials') diff --git a/web/tutorials/03-rules-routes-compilers.markdown b/web/tutorials/03-rules-routes-compilers.markdown index d587ab4..fbaa377 100644 --- a/web/tutorials/03-rules-routes-compilers.markdown +++ b/web/tutorials/03-rules-routes-compilers.markdown @@ -61,7 +61,7 @@ this will become clear soon. The real question here is why we use `create` instead of `match`. The answer is simple: there is no `archive.html` file in our project directory! -So if we were to use `match`, no a file would be matched, and hence, nothing +So if we were to use `match`, no file would be matched, and hence, nothing would appear in the output directory. `create`, however, ensures the items listed are always produced. -- cgit v1.2.3 From 9aaadd8696dc3db355834df666a1eb52feaf14ab Mon Sep 17 00:00:00 2001 From: Miikka Koskinen Date: Sat, 2 Feb 2013 22:13:19 +0200 Subject: Add a syntax highlighting example to FAQ --- web/tutorials/faq.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'web/tutorials') diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown index c0bbd3f..ad6dbd8 100644 --- a/web/tutorials/faq.markdown +++ b/web/tutorials/faq.markdown @@ -31,7 +31,19 @@ recent version of Pandoc (1.9 and onwards). Note that you also need to include some CSS in order for this to work! This site, for example, uses the [default Pandoc syntax CSS file][syntax-css]. +To highlight a code block, you need to use Pandoc's fenced code block syntax to +set the block's language. For example, here's how you highlight Haskell code: + + ``` haskell + fac n = foldr (*) 1 [1..n] + ``` + +For details, see Pandoc's user guide on [fenced code +blocks][pandoc-code-blocks] and [inline code][pandoc-inline-code]. + [syntax-css]: https://github.com/jaspervdj/hakyll/blob/master/web/css/syntax.css +[pandoc-code-blocks]: http://johnmacfarlane.net/pandoc/README.html#fenced-code-blocks +[pandoc-inline-code]: http://johnmacfarlane.net/pandoc/README.html#verbatim ## When should I rebuild and when should I build? -- cgit v1.2.3 From 52802ed57f1ee20aed0a17e84b077f04de413eea Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 10 Feb 2013 11:05:37 +0100 Subject: Note that hakyll-init creates a new dir --- web/tutorials/01-installation.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/tutorials') diff --git a/web/tutorials/01-installation.markdown b/web/tutorials/01-installation.markdown index 1a48013..2066886 100644 --- a/web/tutorials/01-installation.markdown +++ b/web/tutorials/01-installation.markdown @@ -32,8 +32,9 @@ started: $ hakyll-init my-site -If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in -your `$PATH`. +This creates a folder `my-site` in the current directory, with some example +content and a generic configuration. If `hakyll-init` is not found, you should +make sure `$HOME/.cabal/bin` is in your `$PATH`. The file `site.hs` holds the configuration of your site, as an executable haskell program. We can compile and run it like this: -- cgit v1.2.3 From cbc298322148c5cc23f0d533cbbfe355a4453b3f Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Mon, 11 Feb 2013 19:53:14 +0200 Subject: Fix a typo in FAQ --- web/tutorials/faq.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/tutorials') diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown index ad6dbd8..63f310f 100644 --- a/web/tutorials/faq.markdown +++ b/web/tutorials/faq.markdown @@ -49,7 +49,7 @@ blocks][pandoc-code-blocks] and [inline code][pandoc-inline-code]. If you execute a `./site build`, Hakyll will build your site incrementally. However, we can not detect if you edited `site.hs`. In this case, you first want -to compile it again `site.hs` again, and then do a `./site rebuild`. +to compile `site.hs` again, and then do a `./site rebuild`. After rebuilding your site, all files will look as "modified" to the filesystem. This means that when you upload your site, it will usually transfer all files -- -- cgit v1.2.3