Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Way to disable highlight.js #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<title>{{ .Title }}{{ if .IsHome }} &middot; {{ .Site.Title }}{{ end }}</title>
<link rel="shortcut icon" href="{{ "images/favicon.ico" | absURL }}">
<link rel="stylesheet" href="{{ "css/style.css" | absURL }}">

{{ if .Site.Params.disableHighlight }}
{{ else }}
<link rel="stylesheet" href="{{ "css/highlight.css" | absURL }}">
{{ end }}
{{ range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{ end }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/js.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="{{ "js/main.js" | absURL }}"></script>
{{ if .Site.Params.disableHighlight }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if - else could be simplified to

{{ if not .Site.Params.disableHighlight }}
   ....
{{ end }}

{{ else }}
<script src="{{ "js/highlight.js" | absURL }}"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{ end }}

{{ range .Site.Params.customJS }}
<script src="{{ . | absURL }}"></script>
Expand Down
2 changes: 1 addition & 1 deletion static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ a.symbol:hover {
color: #BCD4DA;
}

code {
p code {
font-family:Menlo, Monaco, Courier;
background-color:#EEE; font-size:14px;
padding: 4px;
Expand Down