diff options
author | WANG Chucheng <me@wangchucheng.com> | 2022-03-31 20:06:08 +0300 |
---|---|---|
committer | WANG Chucheng <me@wangchucheng.com> | 2022-03-31 20:06:08 +0300 |
commit | 04c91ff7eb3aed8b98715aa2435ba104182d1b2d (patch) | |
tree | 990c7e783b381174335516d3d173a7977bafb2c9 | |
parent | 54009e0f91ea38f8d566636fc7b7488dd762a1e9 (diff) |
fix: fail to get default style
Closes #176
-rw-r--r-- | assets/css/eureka.css | 12 | ||||
-rw-r--r-- | assets/css/highlightjs.css | 6 | ||||
-rw-r--r-- | assets/css/postcss.config.js | 27 | ||||
-rw-r--r-- | exampleSite/config/_default/params.yaml | 6 | ||||
-rw-r--r-- | layouts/_default/single.html | 4 | ||||
-rw-r--r-- | layouts/partials/components/doc-layout.html | 4 | ||||
-rw-r--r-- | layouts/partials/head.html | 6 | ||||
-rw-r--r-- | package-lock.json | 41 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.content (renamed from resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.content) | 0 | ||||
-rw-r--r-- | resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.json (renamed from resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.json) | 0 |
11 files changed, 41 insertions, 66 deletions
diff --git a/assets/css/eureka.css b/assets/css/eureka.css index 832f013..81971e3 100644 --- a/assets/css/eureka.css +++ b/assets/css/eureka.css @@ -1,10 +1,10 @@ /* Tailwind base - put variables under: tailwind.config.js */ -@import "node_modules/tailwindcss/base"; -@import "assets/css/base"; +@tailwind base; +@import "base.css"; /* Tailwind component classes registered by plugins*/ -@import "node_modules/tailwindcss/components"; +@tailwind components; /* Site Specific */ -@import "assets/css/prose"; -@import "assets/css/site"; +@import "prose.css"; +@import "site.css"; /* Tailwind's utility classes - generated based on config file */ -@import "node_modules/tailwindcss/utilities"; +@tailwind utilities; diff --git a/assets/css/highlightjs.css b/assets/css/highlightjs.css new file mode 100644 index 0000000..64c0171 --- /dev/null +++ b/assets/css/highlightjs.css @@ -0,0 +1,6 @@ +/* highlight.js */ +.hljs { + background-color: transparent !important; + color: var(--color-tertiary-text) !important; + padding: 0 !important; +} diff --git a/assets/css/postcss.config.js b/assets/css/postcss.config.js index 9bbd93a..7f1e8d5 100644 --- a/assets/css/postcss.config.js +++ b/assets/css/postcss.config.js @@ -1,16 +1,13 @@ -const themeDir = __dirname + '/../../'; +const themeDir = __dirname + "/../../"; -module.exports = { - plugins: [ - require('postcss-import')({ - path: [themeDir] - }), - require('tailwindcss')(themeDir + 'assets/css/tailwind.config.js'), - require('autoprefixer')({ - path: [themeDir] - }), - require('cssnano')({ - preset: 'default', - }), - ] -} +module.exports = { + plugins: [ + require("tailwindcss")(themeDir + "assets/css/tailwind.config.js"), + require("autoprefixer")({ + path: [themeDir], + }), + require("cssnano")({ + preset: "default", + }), + ], +}; diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index b3a9c70..d278263 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -25,11 +25,11 @@ highlight: highlightjs: # highlight.js doesn't bundle every language. So please specify additional languages you want here. - # See https://github.com/highlightjs/cdn-release/tree/master/build/languages for available languages. + # See https://github.com/highlightjs/cdn-release/tree/main/build/languages for available languages. languages: - dart - # See https://github.com/highlightjs/cdn-release/tree/master/build/styles for available styles. - style: solarized-light + # See https://github.com/highlightjs/cdn-release/tree/main/build/styles for available styles. + style: base16/solarized-light math: handler: katex diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e8a075d..d79d528 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -49,11 +49,11 @@ {{ end }} </div> - {{/* highlight */}} + {{/* highlight.js */}} {{- if eq .Site.Params.highlight.handler "highlightjs" }} <script> document.addEventListener("DOMContentLoaded", () => { - hljs.initHighlightingOnLoad(); + hljs.highlightAll(); }); </script> {{- end }} diff --git a/layouts/partials/components/doc-layout.html b/layouts/partials/components/doc-layout.html index cf434b3..3740e91 100644 --- a/layouts/partials/components/doc-layout.html +++ b/layouts/partials/components/doc-layout.html @@ -42,9 +42,9 @@ <script> document.addEventListener('DOMContentLoaded', () => { - {{/* highlight */}} + {{/* highlight.js */}} {{- if eq .Site.Params.highlight.handler "highlightjs" }} - hljs.initHighlightingOnLoad(); + hljs.highlightAll(); {{- end }} changeSidebarHeight(); switchDocToc(); diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f124cd1..34edd0f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -54,7 +54,7 @@ <meta name="generator" content="Hugo Eureka {{ .Site.Data.eureka.version }}" /> -{{- $eurekaCSS := resources.Get "css/eureka.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | resources.ExecuteAsTemplate "css/eureka.css" . | minify | fingerprint "sha384" }} +{{- $eurekaCSS := resources.Get "css/eureka.css" | postCSS (dict "config" "./assets/css/postcss.config.js" "inlineImports" true) | resources.ExecuteAsTemplate "css/eureka.css" . | minify | fingerprint "sha384" }} <link rel="stylesheet" href="{{ $eurekaCSS.Permalink }}" integrity="{{ $eurekaCSS.Data.Integrity }}"> {{- $eurekaJS := resources.Get "js/eureka.js" | resources.ExecuteAsTemplate "js/eureka.js" . | minify | fingerprint "sha384" }} @@ -82,7 +82,7 @@ {{- $highlightCSS := resources.Get "css/syntax.css" | minify | fingerprint "sha384" }} <link rel="stylesheet" href="{{ $highlightCSS.Permalink }}" integrity="{{ $highlightCSS.Data.Integrity }}" media="print" onload="this.media='all';this.onload=null"> {{- else if eq .Site.Params.highlight.handler "highlightjs" }} -{{- $highlightjsStyle := .Site.Params.highlight.highlightjs.style | default "solarized-light" }} +{{- $highlightjsStyle := .Site.Params.highlight.highlightjs.style | default "base16/solarized-light" }} <link rel="stylesheet" href="{{ printf $assets.highlightjs.css.url $assets.highlightjs.version $highlightjsStyle }}" {{ with $assets.highlightjs.css.sri }} integrity="{{ . }}" {{ end }} media="print" onload="this.media='all';this.onload=null" crossorigin> @@ -92,6 +92,8 @@ <script defer src="{{ printf $assets.highlightjs.languages.url $assets.highlightjs.version . }}" {{ with $assets.highlightjs.languages.sri }} integrity="{{ . }}" {{ end }} crossorigin></script> {{- end }} +{{- $highlightjsCSS := resources.Get "css/highlightjs.css" | minify | fingerprint "sha384" }} +<link rel="stylesheet" href="{{ $highlightjsCSS.Permalink }}" integrity="{{ $highlightjsCSS.Data.Integrity }}"> {{- end }} {{ $fontawesomeJS := resources.Get "js/fontawesome.js" | resources.ExecuteAsTemplate "js/fontawesome.js" . | js.Build (dict "minify" true) | minify | fingerprint "sha384" }} diff --git a/package-lock.json b/package-lock.json index aa1f3a0..f6ef2fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "cssnano": "^5.1.1", "postcss": "^8.4.8", "postcss-cli": "^9.1.0", - "postcss-import": "^14.0.2", "prettier": "^2.5.1", "prettier-plugin-go-template": "^0.0.11", "prettier-plugin-tailwindcss": "^0.1.8", @@ -1249,9 +1248,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/nanoid": { @@ -1554,23 +1553,6 @@ "postcss": "^8.2.15" } }, - "node_modules/postcss-import": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.0.2.tgz", - "integrity": "sha512-BJ2pVK4KhUyMcqjuKs9RijV5tatNzNa73e/32aBVE/ejYPe37iH+6vAu9WvqUkB5OAYgLHzbSvzHnorybJCm9g==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.0.0", - "read-cache": "^1.0.0", - "resolve": "^1.1.7" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, "node_modules/postcss-js": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.0.tgz", @@ -3401,9 +3383,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "nanoid": { @@ -3607,17 +3589,6 @@ "dev": true, "requires": {} }, - "postcss-import": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.0.2.tgz", - "integrity": "sha512-BJ2pVK4KhUyMcqjuKs9RijV5tatNzNa73e/32aBVE/ejYPe37iH+6vAu9WvqUkB5OAYgLHzbSvzHnorybJCm9g==", - "dev": true, - "requires": { - "postcss-value-parser": "^4.0.0", - "read-cache": "^1.0.0", - "resolve": "^1.1.7" - } - }, "postcss-js": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.0.tgz", diff --git a/package.json b/package.json index 2d042f5..8d7a18d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "cssnano": "^5.1.1", "postcss": "^8.4.8", "postcss-cli": "^9.1.0", - "postcss-import": "^14.0.2", "prettier": "^2.5.1", "prettier-plugin-go-template": "^0.0.11", "prettier-plugin-tailwindcss": "^0.1.8", diff --git a/resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.content b/resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.content index b7993c8..b7993c8 100644 --- a/resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.content +++ b/resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.content diff --git a/resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.json b/resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.json index fbab02c..fbab02c 100644 --- a/resources/_gen/assets/css/css/eureka.css_2aa07a550f0c94a163a7b6b66fbc3f0e.json +++ b/resources/_gen/assets/css/css/eureka.css_99793e29f614609ef5e75d384789a0c9.json |