Skip to content

Commit

Permalink
Merge pull request kakawait#120 from yamila-moreno/develop
Browse files Browse the repository at this point in the history
Add css and js easy customizacion
  • Loading branch information
kakawait authored Feb 28, 2017
2 parents 32e5ab1 + 92df388 commit c9d2cfa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ E.g to display a shortcut to open algolia search window :
| favicon | Your favicon path |
| imageGallery | Display an image gallery at the end of a post which have `photos` variables. (false: disabled, true: enabled) |
| hierarchicalCategories | Define categories will create hierarchy between parents: `categories = ["foo", "bar"]` will consider "bar" a sub-category of "foo". If false it will flat categories. |
| customCSS | Define files with css that override or extend the theme css; they are expected in `static` folder: `customCSS` = ["css/mystyles.css"]. |
| customJS | Define files with js that override or extend the theme js; they are expected in `static` folder: `customJS` = ["js/myscripts.js"]. |

E.g :
A category page look like this with `hierarchicalCategories = true` :
Expand Down
8 changes: 8 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,11 @@ canonifyurls = true
# Customize copyright value "© 2016 <CUSTOMIZATION>. All Rights Reserved"
# [params.footer]
# copyright = "<a href=\"https://github.com/kakawait\">kakawait</a>"
#
# Custom CSS. Put here your custom CSS files. They are loaded after the theme CSS;
# they have to be referred from static root. Example
# customCSS = ["css/foo.css"]

# Custom JS. Put here your custom JS files. They are loaded after the theme JS;
# they have to be referred from static root. Example
# customJS = ["js/foo.js"]
5 changes: 4 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@
<!--EXTERNAL STYLES END-->
<!--STYLES-->
<link rel="stylesheet" href="/css/style-gwlo24d2hxipxk8bi1sxik0zhlpn9t7ebcmgp9kubmmcjfzlavuyhvbqumhn.min.css" />
{{ range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
{{ end }}
<!--STYLES END-->

{{ if .Params.ga.async }}
{{ template "_internal/google_analytics_async.html" . }}
{{ else }}
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@
var algoliaIndex = algoliaClient.initIndex('{{ .indexName }}');
</script>
{{ end }}
{{ end }}
{{ end }}

{{ range .Site.Params.customJS }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{ end }}

0 comments on commit c9d2cfa

Please sign in to comment.