Procházet zdrojové kódy

Add Makefile to build CSS

Luiz de Prá před 7 roky
rodič
revize
454ea0146d
3 změnil soubory, kde provedl 26 přidání a 1 odebrání
  1. 3 0
      .editorconfig
  2. 16 0
      Makefile
  3. 7 1
      README.md

+ 3 - 0
.editorconfig

@@ -24,3 +24,6 @@ indent_size = 2
 # web files
 # web files
 [*.{html,css,less}]
 [*.{html,css,less}]
 indent_size = 2
 indent_size = 2
+
+[Makefile]
+indent_style = tab

+ 16 - 0
Makefile

@@ -0,0 +1,16 @@
+LESS_DIR = ./static/less
+LESS_FILE = style.less
+CSS_DIR = ./static/css
+CSS_FILE = style.min.css
+CSS_TMP_FILE = tmp.css
+
+
+.PHONY: clean build
+
+build: clean
+	lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE)
+	uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(CSS_FILE)
+	rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
+
+clean:
+	rm -f $(CSS_DIR)/*.css

+ 7 - 1
README.md

@@ -58,6 +58,12 @@ You can look at full working [`config.toml`](https://github.com/luizdepra/hugo-c
 
 
 ### Build & Test
 ### Build & Test
 
 
+To update or generate the minified CSS file:
+
+```
+make build
+```
+
 To build your site and test, run:
 To build your site and test, run:
 
 
 ```
 ```
@@ -80,4 +86,4 @@ Coder is licensed under the [MIT license](https://github.com/luizdepra/hugo-code
 ## Special Thanks
 ## Special Thanks
 
 
 - Gleen McComb, for his great [article](https://glennmccomb.com/articles/how-to-build-custom-hugo-pagination/) about custom pagination.
 - Gleen McComb, for his great [article](https://glennmccomb.com/articles/how-to-build-custom-hugo-pagination/) about custom pagination.
-- All contributors, for every PR and Issue reported.\
+- All contributors, for every PR and Issue reported.