Sources of the site gergely.polonkai.eu, Jekyll version
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.6 KiB

  1. PY?=python3
  2. PELICAN?=pelican
  3. PELICANOPTS=
  4. BASEDIR=$(CURDIR)
  5. INPUTDIR=$(BASEDIR)/content
  6. OUTPUTDIR=$(BASEDIR)/output
  7. CONFFILE=$(BASEDIR)/pelicanconf.py
  8. PUBLISHCONF=$(BASEDIR)/publishconf.py
  9. DEBUG ?= 0
  10. ifeq ($(DEBUG), 1)
  11. PELICANOPTS += -D
  12. endif
  13. RELATIVE ?= 0
  14. ifeq ($(RELATIVE), 1)
  15. PELICANOPTS += --relative-urls
  16. endif
  17. help:
  18. @echo 'Makefile for a pelican Web site '
  19. @echo ' '
  20. @echo 'Usage: '
  21. @echo ' make html (re)generate the web site '
  22. @echo ' make clean remove the generated files '
  23. @echo ' make regenerate regenerate files upon modification '
  24. @echo ' make publish generate using production settings '
  25. @echo ' make serve [PORT=8000] serve site at http://localhost:8000'
  26. @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
  27. @echo ' make devserver [PORT=8000] serve and regenerate together '
  28. @echo ' make ssh_upload upload the web site via SSH '
  29. @echo ' make rsync_upload upload the web site via rsync+ssh '
  30. @echo ' '
  31. @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
  32. @echo 'Set the RELATIVE variable to 1 to enable relative urls '
  33. @echo ' '
  34. html:
  35. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  36. clean:
  37. [ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
  38. regenerate:
  39. $(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  40. serve:
  41. ifdef PORT
  42. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
  43. else
  44. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  45. endif
  46. serve-global:
  47. ifdef SERVER
  48. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER)
  49. else
  50. $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
  51. endif
  52. devserver:
  53. ifdef PORT
  54. $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
  55. else
  56. $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
  57. endif
  58. publish:
  59. $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
  60. .PHONY: html help clean regenerate serve serve-global devserver publish