Skip to content

Commit c7ed607

Browse files
authored
Merge pull request #31 from Netcentric/highlight
feat: adds syntax highlight
2 parents 4c41729 + bbb4515 commit c7ed607

File tree

5 files changed

+1211
-2
lines changed

5 files changed

+1211
-2
lines changed

themes/influencer-hugo/assets/js/script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
function _init() {
2020
_setElements();
2121
_setEventListeners();
22+
23+
// Syntax highlighter
24+
hljs.highlightAll();
2225
}
2326

2427
_init();

themes/influencer-hugo/layouts/partials/footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
</div>
1818
</footer>
1919

20-
{{ "<!-- JS Plugins -->" | safeHTML }}
2120
{{ range .Site.Params.plugins.js}}
2221
<script src="{{ .URL | absURL }}"></script>
2322
{{ end }}
2423

25-
{{ "<!-- Main Script -->" | safeHTML }}
24+
<script src="/js/highlight.min.js"></script>
25+
2626
{{ $script := resources.Get "js/script.js" | minify}}
2727
<script src="{{ $script.Permalink }}"></script>

themes/influencer-hugo/layouts/partials/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<style>{{ .Content | safeCSS }}</style>
1717
{{ end }}
1818

19+
<link rel="stylesheet" href="/css/highlight.min.css">
1920
<meta property="og:title" content="{{ if .Title }}{{ .Title }} | {{ end }}{{ .Site.Title }}" />
2021
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Summary | plainify }}{{ end }}" />
2122
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />

themes/influencer-hugo/static/css/highlight.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)