-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (57 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
SERVER_IP=127.1
SERVER_PORT=4006
build: ensure-post-author bundler
bundle exec jekyll build
ensure-post-author:
@find _posts/ -name '*.md' | xargs -I{} bash -c "grep -qP '^author: \p{L}+' {} || ( printf '\nNo author found for {}\n\n' && exit 1 )"
pc: pre-commit
pre-commit: build audit
test: $(SERVER_PID_FILE)
@wget --mirror --output-document=mirror --quiet http://$(SERVER_IP):$(SERVER_PORT) \
&& rm mirror \
|| rm -f mirror && exit 1
start: build bundler open
bundle exec jekyll serve --host $(SERVER_IP) --port $(SERVER_PORT)
post: bundler
@read -p "Article title: " TITLE && EDITOR=code bundle exec jekyll post "$$TITLE"
# More jekyll-compose goodness, with `bundle exec`:
# jekyll page "My New Page"
# jekyll post "My New Post"
# jekyll draft "My new draft"
# jekyll publish _drafts/my-new-draft.md
# jekyll unpublish _posts/2014-01-24-my-new-draft.md
bundler: /usr/local/bin/bundle
/usr/local/bin/bundle:
@gem list bundler | grep '^bundler ' || gem install bundler
@bundle check || bundle install
edit:
code -n .
e: edit
open:
open http://$(SERVER_IP):$(SERVER_PORT)
fonts: _sass/_fonts.scss
_sass/_fonts.scss:
( \
echo 'https://fonts.googleapis.com/css?family=Alegreya+Sans|Alegreya:400,400i,700&display=swap&subset=cyrillic,latin-ext'; \
echo 'https://fonts.googleapis.com/css?family=Alegreya+Sans:400,800,900&display=swap&subset=cyrillic,latin-ext' \
) | while read url; do \
curl \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:69.0) Gecko/20100101 Firefox/69.0' \
--fail "$$url" >> $@ \
; done
rm -rf assets/fonts
mkdir -p assets/fonts
grep -Po 'https://fonts.gstatic.com\S+.woff2' $@ | xargs wget --directory-prefix=assets/fonts/
/usr/local/opt/gnu-sed/libexec/gnubin/sed -i 's|https://fonts.gstatic.com/.*/|fonts/|' $@
u: update
update:
bundle update --all
i: install
install:
bundle install
a: audit
audit:
bundle exec bundle-audit check
au: audit-update
audit-update:
bundle exec bundle-audit update