Skip to content

Commit

Permalink
Fix syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrblz committed Aug 24, 2020
1 parent 7ef586f commit e298aae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ Then, you can generate a different style by running:
hugo gen chromastyles --style=monokailight > assets/css/syntax.css
```
If you get any errors, make sure the `assets/css/` directory exists within your sites root folder.
Include the newly generated `syntax.css` like a standard custom css script:
```
[params]
customCss = ["css/syntax.css"]
```

## License

Expand Down
7 changes: 1 addition & 6 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" type="text/css">
{{- $css := "" -}}
{{- range .Site.Params.customCss -}}
{{ $css := resources.Get . | minify | fingerprint }}
{{ $css := resources.Get . | fingerprint }}
<link rel="stylesheet" href="{{ $css.Permalink }}" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous" type="text/css">
{{- end -}}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<!-- Code highlighting -->
{{- if .Site.Params.pygmentsUseClasses }}
{{ $style := resources.Get "css/syntax.css" | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" type="text/css">
{{- end -}}
<!-- Favicons -->
<link rel="shortcut icon" href="{{ .Site.Params.favicon | absURL }}favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon | absURL }}apple-touch-icon.png">
Expand Down

0 comments on commit e298aae

Please sign in to comment.