Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Fixed missing assets/*/add-on.*
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentTam committed Aug 27, 2019
1 parent e94a830 commit 5741563
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 29 deletions.
6 changes: 6 additions & 0 deletions exampleSite/assets/css/add-on.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
This css file is for individual users to restyle items for their personal site,
or for the implementation of features specifically for their site. Anything that
is an official part of the theme (ex. Pull Requests) should be included in main.css
and follow the formatting and style given.
*/
6 changes: 6 additions & 0 deletions exampleSite/assets/js/add-on.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
This js file is for individual users to modify the scripts for their personal site,
or for the implementation of features specifically for their site. Anything that
is an official part of the theme (ex. Pull Requests) should be included in main.js
and follow the formatting and style given.
*/
4 changes: 2 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ disableLanguages = [""]
# multiple/additional files if necessary. The standard theme files can be loaded
# by adding the value, "default". Default includes the add-on.css and and-on.js.
# Example: ["default", "/path/to/file"]
cssFiles = ["default"]
jsFiles = ["default"]
cssFiles = ["default", "css/add-on.css"]
jsFiles = ["default", "js/add-on.js"]
# Sets options for highlight.js
highlightjs = true
highlightjsTheme = "github"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"css/bundle.min.8f42b973ebb3d7f01e0ccb9dec3c3cd80760fff2c2ee076b3cc49281740b3c93.css","MediaType":"text/css","Data":{"Integrity":"sha256-j0K5c+uz1/AeDMud7Dw82Adg//LC7gdrPMSSgXQLPJM="}}
{"Target":"css/bundle.min.e2d176cc3f22d9fbed3b7f2a72f1ed95a165599d5eae101f4caab2c3f89f1318.css","MediaType":"text/css","Data":{"Integrity":"sha256-4tF2zD8i2fvtO38qcvHtlaFlWZ1erhAfTKqyw/ifExg="}}
30 changes: 13 additions & 17 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,30 @@
{{ if .Site.Params.highlightjs }}<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/{{ .Site.Params.highlightjsTheme | default "default" }}.min.css">{{ end }}
{{ range .Site.Params.cssFiles }}
{{ if eq . "default" }}
<link rel="stylesheet" href="{{ "css/normalize.css" | relURL }}">
{{ $normalizeCSS = resources.Get "css/normalize.css" }}
<link rel="stylesheet" href="{{ $normalizeCSS.RelPermalink }}">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Raleway:400,800,900|Source+Sans+Pro:400,700">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.10.1/css/all.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" />
{{ $mainCSSOptions := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }}
{{ $main := resources.Get "scss/main.scss" | resources.ToCSS $mainCSSOptions | resources.Fingerprint }}
{{ $main := resources.Get "scss/main.scss" | toCSS $mainCSSOptions | fingerprint }}
<link rel="stylesheet" href="{{ $main.RelPermalink }}" integrity="{{ $main.Data.Integrity }}">
{{ else }}
<link rel="stylesheet" href="{{ . | relURL }}">
<link rel="stylesheet" href="{{ (resources.Get .).RelPermalink }}">
{{ end }}
{{ end }}
{{ else }}
{{ range .Site.Params.cssFiles }}
{{ if eq . "default" }}
{{ $cssSlice := resources.Match "css/*.css" }}
{{ $cssSlice = $cssSlice | append (resources.Get "scss/main.scss" | resources.ToCSS) }}
{{ if $.Site.Params.highlightjs }}
{{ $hlTh := $.Site.Params.highlightjsTheme | default "default" }}
{{ $hlThCSS := printf "css/styles/%s.css" $hlTh }}
{{ $cssSlice = $cssSlice | append (resources.Get $hlThCSS) }}
{{ end }}
{{ $css := $cssSlice | resources.Concat "css/bundle.css" | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{ else }}
<link rel="stylesheet" href="{{ . | relURL }}">
{{ end }}
{{ $cssSlice := slice }}
{{ if .Site.Params.highlightjs }}
{{ $hlTh := $.Site.Params.highlightjsTheme | default "default" }}
{{ $hlThCSS := printf "css/styles/%s.css" $hlTh }}
{{ $cssSlice = $cssSlice | append (resources.Get $hlThCSS) }}
{{ end }}
{{ $cssSlice = $cssSlice | append (resources.Match "css/*.css") }}
{{ $cssSlice = $cssSlice | append (resources.Get "scss/main.scss" | toCSS) }}
{{ $css := $cssSlice | resources.Concat "css/bundle.css" | minify | fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{ end }}
{{ .Scratch.Set "Permalink" .Permalink }}
{{ .Scratch.Set "Title" .Title }}
Expand Down
14 changes: 7 additions & 7 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
{{ end }}
{{ range .Site.Params.jsFiles }}
{{ if eq . "default" }}
<script src="//code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.js"></script>
<script src="//code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.js"></script>
{{ $util := resources.Get "js/util.js" }}
{{ $main := resources.Get "js/main.js" }}
{{ $jsSlice := slice $util $main }}
{{ if $.Site.Params.staticman.enabled }}
{{ $jsSlice = $jsSlice | append (resources.Get "js/staticman.js" | resources.ExecuteAsTemplate "js/staticman.js" $.Site.Params.staticman) }}
{{ end }}
{{ $js := $jsSlice | resources.Concat "js/localbundle.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}">
{{ $js := $jsSlice | resources.Concat "js/localbundle.js" | minify | fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{ else }}
<script src="{{ . | relURL }}"></script>
<script src="{{ (resources.Get .).RelPermalink }}"></script>
{{ end }}
{{ end }}
{{ else }}
Expand All @@ -37,10 +37,10 @@
{{ $jsSlice = $jsSlice | append (resources.Get "js/staticman.js" | resources.ExecuteAsTemplate "js/staticman.js" $.Site.Params.staticman) }}
}
{{ end }}
{{ $js := $jsSlice | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint }}
{{ $js := $jsSlice | resources.Concat "js/bundle.js" | minify | fingerprint }}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
{{ else }}
<script src="{{ . | relURL }}"></script>
<script src="{{ (resources.Get .).RelPermalink }}"></script>
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit 5741563

Please sign in to comment.