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

Adds i18n support to the theme #49

Merged
merged 11 commits into from
Jun 2, 2019
Prev Previous commit
Next Next commit
Highlightjs custom options
  • Loading branch information
tomanistor committed May 3, 2018
commit 1f1452077da515cb349710539753f505dab3e968
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,29 @@ disableKinds = ["taxonomy", "taxonomyTerm"] # This theme does not currently use
logoSmall = "/images/osprey-logo.png"
favicon = "favicon.ico"
opengraphImage = "/images/osprey.png"
email = ""
googleTagManager = ""
customCSS = false

# Social media links in footer
twitter = "TomaNistor"
linkedin = "tomanistor"
github = "tomanistor"
facebook = ""
email = ""
googleTagManager = ""

# Copyright and theme author credit in footer
copyright = false
credit = false

# Cache busting of static resources (additional set up required)
cacheBustCSS = true
cacheBustJS = true

# Code highlighting with highlight.js
highlightJS = true
copyright = true
credit = true
customCSS = false
cacheBustCSS = false
cacheBustJS = false
highlightJSStyle = "" # For custom highlight.js styles, add your /path/to/styles/default.css
highlightJSScript = "" # For custom highlight.js languages config, add your /path/to/highlight.pack.js

# Choose either Formspree contact form or Basin contact form
ajaxFormspree = false
ajaxFormspreeGold = false
Expand Down
19 changes: 15 additions & 4 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,29 @@ disableKinds = ["taxonomy", "taxonomyTerm"] # This theme does not currently use
logoSmall = "/images/osprey-logo.png"
favicon = "favicon.ico"
opengraphImage = "/images/osprey.png"
email = ""
googleTagManger = ""
customCSS = false

# Social media links in footer
twitter = "TomaNistor"
linkedin = "tomanistor"
github = "tomanistor"
facebook = ""
email = ""
googleTagManger = ""
highlightJS = true

# Copyright and theme author credit in footer
copyright = true
credit = true
customCSS = false

# Cache busting of static resources (additional set up required)
cacheBustCSS = false
cacheBustJS = false

# Code highlighting with highlight.js
highlightJS = true
highlightJSStyle = "" # For custom highlight.js styles, add your /path/to/styles/default.css
highlightJSScript = "" # For custom highlight.js languages config, add your /path/to/highlight.pack.js

# Choose either Formspree contact form or Basin contact form
ajaxFormspree = false
ajaxFormspreeGold = false
Expand Down
10 changes: 9 additions & 1 deletion layouts/partials/body-bottom.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ if .Site.Params.highlightJS }}
{{ if .Site.Params.highlightJSScript }}
<script src="{{ .Site.Params.highlightJSScript }}"></script>
{{ else }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ end }}
<script>hljs.initHighlightingOnLoad();</script>
{{ end }}

{{ if .IsHome }}
<script src="/scripts/{{ if .Site.Params.cacheBustJS }}{{ index .Site.Data.cachedAssets "index.js" }}{{ else }}index.min.js{{ end }}" type="text/javascript"></script>
{{ if or (and (.Site.Params.ajaxFormspree) (.Site.Params.ajaxFormspreeGold)) (.Site.Params.ajaxBasin) }}
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@
{{ end }}

{{ if .Site.Params.highlightJS }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
{{ if }}
<link rel="stylesheet" href="{{ .Site.Params.highlightJSStyle }}">
{{ else }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
{{ end }}
{{ end }}

{{ if .Site.GoogleAnalytics }}
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion static/scripts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ var toggle = function(el) {
$('html').style.overflowY = 'scroll';
}
});

}());

// Mobile browsers viewport height bug fix
Expand Down
3 changes: 0 additions & 3 deletions static/scripts/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,4 @@ var toggle = function(el) {
$('html').style.overflowY = 'scroll';
}
});

// Highlight.js initialization
hljs.initHighlightingOnLoad();
}());