This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: help | |
help: ## Show this help | |
@egrep -h '\s##\s' $(MAKEFILE_LIST) | \ | |
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[34m%-15s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(DST_DIR)/robots.txt: | |
@echo "User-agent: *" > $@ | |
@echo "Allow: *" >> $@ | |
@echo "Sitemap: $(BASE_URL)/sitemap.xml" >> $@ | |
$(DST_DIR)/sitemap.xml: $(HTML_FILES) | |
@echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' > $@ | |
for f in $^; do \ | |
@echo "<url><loc>$(BASE_URL)$${f#$(DST_DIR)}<loc></url>" >> $@ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEMPLATE = $(SRC_DIR)/template.html | |
$(DST_DIR)/%.html: $(SRC_DIR)/%.md $(TEMPLATE) | |
pandoc \ | |
--from markdown_github+smart+yaml_metadata_block+auto_identifiers \ | |
--to html \ | |
--template $(TEMPLATE) \ | |
-o $@ $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: clean | |
clean: | |
rm $(HTML_FILES) | |
rm -rf $(CSS_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: html | |
html: $(HTML_FILES) ## Build all HTML files from Markdown | |
$(DST_DIR)/%.html: $(SRC_DIR)/%.md | |
pandoc --from markdown --to html --standalone $< -o $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: css | |
css: $(CSS_FILES) ## Build all CSS files from SCSS | |
$(CSS_DIR): | |
mkdir -p $@ | |
$(CSS_DIR)/%.css: $(SCSS_DIR)/%.scss $(SCSS_INCLUDES_DIR)/_*.scss | $(CSS_DIR) | |
sass --load-path=$(SCSS_INCLUDES_DIR) --style=compressed --scss $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(CSS_DIR)/%.css: $(SCSS_DIR)/%.scss $(SCSS_INCLUDES_DIR)/_*.scss | |
sass --load-path=$(SCSS_INCLUDES_DIR) --style=compressed --scss $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: html css | |
html: | |
@echo "Building some HTML..." | |
css: | |
@echo "Building some CSS..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC_DIR = src | |
DST_DIR = build | |
CSS_DIR = $(DST_DIR)/css | |
SCSS_DIR = $(SRC_DIR)/scss | |
SCSS_INCLUDES_DIR = $(SCSS_DIR)/includes | |
SCSS_FILES = $(wildcard $(SCSS_DIR)/*.scss) | |
CSS_FILES=$(patsubst $(SCSS_DIR)/%.scss, $(CSS_DIR)/%.css, $(SCSS_FILES)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module USA | |
extend self | |
def full_state_list | |
[ | |
self.state_list, | |
self.outlying_territories, | |
self.armed_forces | |
].reduce(&:concat) |
NewerOlder