mirror of https://github.com/gogs/gogs.git
public: make lessc compile minimize CSS (#5987)
parent
268c692efd
commit
328c23c5d4
internal/assets
public
templates
templates/base
8
Makefile
8
Makefile
|
@ -6,7 +6,7 @@ TEMPLATES_FILES := $(shell find templates | sed 's/ /\\ /g')
|
|||
PUBLIC_FILES := $(shell find public | sed 's/ /\\ /g')
|
||||
LESS_FILES := $(wildcard public/less/*.less)
|
||||
ASSETS_GENERATED := internal/assets/conf/conf_gen.go internal/assets/templates/templates_gen.go internal/assets/public/public_gen.go
|
||||
GENERATED := $(ASSETS_GENERATED) public/css/gogs.css
|
||||
GENERATED := $(ASSETS_GENERATED) public/css/gogs.min.css
|
||||
|
||||
TAGS = ""
|
||||
BUILD_FLAGS = "-v"
|
||||
|
@ -59,10 +59,10 @@ internal/assets/public/public_gen.go: $(PUBLIC_FILES)
|
|||
go generate internal/assets/public/public.go
|
||||
gofmt -s -w $@
|
||||
|
||||
less: public/css/gogs.css
|
||||
less: public/css/gogs.min.css
|
||||
|
||||
public/css/gogs.css: $(LESS_FILES)
|
||||
@type lessc >/dev/null 2>&1 && lessc --source-map "public/less/gogs.less" $@ || echo "lessc command not found or failed"
|
||||
public/css/gogs.min.css: $(LESS_FILES)
|
||||
@type lessc >/dev/null 2>&1 && lessc --clean-css --source-map "public/less/gogs.less" $@ || echo "lessc command not found or failed"
|
||||
|
||||
clean:
|
||||
find . -name "*.DS_Store" -type f -delete
|
||||
|
|
|
@ -41,6 +41,7 @@ Gogs has the following dependencies:
|
|||
```bash
|
||||
brew install go postgresql git go-bindata npm
|
||||
npm install -g less
|
||||
npm install -g less-plugin-clean-css
|
||||
```
|
||||
|
||||
1. Configure PostgreSQL to start automatically:
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3238
public/css/gogs.css
3238
public/css/gogs.css
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@
|
|||
|
||||
<!-- Stylesheet -->
|
||||
<link rel="stylesheet" href="{{AppSubURL}}/css/semantic-2.4.2.min.css">
|
||||
<link rel="stylesheet" href="{{AppSubURL}}/css/gogs.css?v={{BuildCommit}}">
|
||||
<link rel="stylesheet" href="{{AppSubURL}}/css/gogs.min.css?v={{BuildCommit}}">
|
||||
<noscript>
|
||||
<style>
|
||||
.dropdown:hover > .menu { display: block; }
|
||||
|
|
Loading…
Reference in New Issue