mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 01:54:06 +00:00
Adds support for custom_css and custom_js
This commit is contained in:
15
README.md
15
README.md
@@ -137,6 +137,19 @@ you can add MathJax:true to frontmatter
|
|||||||
```
|
```
|
||||||
mathJax: true
|
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
|
## config.toml example
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
@@ -167,6 +180,8 @@ pygmentsUseClasses = true
|
|||||||
headerIcon = "/images/GitHub-Mark-Light-32px.png"
|
headerIcon = "/images/GitHub-Mark-Light-32px.png"
|
||||||
location = "China"
|
location = "China"
|
||||||
enableGitalk = true
|
enableGitalk = true
|
||||||
|
custom_css = ["css/custom.css"]
|
||||||
|
custom_js = ["js/custom.js"]
|
||||||
|
|
||||||
[params.gitalk]
|
[params.gitalk]
|
||||||
clientID = "Your client ID"
|
clientID = "Your client ID"
|
||||||
|
@@ -16,6 +16,13 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
<meta name="theme-color" content="#1e2327">
|
<meta name="theme-color" content="#1e2327">
|
||||||
|
|
||||||
|
{{ range .Site.Params.custom_css -}}
|
||||||
|
<link rel="stylesheet" href="{{ . | absURL }}">
|
||||||
|
{{- end }}
|
||||||
|
{{ range .Site.Params.custom_js -}}
|
||||||
|
<script type="text/javascript" src="{{ . | absURL }}"></script>
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
<!-- Extended head section-->
|
<!-- Extended head section-->
|
||||||
{{ partial "extended_head.html" . }}
|
{{ partial "extended_head.html" . }}
|
||||||
</head>
|
</head>
|
Reference in New Issue
Block a user