Skip to content

Commit da2723c

Browse files
committed
Add "make update-patternslib" target to automate the Patternslib update process.
1 parent 8532579 commit da2723c

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,21 @@ help:
2121

2222
.PHONY: jekyll-build
2323
jekyll-build:: stamp-bundler
24-
$(BUNDLE) exec jekyll build
24+
$(BUNDLE) exec jekyll build --config=_config.yml,_config-patternslib.yml
2525

2626
.PHONY: jekyll-serve
2727
jekyll-serve:: stamp-bundler ## run jekyll, serve and watch
28-
$(BUNDLE) exec jekyll serve
28+
$(BUNDLE) exec jekyll serve --config=_config.yml,_config-patternslib.yml
2929

3030
.PHONY: jekyll-serve-blank
3131
jekyll-serve-blank:: stamp-bundler ## run jekyll, serve and watch (ignoring the baseurl and host settings)
32-
$(BUNDLE) exec jekyll serve --baseurl "" --host "0.0.0.0"
32+
$(BUNDLE) exec jekyll serve --baseurl "" --host "0.0.0.0" --config=_config.yml,_config-patternslib.yml
33+
34+
.PHONY: update-patternslib
35+
update-patternslib:
36+
$(eval PATTERNSLIB_VERSION := $(shell curl https://api.github.com/repos/patternslib/Patterns/releases/latest -s | jq .tag_name -r))
37+
@printf "bundle_url: https://cdn.jsdelivr.net/npm/@patternslib/patternslib@$(PATTERNSLIB_VERSION)/dist/bundle.min.js\npatternslib_version: $(PATTERNSLIB_VERSION)\n" > _config-patternslib.yml
38+
@cat _config-patternslib.yml
39+
@echo # add a newline to output.
40+
-@git commit _config-patternslib.yml -m"Update Patternslib to $(PATTERNSLIB_VERSION)"
3341

_config-patternslib.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bundle_url: https://cdn.jsdelivr.net/npm/@patternslib/[email protected]/dist/bundle.min.js
2+
patternslib_version: 9.8.0

_config.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
title: Patterns
22
author: Cornelis G. A. Kolbach
33
summary: Patternslib is a free toolkit that aims to bring web design and development closer together.
4-
bundle_url: https://cdn.jsdelivr.net/npm/@patternslib/[email protected]/dist/bundle.min.js
5-
patternslib_version: 9.8.0
4+
# bundle_url and patternslib_version are set in _config-patternslib.yml
5+
#bundle_url:
6+
#patternslib_version:
67
baseurl: /
78
domain: www.patternslib.com
89
media: /media
@@ -39,4 +40,4 @@ exclude:
3940
- src/
4041
- stamp-bower
4142
- stamp-npm
42-
- stamp-bundler
43+
- stamp-bundler

0 commit comments

Comments
 (0)