Skip to content

Commit

Permalink
add new post (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
verygoodsoftwarenotvirus authored Apr 4, 2024
1 parent 6a43cc8 commit eb3d7cb
Show file tree
Hide file tree
Showing 2 changed files with 661 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
OUTPUT_DIR := dist
CONFIG_FILE := config.toml
GCLOUD_BUCKET := blog.verygoodsoftwarenotvirus.ru
OUTPUT_DIR := dist
CONFIG_FILE := config.toml
GCLOUD_BUCKET := blog.verygoodsoftwarenotvirus.ru
BLOG_GENERATOR := klakegg/hugo:0.92.1
PREVIEW_PORT := 8080
MYSELF := $(shell id -u)
MY_GROUP := $(shell id -g)
GENERATOR_CMD := docker run --rm \
--volume $(PWD):$(PWD) \
--workdir=$(PWD) \
--publish $(PREVIEW_PORT):$(PREVIEW_PORT) \
--user $(MYSELF):$(MY_GROUP) \
$(BLOG_GENERATOR)

.PHONY: clean
clean:
rm -rf $(OUTPUT_DIR)

$(OUTPUT_DIR):
hugo --destination $(OUTPUT_DIR) --minify --config=config.toml
.PHONY: pull_image
pull_image:
@docker pull --quiet $(BLOG_GENERATOR)

$(OUTPUT_DIR): pull_image
$(GENERATOR_CMD) --destination $(OUTPUT_DIR) --minify --config=config.toml

.PHONY: preview
preview:
hugo server --buildDrafts --port=8080 --noHTTPCache --cleanDestinationDir --disableFastRender
preview: pull_image
$(GENERATOR_CMD) server --buildDrafts --port=8080 --noHTTPCache --cleanDestinationDir --disableFastRender

.PHONY: publish-gcloud
publish-gcloud: clean $(OUTPUT_DIR)
Expand Down
Loading

0 comments on commit eb3d7cb

Please sign in to comment.