Skip to content

A port of Lanyon theme for the Haskell-based static generator Hakyll

License

Notifications You must be signed in to change notification settings

hahey/lanyon-hakyll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lanyon for Hakyll

This theme is a port of Lanyon theme originated by Mark Otto (mdo) for Haskell-based static site generator Hakyll originally written by Jasper Van der Jeugt.

Few Remarks:

  • The code for displaying related post is a modified version based on the blog post by Matthew Fitzsimmons. The original version of Lanyon displays only related posts not tags and the port is following the same.
  • The pagination code is a modified version of the code by Mike Limansky.
  • The dynamic sidebar activation is explained in my blog post.
  • Syntax highlighting is slightly different from the original Lanyon; this repository is using the standard syntax highlighting for Hakyll conforming with Pandoc compiler.

Previews

Preview Preview

You can find an example website: my blog.

The original website in Jekyll: Lanyon.

Building the site with stack

Assuming that you have stack installed (install instruction),

$ git clone https://github.com/hahey/lanyon-hakyll.git
$ cd lanyon-hakyll
$ stack build
$ stack exec site clean
$ stack exec site build
$ stack exec site watch

Then you can access the site at http://localhost:8000 using your browser.

Customization

Meta information

You can change the following website information in the file site.hs.

For the RSS feed:

feedConfig = FeedConfiguration
    { feedTitle       = "lanyon-hakyll: Lanyon Theme on Hakyll"
    , feedDescription = "A Fork of Lanyon based on Poole"
    , feedAuthorName  = "Heuna Kim"
    , feedAuthorEmail = "ai@heuna-kim.net"
    , feedRoot        = "https://github.com/hahey/lanyon-hakyll"
    }

For other informations:

siteCtx :: Context String
siteCtx =
    baseCtx `mappend`
    constField "site_description" "Lanyon Theme on Hakyll" `mappend`
    constField "site-url" "https://github.com/hahey/lanyon-hakyll" `mappend`
    constField "tagline" "A Fork of Lanyon based on Poole" `mappend`
    constField "site-title" "lanyon-hakyll" `mappend`
    constField "copy-year" "2020" `mappend`
    constField "github-repo" "https://github.com/hahey/lanyon-hakyll" `mappend`
    defaultContext
baseCtx =
    constField "baseurl" "http://localhost:8000"

You can keep the baseurl field for debugging purposes or viewing the site on your local computer but when you publish it, you will need to change it to the domain address of your website.

Pages and posts

All your files in the pages folder will be compiled, listed in the sidebar in an alphabetical order and displayed upon clicking them. All your markdown files in the posts folder will be compiled, displayed in the home/index page with the pagination and also listed in the archive page.

Color setting

As in the original theme, add your favorite color theme to the <body> element in the templates/default.html file, for example:

<body class="theme-base-0d">

For the available color theme classes, please look at the repository of Lanyon.

About

A port of Lanyon theme for the Haskell-based static generator Hakyll

Resources

License

Stars

Watchers

Forks