forked from cwtv/chaoswest.tv
				
			Add makefile and pretify plugin
This commit is contained in:
		
							parent
							
								
									836c2f9528
								
							
						
					
					
						commit
						b960644606
					
				| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
LEKTOR_SERVER_FLAGS=-h 127.0.0.1
 | 
			
		||||
# minify javascript assets, compile scss assets
 | 
			
		||||
LEKTOR_PLUGIN_FLAGS=-f scss -f pretifyhtml
 | 
			
		||||
LEKTOR_DEPLOY_FLAGS=
 | 
			
		||||
 | 
			
		||||
all: build
 | 
			
		||||
 | 
			
		||||
.ONESHELL:
 | 
			
		||||
install:
 | 
			
		||||
	if hash apt-get 2>/dev/null; then
 | 
			
		||||
	  apt-get update -qq >/dev/null && apt-get install -qq apt-utils imagemagick python3-pip python3-setuptools gcc git-lfs
 | 
			
		||||
	elif hash pacman 2>/dev/null; then
 | 
			
		||||
	  pacman -Syu imagemagick python-pip glibc lib32-glibc gcc git-lfs --noconfirm
 | 
			
		||||
	elif hash dnf 2>/dev/null; then
 | 
			
		||||
	  dnf install -y ImageMagick python3-pip gcc git-lfs
 | 
			
		||||
	else
 | 
			
		||||
	  echo -e "Please install Imagemagick, python3-pip git-lfs and gcc"
 | 
			
		||||
	fi
 | 
			
		||||
	pip3 install wheel  --upgrade --user
 | 
			
		||||
	pip3 install lektor --upgrade --user
 | 
			
		||||
 | 
			
		||||
build:
 | 
			
		||||
	if python3 -m lektor --version 2>/dev/null; then
 | 
			
		||||
	  python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS)
 | 
			
		||||
	else
 | 
			
		||||
	  lektor build $(LEKTOR_PLUGIN_FLAGS)
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
server:
 | 
			
		||||
	if python3 -m lektor --version 2>/dev/null; then
 | 
			
		||||
	  python3 -m lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
 | 
			
		||||
	else
 | 
			
		||||
	  lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
deploy:
 | 
			
		||||
	lektor clean --yes
 | 
			
		||||
	lektor plugin flush-cache
 | 
			
		||||
	lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
 | 
			
		||||
	lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
 | 
			
		||||
| 
						 | 
				
			
			@ -18,3 +18,4 @@ url_prefix = /en/
 | 
			
		|||
 | 
			
		||||
[packages]
 | 
			
		||||
lektor-scss = 1.4.1
 | 
			
		||||
lektor-html-pretify = 1.0.5
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue