This is a gentle fork from https://framagit.org/marienfressinaud/photos.marienfressinaud.fr with a responsive and optimized mindset. https://media.larlet.fr/
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.

Makefile 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .DEFAULT_GOAL := help
  2. include .env
  3. SERVER_OUTPUT = $(TARGET_SERVER_OUTPUT) # user@server.url:/path/to/website
  4. # See https://daniel.feldroy.com/posts/autodocumenting-makefiles
  5. define PRINT_HELP_PYSCRIPT # start of Python section
  6. import re, sys
  7. output = []
  8. # Loop through the lines in this file
  9. for line in sys.stdin:
  10. # if the line has a command and a comment start with
  11. # two pound signs, add it to the output
  12. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  13. if match:
  14. target, help = match.groups()
  15. output.append("\033[36m%-10s\033[0m %s" % (target, help))
  16. # Sort the output in alphanumeric order
  17. output.sort()
  18. # Print the help result
  19. print('\n'.join(output))
  20. endef
  21. export PRINT_HELP_PYSCRIPT # End of python section
  22. .PHONY: install
  23. install: ## Install the dependencies to build the website
  24. python -m pip install -r requirements.txt
  25. .PHONY: build
  26. build: ## Build the website
  27. python revelateur.py
  28. .PHONY: ulid
  29. ulid: ## Generate a ULID (useful for passwords)
  30. @python -c 'from ulid import ULID;print(str(ULID()))'
  31. .PHONY: clean
  32. clean: ## Clean output files
  33. rm -rf ./output ./__pycache__
  34. .PHONY: serve
  35. serve: build ## Serve the website (development)
  36. cd output && python -m http.server 8080
  37. .PHONY: publish
  38. publish: build ## Publish the website online (rsync)
  39. # With rsync 3.1.0 you can use `--info=progress2`
  40. rsync -P -rzc --stats --cvs-exclude --delete ./output/ $(SERVER_OUTPUT)
  41. .PHONY: help
  42. help:
  43. @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)