diff options
author | tummychow <tummychow@users.noreply.github.com> | 2016-01-02 05:20:07 +0300 |
---|---|---|
committer | tummychow <tummychow@users.noreply.github.com> | 2016-01-02 06:02:52 +0300 |
commit | 293b816e592c4c5e77e21e900a18e664b6014d18 (patch) | |
tree | fa1d57a735363b4490f59c16d0205e66498e03e1 | |
parent | 2a7ec21f7c4b27b418ed6b7e82fd2f9911060572 (diff) |
Fix highlighting
Newer versions of hugo support smartypants in markdown rendering, which
was changing the quotes to smart quotes. Luckily there's a shortcode
feature to disable this where necessary! Thumbs up for whoever was
thinking ahead.
Also, it seems we now have support for pygments CSS classes, so lanyon's
CSS works the way we originally intended!
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | config.json | 2 | ||||
-rw-r--r-- | content/post/2014-01-01-example-content.md | 4 |
3 files changed, 9 insertions, 3 deletions
@@ -34,7 +34,11 @@ Lanyon-Hugo generates a post list at `/post/`. By default, Lanyon doesn't actual The CSS from the original Lanyon is unchanged, and you can find it in [`static/css`](static/css). Any of the modifications suggested for Lanyon can also be applied to Lanyon-Hugo, by changing the CSS here. -You can use syntax highlighting, if you have [Pygments](http://pygments.org/). See the "example content" post for an example. Lanyon has a color scheme of some kind for Pygments in `css/syntax.css`, but right now Hugo doesn't know how to use it (everything will be higlighted in Monokai). When Hugo implements this feature, I will also add it to Lanyon-Hugo. More detail on Hugo's syntax highlighting shortcode can be found [here](http://hugo.spf13.com/extras/highlighting). +You can use syntax highlighting, if you have [Pygments](http://pygments.org/). See the "example content" post for an example. Lanyon has a color scheme of some kind for Pygments in `css/syntax.css`, which this theme will use. More detail on Hugo's syntax highlighting shortcode can be found [here](http://hugo.spf13.com/extras/highlighting). You can also generate CSS for other pygments themes like so: + +```bash +pygmentize -f html -S colorful -a .highlight > static/css/syntax.css +``` ## Contributing diff --git a/config.json b/config.json index bef2b25..aaa449f 100644 --- a/config.json +++ b/config.json @@ -12,6 +12,8 @@ "fixed": ":title/" }, + "pygmentsuseclasses": true, + "params": { "Title": "Lanyon", "Tagline": "A Jekyll theme", diff --git a/content/post/2014-01-01-example-content.md b/content/post/2014-01-01-example-content.md index 316f3f1..4355e2a 100644 --- a/content/post/2014-01-01-example-content.md +++ b/content/post/2014-01-01-example-content.md @@ -35,7 +35,7 @@ Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est Cum sociis natoque penatibus et magnis dis `code element` montes, nascetur ridiculus mus. -{{% highlight js %}} +{{< highlight js >}} // Example can be run directly in your JavaScript console // Create a function that takes two arguments and returns the sum of those arguments @@ -44,7 +44,7 @@ var adder = new Function("a", "b", "return a + b"); // Call the function adder(2, 6); // > 8 -{{% /highlight %}} +{{< /highlight >}} Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa. |