Просмотр исходного кода

:art: Minimizes Tailwind and the dev banner

Fixes #100
Jeff Triplett 4 лет назад
Родитель
Сommit
c67a1b8324
6 измененных файлов с 109256 добавлено и 107488 удалено
  1. 8 2
      Makefile
  2. 5 1
      _includes/header.html
  3. 108700 0
      assets/development.css
  4. 541 107482
      assets/style.css
  5. 0 1
      postcss.config.js
  6. 2 2
      tailwind.config.js

+ 8 - 2
Makefile

@@ -12,14 +12,20 @@ lint:
 
 .PHONY: static
 static:
+	@JEKYLL_ENV=production \
+		npx -p tailwindcss@${TAILWIND_CSS_VERSION} tailwindcss build \
+			./src/style.css \
+			--config ./tailwind.config.js \
+			--output ./assets/style.css
+
 	@npx -p tailwindcss@${TAILWIND_CSS_VERSION} tailwindcss build \
 		./src/style.css \
 		--config ./tailwind.config.js \
-		--output ./assets/style.css
+		--output ./assets/development.css
 
 .PHONY: serve
 serve:
-	bundle exec jekyll serve --drafts --watch --port 4000
+	@bundle exec jekyll serve --drafts --watch --port 4000
 
 .PHONY: toc
 toc:

+ 5 - 1
_includes/header.html

@@ -5,7 +5,11 @@
     <meta http-equiv="x-ua-compatible" content="ie=edge" />
     <title>Awesome Django</title>
     <meta name="viewport" content="width=device-width, initial-scale=1" />
+{% if jekyll.environment == 'development' %}
+    <link rel="stylesheet" href="{{ site.baseurl }}/assets/development.css" />
+{% else %}
     <link rel="stylesheet" href="{{ site.baseurl }}/assets/style.css" />
+{% endif %}
   </head>
 
-  <body class="debug-screens max-w-screen-lg mx-auto py-8 px-4 sm:px-6 lg:py-8 lg:px-8 border border-2">
+  <body class="max-w-screen-lg mx-auto py-8 px-4 sm:px-6 lg:py-8 lg:px-8 border border-2 {% if jekyll.environment == 'development' %}debug-screens{% endif %}">

Разница между файлами не показана из-за своего большого размера
+ 108700 - 0
assets/development.css


Разница между файлами не показана из-за своего большого размера
+ 541 - 107482
assets/style.css


+ 0 - 1
postcss.config.js

@@ -4,4 +4,3 @@ module.exports = {
     autoprefixer: {},
   },
 }
-

+ 2 - 2
tailwind.config.js

@@ -4,10 +4,10 @@ module.exports = {
     purgeLayersByDefault: true,
   },
   purge: {
-    enabled: false, //process.env.JEKYLL_ENV == "production",
+    enabled: process.env.JEKYLL_ENV == "production",
     mode: 'all',
     content: [
-      '*.html'
+      '**/*.html'
     ],
   },
   plugins: [