diff options
| author | Bartosz izdwuut Konikiewicz <izdwuut@gmail.com> | 2018-09-27 12:44:06 +0200 |
|---|---|---|
| committer | Bartosz izdwuut Konikiewicz <izdwuut@gmail.com> | 2018-09-27 13:02:44 +0200 |
| commit | 52e734fb3c0b119f57ef5bd6dfe871d80c7d2379 (patch) | |
| tree | f8e2167fea1e57b4f4a6ecfd4d866a96e2ca08ab | |
| parent | 3730b32107f2ca4d40d9002357e95bc372f64bc7 (diff) | |
Add highlighting of code snippets with numbered lines enabled.
| -rw-r--r-- | layouts/partials/footer.html | 6 | ||||
| -rw-r--r-- | layouts/partials/header.html | 1 | ||||
| -rw-r--r-- | static/css/style.css | 23 |
3 files changed, 23 insertions, 7 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f5bf812..df8dcda 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -8,15 +8,9 @@ </footer> <script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script> <script data-no-instant>InstantClick.init();</script> -<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js" data-no-instant></script> <script data-no-instant> - hljs.initHighlightingOnLoad(); addMenuListener(); InstantClick.on('change', function() { - var blocks = document.querySelectorAll('pre code'); - for (var i = 0; i < blocks.length; i++) { - hljs.highlightBlock(blocks[i]); - } addMenuListener(); }); function addMenuListener() { diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 1ab95d8..3003f1a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -24,7 +24,6 @@ {{ end -}} <!-- Styles --> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700,700i" rel="stylesheet"> - <link href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/atom-one-dark.min.css" rel="stylesheet"> <link href="{{.Site.BaseURL}}css/style.css" rel="stylesheet"> <!-- Favicons --> <link rel="apple-touch-icon" href="{{.Site.BaseURL}}img/apple-touch-icon.png"> diff --git a/static/css/style.css b/static/css/style.css index 536ac23..678687a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -488,3 +488,26 @@ pre, code { display: none; } } + +/* Highlight +------------------------------ */ +.post-content pre code { + display: block; +} +.post-content table code { + padding-top: 0; + padding-bottom: 0; +} +.post-content pre { + margin: 30px 0px; + border-radius: 6px; +} +.post-content table pre { + margin: 20px 0px; +} +.highlight table { + margin: 30px 0 !important; +} +.highlight div { + border-radius: 6px; +} |
