diff --git a/README.md b/README.md index 67bb218..a0c2cfa 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,19 @@ you can add MathJax:true to frontmatter ``` mathJax: true ``` + +## Custom CSS and JS + +Add your files in the static folder and list them in the custom_css and custom_js parameters + +For example, with static/css/custom.css and static/js/custom.js, add to `config.toml` + +```toml +[params] + custom_css = ["css/custom.css"] + custom_js = ["js/custom.js"] +``` + ## config.toml example ```toml @@ -167,6 +180,8 @@ pygmentsUseClasses = true headerIcon = "/images/GitHub-Mark-Light-32px.png" location = "China" enableGitalk = true + custom_css = ["css/custom.css"] + custom_js = ["js/custom.js"] [params.gitalk] clientID = "Your client ID" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5b31058..20b8686 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,6 +16,13 @@ {{ end }} + {{ range .Site.Params.custom_css -}} + + {{- end }} + {{ range .Site.Params.custom_js -}} + + {{- end }} + {{ partial "extended_head.html" . }} - \ No newline at end of file +