Browse Source

feat: select theme variant directly from site config

now users can choose their theme variant directly from the site config file

BREAKING CHANGE: hugo 0.43 and above required. css override file locations have changed

closes #6
Josh Habdas 1 year ago
parent
commit
aa82f5df37
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 21
- 23
README.md View File

@@ -18,15 +18,15 @@ Feature | Summary
18 18
 [Search Optimization](#search-optimization) | Using [Schema Structured Data](https://moz.com/learn/seo/schema-structured-data) and meta tags, After Dark gives crawlers rich data about the site structure and content. No configuration required.
19 19
 [Post Images](#post-images) | Increase visual appeal of posts. After Dark enables configuration-driven post images which are lazy-loaded, responsive and automatically cropped for a consistent look-and-feel across your site.
20 20
 [Fuzzy Search](#fuzzy-search) | After Dark ships with an in-browser search app built with [Vue](https://vuejs.org/), [Fuse](http://fusejs.io/) and [Mark](https://markjs.io). Use it to quickly find crawlable content anywhere your site.
21
-[Personalization](#personalization) | Adjust CSS using purpose-built [customization file](#custom-styles). Choose one of several [theme variants](#theme-variants). Swap in [your own favicon](#favicon). Leverage [block templates](https://gohugo.io/templates/blocks) to quickly extend new custom layouts. And use [hack.css](https://hackcss.egoist.moe/dark.html) flexbox grids and CSS components to add style your site.
22
-[Section Menu](#section-menu) | Add and customize your site's global navigation. After Dark uses Hugo's [Section Menu for "the Lazy Blogger"](https://gohugo.io/extras/menus#section-menu-for-the-lazy-blogger), making navigation easy to create and predictable to use. Don't want navigation? Simply disable it from your site configuration.
21
+[Personalization](#personalization) | Easily choose between one of several [theme variants](#theme-variants). Tweak CSS using the purpose-built [customization file](#custom-styles). Swap in [your own favicon](#favicon). Leverage [block templates](https://gohugo.io/templates/blocks) to quickly extend new custom layouts. And use [hack.css](https://hackcss.egoist.moe/dark.html) flexbox grids and CSS components to add style your site.
23 22
 [Content Reuse](#content-reuse) | Sometimes plan markdown isn't enough to build engaging page content. For this reason After Dark provides a number of reusable code snippets and shortcodes for adding things blockquotes, figure elements, coubs, videos, <a target="feature" href="https://hackcss.egoist.moe/">hackcss components</a> and more to your pages and posts. Use them to create completely custom layouts or simply spice up an old page.
24 23
 [Related Content](#related-content) | Promote more of your content to your site visitors. By offering your readers more content that's relevant to them you can increase your site's page views, the time spent on your site and reader loyalty.
25 24
 [Table of Contents](#table-of-contents) | Help users locate and share information in long posts. By providing a Table of Contents, users will spend less time scrolling to locate information in larger documents and are more likely to deep link to specific information on a page.
25
+[Section Menu](#section-menu) | Add and customize your site's global navigation. After Dark uses Hugo's [Section Menu for "the Lazy Blogger"](https://gohugo.io/extras/menus#section-menu-for-the-lazy-blogger), making navigation easy to create and predictable to use.
26 26
 [Analytics](https://gohugo.io/templates/internal/#google-analytics) | Understand and action on user behavior by enabling Google Analytics. After Dark uses the [async tracking snippet](https://developers.google.com/analytics/devguides/collection/analyticsjs/) to boost performance.
27 27
 [Comments](https://gohugo.io/templates/internal/#disqus) | Improve search rankings and allow users to comment on articles with [Disqus](https://disqus.com/) commenting.
28 28
 [Modification Dating](#modification-dating) | Surface recently updated content to users and crawlers, allowing them to understand when a post or page was was last modified. Recently updated posts will be flagged as modified and visually lifted upwards in chronological listings.
29
-[Syntax Highlighting](#syntax-highlighting) | Share code snippets with style. After Dark provides Atom One [Light](https://atom.io/themes/one-light-syntax) and [Dark](https://atom.io/themes/one-dark-syntax) syntax highlighting for l33t code sharing.
29
+[Syntax Highlighting](#syntax-highlighting) | Share code snippets with style. After Dark provides Atom One [Light](https://atom.io/themes/one-light-syntax) and [Dark](https://atom.io/themes/one-dark-syntax) syntax highlighting for 1337 code sharing.
30 30
 [Taxonomy Pages](https://gohugo.io/content-management/taxonomies) | Help users discover taxonomic content. After Dark automatically generates taxonomy and taxonomy terms pages and links to them in post bylines.
31 31
 [Error Page](https://hackcabin.com/post/after-dark-error-page-redesign/) | Decrease bounce rate when URL errors occur. After Dark provides an engaging 404 page with animated background.
32 32
 Pagination | Pagination can be hard. After Dark makes it easy with simple list pagination with page indicators.
@@ -533,21 +533,31 @@ Reference Hugo's [Syntax Highlighting docs](https://gohugo.io/content-management
533 533
 
534 534
 After Dark uses [hack.css](https://hackcss.egoist.moe/dark.html) to automatically style your markup, giving you instant access to flexbox grids, light and dark theme variants, and other pre-built components. Use them while creating new [sections](#section-menu) leveraging [block templates](https://gohugo.io/templates/blocks). Additional personalization options listed below.
535 535
 
536
+#### Theme Variants
537
+
538
+Choose between one of several theme variants. [`hack.css`](https://hackcss.egoist.moe/) provides two display modes and three color palettes. Mix and match directly from your `config.toml`:
539
+
540
+```
541
+[params.hackcss]
542
+  disabled = false
543
+  mode = "standard"
544
+  palette = "dark-grey"
545
+```
546
+
547
+Once updated take a look at the 404 page, `theme-color.html` partial, and add any [Custom Styles](#custom-styles) you desire.
548
+
536 549
 #### Custom Styles
537 550
 
538 551
 Customize theme styles without forking using Hugo's inbuilt [Partial Templates](https://gohugo.io/templates/partials/). To get started:
539 552
 
540
-1. Create a `critical-custom.css` in your site's `layouts/partials/head` directory. If the directory does not exist yet, simply create it.
553
+1. Create a file named `custom.css` in your site's `assets/css` directory. If the directory does not exist yet, simply create it.
541 554
 2. Add your custom styles inside the file.
542 555
 
543
-Example customization file:
556
+**Note:** After Dark ships with some example customizations. If you would like to keep these copy the styles from the theme's `custom.css` file into your site's `custom.css` after creating it.
557
+
558
+Example customizations:
544 559
 
545 560
 ```css
546
-/* override theme defaults */
547
-.muted {
548
-  color: rgba(255, 255, 255, 0.5);
549
-}
550
-/* custom styles */
551 561
 figure {
552 562
   margin-left: auto;
553 563
   margin-right: auto;
@@ -564,19 +574,7 @@ figure a:hover {
564 574
 }
565 575
 ```
566 576
 
567
-Styles are inlined into the `head` of each page. If you would prefer to use external stylesheets override the `partials/global-styles.html` template, modeling from the theme's version of the file, and make any adjustments you see fit.
568
-
569
-#### Theme Variants
570
-
571
-[`hack.css`](https://hackcss.egoist.moe/) provides a few variants you may wish to use instead of the After Dark defaults. To download them do an `npm install` from `/themes/after-dark/` (assumes NodeJS installed).
572
-
573
-Once downloaded, open `./node_modules/hack/dist`, copy the styles you wish to use into a `critical-vendor.css` [template override](https://gohugo.io/themes/customizing/#override-template-files) and apply the variant by setting `theme_variant` in your site config to one of:
574
-
575
-    "standard"
576
-    "hack dark-grey"
577
-    "hack solarized-dark"
578
-
579
-Once variant applied, open your browser's dev tools and test the changes by previewing your site on mobile, tablet and desktop at different display resolutions and orientations—overriding and making any desired changes to your [overridden](https://gohugo.io/themes/customizing/#override-template-files) `critical-theme.css`, 404 page, `theme-color.html` and [Custom Styles](#custom-styles).
577
+Styles are inlined into the `head` of each page. If you with to link to an external stylesheet, override the `partials/global-styles.html` template, modeling from the theme's version of the file, and make any adjustments you see fit.
580 578
 
581 579
 #### Favicon
582 580
 

+ 22
- 0
assets/css/custom.css View File

@@ -0,0 +1,22 @@
1
+a[href*="://"]::after,
2
+a[rel*="external"] {
3
+  content: " " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23ff9800'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E");
4
+}
5
+figure a[href*="://"]::after,
6
+figure a[rel*="external"] {
7
+  content: "";
8
+}
9
+nav a.active {
10
+  background-color: #ff2e88;
11
+  color: #fff;
12
+}
13
+a[itemprop="url"] {
14
+  color: #ff9800;
15
+}
16
+a[itemprop="url"]:hover {
17
+  color: #fff;
18
+}
19
+.muted,
20
+.hack .help-block {
21
+  color: #e0e0e070;
22
+}

layouts/partials/head/critical-theme.css → assets/css/theme.css View File

@@ -18,10 +18,6 @@
18 18
   -webkit-filter: blur(0);
19 19
   filter: blur(0);
20 20
 }
21
-.muted,
22
-.hack .help-block {
23
-  color: #e0e0e070;
24
-}
25 21
 .hack .readmore {
26 22
   margin-bottom: 2.2em;
27 23
 }
@@ -83,24 +79,6 @@ input.form-control {
83 79
 .hack .help-block {
84 80
   font-size: 1rem;
85 81
 }
86
-nav a.active {
87
-  background-color: #ff2e88;
88
-  color: #fff;
89
-}
90
-a[itemprop="url"] {
91
-  color: #ff9800;
92
-}
93
-a[itemprop="url"]:hover {
94
-  color: #fff;
95
-}
96
-a[href*="://"]::after,
97
-a[rel*="external"] {
98
-  content: " " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23ff9800'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E");
99
-}
100
-figure a[href*="://"]::after,
101
-figure a[rel*="external"] {
102
-  content: "";
103
-}
104 82
 html {
105 83
   font-size: 13px;
106 84
 }

+ 1
- 0
assets/css/vendor/hack/dark-grey.css View File

@@ -0,0 +1 @@
1
+.dark-grey{background-color:#181818;color:#ccc}.dark-grey pre{background-color:#181818;padding:0;border:none}.dark-grey pre code{color:#00bcd4}.dark-grey h1 a,.dark-grey h2 a,.dark-grey h3 a,.dark-grey h4 a,.dark-grey h5 a{color:#ccc}.dark-grey code,.dark-grey strong{color:#fff}.dark-grey code{font-weight:100}.dark-grey table{color:#ccc}.dark-grey table td,.dark-grey table th{border-color:#444}.dark-grey table tbody td:first-child{color:#fff}.dark-grey .form-group label{color:#ccc;border-color:rgba(95,95,95,.78)}.dark-grey .form-group.form-textarea label:after{background-color:#181818}.dark-grey .form-control{color:#ccc;border-color:rgba(95,95,95,.78)}.dark-grey .form-control:focus{border-color:#ccc;color:#ccc}.dark-grey textarea.form-control{color:#ccc}.dark-grey .card{border-color:rgba(95,95,95,.78)}.dark-grey .card .card-header{background-color:transparent;color:#ccc;border-bottom:1px solid rgba(95,95,95,.78)}.dark-grey .btn.btn-ghost.btn-default{border-color:#ababab;color:#ababab}.dark-grey .btn.btn-ghost.btn-default:focus,.dark-grey .btn.btn-ghost.btn-default:hover{border-color:#9c9c9c;color:#9c9c9c;z-index:1}.dark-grey .btn.btn-ghost.btn-default:focus,.dark-grey .btn.btn-ghost.btn-default:hover{border-color:#e0e0e0;color:#e0e0e0}.dark-grey .btn.btn-ghost.btn-primary:focus,.dark-grey .btn.btn-ghost.btn-primary:hover{border-color:#64b5f6;color:#64b5f6}.dark-grey .btn.btn-ghost.btn-success:focus,.dark-grey .btn.btn-ghost.btn-success:hover{border-color:#81c784;color:#81c784}.dark-grey .btn.btn-ghost.btn-info:focus,.dark-grey .btn.btn-ghost.btn-info:hover{border-color:#4dd0e1;color:#4dd0e1}.dark-grey .btn.btn-ghost.btn-error:focus,.dark-grey .btn.btn-ghost.btn-error:hover{border-color:#e57373;color:#e57373}.dark-grey .btn.btn-ghost.btn-warning:focus,.dark-grey .btn.btn-ghost.btn-warning:hover{border-color:#ffb74d;color:#ffb74d}.dark-grey .avatarholder,.dark-grey .placeholder{background-color:transparent;border-color:#333}.dark-grey .menu .menu-item{color:#ccc;border-color:rgba(95,95,95,.78)}.dark-grey .menu .menu-item.active,.dark-grey .menu .menu-item:hover{color:#fff;border-color:#ccc}

+ 1
- 0
assets/css/vendor/hack/dark.css View File

@@ -0,0 +1 @@
1
+.dark{color:#ccc}.dark,.dark pre{background-color:#000}.dark pre{padding:0;border:none}.dark pre code{color:#00bcd4}.dark h1 a,.dark h2 a,.dark h3 a,.dark h4 a,.dark h5 a{color:#ccc}.dark code,.dark strong{color:#fff}.dark code{font-weight:100}.dark table{color:#ccc}.dark table td,.dark table th{border-color:#444}.dark table tbody td:first-child{color:#fff}.dark .form-group label{color:#ccc;border-color:rgba(95,95,95,.78)}.dark .form-group.form-textarea label:after{background-color:#000}.dark .form-control{color:#ccc;border-color:rgba(95,95,95,.78)}.dark .form-control:focus{border-color:#ccc;color:#ccc}.dark textarea.form-control{color:#ccc}.dark .card{border-color:rgba(95,95,95,.78)}.dark .card .card-header{background-color:transparent;color:#ccc;border-bottom:1px solid rgba(95,95,95,.78)}.dark .btn.btn-ghost.btn-default{border-color:#ababab;color:#ababab}.dark .btn.btn-ghost.btn-default:focus,.dark .btn.btn-ghost.btn-default:hover{border-color:#9c9c9c;color:#9c9c9c;z-index:1}.dark .btn.btn-ghost.btn-default:focus,.dark .btn.btn-ghost.btn-default:hover{border-color:#e0e0e0;color:#e0e0e0}.dark .btn.btn-ghost.btn-primary:focus,.dark .btn.btn-ghost.btn-primary:hover{border-color:#64b5f6;color:#64b5f6}.dark .btn.btn-ghost.btn-success:focus,.dark .btn.btn-ghost.btn-success:hover{border-color:#81c784;color:#81c784}.dark .btn.btn-ghost.btn-info:focus,.dark .btn.btn-ghost.btn-info:hover{border-color:#4dd0e1;color:#4dd0e1}.dark .btn.btn-ghost.btn-error:focus,.dark .btn.btn-ghost.btn-error:hover{border-color:#e57373;color:#e57373}.dark .btn.btn-ghost.btn-warning:focus,.dark .btn.btn-ghost.btn-warning:hover{border-color:#ffb74d;color:#ffb74d}.dark .avatarholder,.dark .placeholder{background-color:transparent;border-color:#333}.dark .menu .menu-item{color:#ccc;border-color:rgba(95,95,95,.78)}.dark .menu .menu-item.active,.dark .menu .menu-item:hover{color:#fff;border-color:#ccc}

+ 1
- 0
assets/css/vendor/hack/hack.css
File diff suppressed because it is too large
View File


+ 1
- 0
assets/css/vendor/hack/solarized-dark.css View File

@@ -0,0 +1 @@
1
+.solarized-dark{background-color:#073642;color:#78909c}.solarized-dark h1,.solarized-dark h2,.solarized-dark h3,.solarized-dark h4,.solarized-dark h5,.solarized-dark h6{color:#1e88e5}.solarized-dark h1 a,.solarized-dark h2 a,.solarized-dark h3 a,.solarized-dark h4 a,.solarized-dark h5 a,.solarized-dark h6 a{color:#1e88e5;border-bottom-color:#1e88e5}.solarized-dark h1 a:hover,.solarized-dark h2 a:hover,.solarized-dark h3 a:hover,.solarized-dark h4 a:hover,.solarized-dark h5 a:hover,.solarized-dark h6 a:hover{background-color:#1e88e5;color:#fff}.solarized-dark pre{background-color:#073642;padding:0;border:none}.solarized-dark pre code{color:#009688}.solarized-dark h1 a,.solarized-dark h2 a,.solarized-dark h3 a,.solarized-dark h4 a,.solarized-dark h5 a{color:#78909c}.solarized-dark code,.solarized-dark strong{color:#90a4ae}.solarized-dark code{font-weight:100}.solarized-dark .progress-bar-filled{background-color:#558b2f}.solarized-dark .progress-bar-filled:after,.solarized-dark .progress-bar-filled:before{color:#90a4ae}.solarized-dark table{color:#78909c}.solarized-dark table td,.solarized-dark table th{border-color:#b0bec5}.solarized-dark table tbody td:first-child{color:#b0bec5}.solarized-dark .form-group label{color:#78909c;border-color:#90a4ae}.solarized-dark .form-group.form-textarea label:after{background-color:#073642}.solarized-dark .form-control{color:#78909c;border-color:#90a4ae}.solarized-dark .form-control:focus{border-color:#cfd8dc;color:#cfd8dc}.solarized-dark textarea.form-control{color:#78909c}.solarized-dark .card{border-color:#90a4ae}.solarized-dark .card .card-header{background-color:transparent;color:#78909c;border-bottom:1px solid #90a4ae}.solarized-dark .btn.btn-ghost.btn-default{border-color:#607d8b;color:#607d8b}.solarized-dark .btn.btn-ghost.btn-default:focus,.solarized-dark .btn.btn-ghost.btn-default:hover{border-color:#90a4ae;color:#90a4ae;z-index:1}.solarized-dark .btn.btn-ghost.btn-default:focus,.solarized-dark .btn.btn-ghost.btn-default:hover{border-color:#e0e0e0;color:#e0e0e0}.solarized-dark .btn.btn-ghost.btn-primary:focus,.solarized-dark .btn.btn-ghost.btn-primary:hover{border-color:#64b5f6;color:#64b5f6}.solarized-dark .btn.btn-ghost.btn-success:focus,.solarized-dark .btn.btn-ghost.btn-success:hover{border-color:#81c784;color:#81c784}.solarized-dark .btn.btn-ghost.btn-info:focus,.solarized-dark .btn.btn-ghost.btn-info:hover{border-color:#4dd0e1;color:#4dd0e1}.solarized-dark .btn.btn-ghost.btn-error:focus,.solarized-dark .btn.btn-ghost.btn-error:hover{border-color:#e57373;color:#e57373}.solarized-dark .btn.btn-ghost.btn-warning:focus,.solarized-dark .btn.btn-ghost.btn-warning:hover{border-color:#ffb74d;color:#ffb74d}.solarized-dark .avatarholder,.solarized-dark .placeholder{background-color:transparent;border-color:#90a4ae}.solarized-dark .menu .menu-item{color:#78909c;border-color:#90a4ae}.solarized-dark .menu .menu-item.active,.solarized-dark .menu .menu-item:hover{color:#fff;border-color:#78909c}

+ 1
- 0
assets/css/vendor/hack/standard.css View File

@@ -0,0 +1 @@
1
+html{font-size:14px}.standard{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,Ubuntu,segoe ui,arial,sans-serif}.standard h1{font-size:2em;font-weight:700;margin:.67em 0}.standard h2{font-size:1.5em;font-weight:700;margin:.83em 0}.standard h3{font-size:1.17em;font-weight:700}.standard h3,.standard p{margin:1.75rem 0}.standard ol,.standard ul{display:block;list-style-type:disc;padding-left:20px;margin:1.75rem 0}.standard ol ul,.standard ul ul{margin:.75rem 0;list-style-type:square}.standard ol{list-style-type:decimal}.standard li{display:list-item;padding-left:0}.standard blockquote{margin:1.75rem 0;padding-left:10px;border-left:5px solid #f0f0f0}.standard pre{margin:1.75rem 0;white-space:pre}.standard hr{border:0;height:1px;display:block;background-color:#e2e2e2;margin:1.75rem 0}

+ 5
- 1
bin/install.sh View File

@@ -63,7 +63,11 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
63 63
   images = [
64 64
     "https://source.unsplash.com/collection/983219/2000x1322"
65 65
   ] # Suggested, controls default Open Graph images
66
-  theme_variant = "" # Optional, for use to overriding default theme
66
+
67
+[params.hackcss]
68
+  disabled = false # Optional, set `true` to disable hackcss
69
+  mode = "hack" # Optional, choose from `standard` or `hack` display modes
70
+  palette = "dark" # Optional, choose `dark`, `dark-grey` or `solarized-dark`
67 71
 TOML
68 72
 
69 73
 echo "Creating an example post to get you started ..."

+ 4
- 2
layouts/_default/baseof.html View File

@@ -38,8 +38,10 @@
38 38
     {{ partial "global-styles.html" . }}
39 39
     {{ partial "async-scripts.html" . }}
40 40
   </head>
41
-  {{ $theme_variant := .Site.Params.theme_variant | default "hack dark" }}
42
-  <body class="{{ $theme_variant }} main container">
41
+  {{ $hackcss_disabled := .Site.Params.hackcss.disabled | default false }}
42
+  {{ $hackcss_mode := .Site.Params.hackcss.mode | default "hack" }}
43
+  {{ $hackcss_palette := .Site.Params.hackcss.palette | default "dark" }}
44
+  <body class="{{ if ne $hackcss_disabled true }}{{ $hackcss_mode }} {{ $hackcss_palette }} main container{{ end }}">
43 45
     <header>{{ block "header" . }}{{ end }}</header>
44 46
     <main>{{ block "main" . }}{{ end }}</main>
45 47
     <footer>{{ block "footer" . }}{{ end }}</footer>

+ 31
- 5
layouts/partials/global-styles.html View File

@@ -1,5 +1,31 @@
1
-<style>
2
-  {{ partial "head/critical-vendor.css" | safeCSS }}
3
-  {{ partial "head/critical-theme.css" | safeCSS }}
4
-  {{ partial "head/critical-custom.css" | safeCSS }}
5
-</style>
1
+{{ $custom := resources.Get "css/custom.css" }}
2
+
3
+{{ if eq .Site.Params.hackcss.disabled true }}
4
+  <style>{{ (slice $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
5
+{{ else }}
6
+  {{ $hack := resources.Get "css/vendor/hack/hack.css" }}
7
+  {{ $standard := resources.Get "css/vendor/hack/standard.css" }}
8
+  {{ $dark := resources.Get "css/vendor/hack/dark.css" }}
9
+  {{ $darkgrey := resources.Get "css/vendor/hack/dark-grey.css" }}
10
+  {{ $solarizeddark := resources.Get "css/vendor/hack/solarized-dark.css" }}
11
+  {{ $theme := resources.Get "css/theme.css" | minify }}
12
+  {{ if eq .Site.Params.hackcss.palette "dark-grey" }}
13
+    {{ if eq .Site.Params.hackcss.mode "standard" }}
14
+      <style>{{ (slice $hack $standard $darkgrey $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
15
+    {{ else }}
16
+      <style>{{ (slice $hack $darkgrey $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
17
+    {{ end }}
18
+  {{ else if eq .Site.Params.hackcss.palette "solarized-dark" }}
19
+    {{ if eq .Site.Params.hackcss.mode "standard" }}
20
+      <style>{{ (slice $hack $standard $solarizeddark $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
21
+    {{ else }}
22
+      <style>{{ (slice $hack $solarizeddark $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
23
+    {{ end }}
24
+  {{ else }}
25
+    {{ if eq .Site.Params.hackcss.mode "standard" }}
26
+      <style>{{ (slice $hack $standard $dark $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
27
+    {{ else }}
28
+      <style>{{ (slice $hack $dark $theme $custom | resources.Concat "styles.css").Content | safeCSS }}</style>
29
+    {{ end }}
30
+  {{ end }}
31
+{{ end }}

+ 0
- 1
layouts/partials/head/critical-custom.css View File

@@ -1 +0,0 @@
1
-

+ 0
- 1
layouts/partials/head/critical-vendor.css
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

@@ -20,7 +20,7 @@
20 20
     "update:fuse": "npm up fuse.js && cp -i node_modules/fuse.js/dist/fuse.min.js static/js",
21 21
     "update:vue": "npm up vue && cp -i node_modules/vue/dist/vue.min.js static/js",
22 22
     "update:mark": "npm up mark.js && cp -i node_modules/mark.js/dist/mark.min.js static/js",
23
-    "update:hackcss": "npm up hackcss && cat node_modules/hack/dist/hack.css > static/css/critical-vendor.css && cat node_modules/hack/dist/dark.css >> static/css/critical-vendor.css",
23
+    "update:hackcss": "npm up hackcss && cp -ir node_modules/hack/dist/ assets/css/vendor/hack/",
24 24
     "test": "while true; do head -n 100 /dev/urandom; sleep 0.1; done | hexdump -C | grep 'ca fe'",
25 25
     "release": "standard-version"
26 26
   },

Loading…
Cancel
Save