init
This commit is contained in:
		
							
								
								
									
										36
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
CONTENTDIR	= content
 | 
			
		||||
STATICDIR	= static
 | 
			
		||||
BUILDDIR	= build
 | 
			
		||||
 | 
			
		||||
all: html
 | 
			
		||||
 | 
			
		||||
help:
 | 
			
		||||
	@echo 'Build site'
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo 'Available targets:'
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo '	html 		render HTML'
 | 
			
		||||
	@echo '	serve		serve site'
 | 
			
		||||
	@echo '	css <theme>	generate Pygments stylesheet'
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo 'Run without target to build html'
 | 
			
		||||
 | 
			
		||||
html:
 | 
			
		||||
	test -d $(BUILDDIR) && rm -rf $(BUILDDIR) || true
 | 
			
		||||
	python rstw
 | 
			
		||||
 | 
			
		||||
serve:
 | 
			
		||||
	if hash http-server; \
 | 
			
		||||
	then \
 | 
			
		||||
		http-server $(BUILDDIR)/; \
 | 
			
		||||
	else \
 | 
			
		||||
		python3 -m http.server --directory $(BUILDDIR)/; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
css:
 | 
			
		||||
	mkdir -pv $(STATICDIR)/css/pygments
 | 
			
		||||
	pygmentize -f html -S $(filter-out $@,$(MAKECMDGOALS)) -a .highlight \
 | 
			
		||||
		> $(STATICDIR)/css/pygments/$(filter-out $@,$(MAKECMDGOALS)).css
 | 
			
		||||
 | 
			
		||||
%:
 | 
			
		||||
	@:
 | 
			
		||||
		Reference in New Issue
	
	Block a user