Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove highlight js and use hugo shortcode instead #15

Merged
merged 1 commit into from
May 5, 2018
Merged
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
9 changes: 0 additions & 9 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ canonifyURLs = true
customCSS = ["default"]
customJS = ["default"]

# options for highlight.js (version, additional languages, and theme)
disable_highlight = false # set to true to disable Highlight
highlightjsVersion = "9.12.0"
highlightjsCDN = "https://cdnjs.cloudflare.com/ajax/libs"
highlightjsLang = ["r", "yaml", "css"]
highlightjsTheme = "github"
MathJaxCDN = "https://cdnjs.cloudflare.com/ajax/libs"
MathJaxVersion = "2.7.4"

# Disqus will take priority over Staticman (github.com/eduardoboucas/staticman)
# due to its ease of use. Feel free to check out both and decide what you would
# prefer to use. See Staticman.yml for additional settings.
Expand Down
16 changes: 0 additions & 16 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@
{{ $.Scratch.Set "jsFiles" false }}
{{ end }}

{{ if (and (not .Site.Params.disable_highlight) (not .Params.disable_highlight)) }}
{{ $highVersion := .Site.Params.highlightjsVersion | default "9.12.0" }}
{{ $highCDN := .Site.Params.highlightjsCDN | default "https://cdnjs.cloudflare.com/ajax/libs" }}
<script src="{{ $highCDN }}/highlight.js/{{ $highVersion }}/highlight.min.js"></script>

{{ $.Scratch.Set "highLangs" .Site.Params.highlightjsLang }}
{{ range .Params.highlightjsLang }}{{ $.Scratch.Add "highLangs" . }}{{ end }}
{{ range ($.Scratch.Get "highLangs") }}
<script src="{{ $highCDN }}/highlight.js/{{ $highVersion }}/languages/{{ . }}.min.js"></script>
{{ end }}
<script>hljs.initHighlightingOnLoad();</script>
{{ end }}

<!-- If the value "default" is passed into the param then we will first
load the standard js files associated with the theme -->
{{ if or (in ($.Scratch.Get "jsFiles") "default") (eq ($.Scratch.Get "jsFiles") false) }}
Expand All @@ -40,8 +27,5 @@
{{ end }}
{{ end }}

<!-- This is called by default since this theme uses highlight.js -->
<script>hljs.initHighlightingOnLoad();</script>
{{ partial "footer_mathjax" . }}
</body>
</html>
3 changes: 0 additions & 3 deletions layouts/partials/footer_mathjax.html

This file was deleted.

7 changes: 0 additions & 7 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@
{{ end }}
{{ end }}

{{ if (and (not .Site.Params.disable_highlight) (not .Params.disable_highlight)) }}
{{ $highTheme := .Site.Params.highlightjsTheme | default "github" }}
{{ $highVersion := .Site.Params.highlightjsVersion | default "9.12.0" }}
{{ $highCDN := .Site.Params.highlightjsCDN | default "//https://cdnjs.cloudflare.com/ajax/libs" }}
<link href='{{ $highCDN }}/highlight.js/{{ $highVersion }}/styles/{{ $highTheme }}.min.css' rel='stylesheet' type='text/css' />
{{ end }}

{{ template "_internal/google_analytics.html" . }}
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT"
licenselink = "https://github.com/jpescador/hugo-future-imperfect/blob/master/LICENSE.md"
description = "Ported theme of HTML5 UP, future imperfect, with some extra goodies"
homepage = "https://github.com/jpescador/hugo-future-imperfect"
tags = ["blog", "responsive", "font awesome", "highlight.js", "fancybox 3", "staticman", "netlify"]
tags = ["blog", "responsive", "font awesome", "fancybox 3", "staticman", "netlify"]
features = ["html5", "css3", "responsive"]
min_version = 0.15

Expand Down