|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
| 3 | +# TODO: Make sure running from latest "main" branch commit |
| 4 | +# TODO: Remove `BLOG_DOWNLOAD` variable requirement. Adjust "email" logic to: |
| 5 | +# - Run generate container |
| 6 | +# - Curl website |
| 7 | +# - Run HTML-friendly container |
| 8 | + |
3 | 9 | # Typical flows:
|
4 | 10 | #
|
5 | 11 | # 1. The first workflow will generate the desired website, landing
|
|
9 | 15 | #
|
10 | 16 | # $ make build && make generate-website && make host-content
|
11 | 17 | #
|
12 |
| -# Then, visit "http://127.0.0.1:8000/blog" from a browser to verify. |
| 18 | +# Then, visit the printed URL from a browser to verify. |
13 | 19 | #
|
14 | 20 | # 2. This workflow will generate the desired email template, landing
|
15 | 21 | # the end contents in the local "output/" directory. This is the
|
|
18 | 24 | #
|
19 | 25 | # $ make build && make generate-email && make host-content
|
20 | 26 | #
|
21 |
| -# Then, visit "http://127.0.0.1:8000/blog" from a browser to verify. |
22 |
| -# Once verified, one can adjust the "BLOG_DOWNLOAD" variable below, and |
23 |
| -# create an email-friendly HTML version of the "BLOG_DOWNLOAD" page. |
24 |
| -# This is the equivalent of running `juice --web-resources-images false /tmp/in.html /tmp/out.html` |
| 27 | +# Then, visit the printed URL from a browser to verify. |
| 28 | +# Once verified, one can adjust the "BLOG_DOWNLOAD" variable below, and |
| 29 | +# we can create an email-friendly HTML version of the latest Blog page. |
| 30 | +# **While the above container is still running**, open another terminal. |
| 31 | +# This is the equivalent of running |
| 32 | +# `curl ${BLOG_DOWNLOAD} > juice/in.html && juice --web-resources-images false /juice/in.html /juice/out.html` |
25 | 33 | #
|
26 | 34 | # $ make optimize-email
|
27 | 35 | #
|
28 | 36 | # This results in the desired email-friendly HTML version: "juice/out.html".
|
29 | 37 |
|
| 38 | +# TODO: The BLOG_DOWNLOAD is only needed because one dockerfile will have to communicate |
| 39 | +# with another, and I don't want to deal with building out the networking logic... yet... |
30 | 40 | # CHANGE ME! vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
31 | 41 | BLOG_DOWNLOAD=http://127.0.0.1:8000/blog/2022/08/10/this-week-in-rust-455/
|
32 | 42 |
|
| 43 | +website-workflow: build clean generate-website host-content |
| 44 | + |
| 45 | +email-workflow-1: build clean generate-email host-content |
| 46 | +email-workflow-2: optimize-email |
| 47 | + |
33 | 48 | build:
|
34 | 49 | cd .. && docker build -t twir -f publishing/Dockerfile . && cd -
|
35 | 50 |
|
@@ -62,6 +77,5 @@ optimize-email:
|
62 | 77 | curl ${BLOG_DOWNLOAD} > juice/in.html
|
63 | 78 | docker run \
|
64 | 79 | -v $(shell pwd)/juice:/usr/twir/juice \
|
65 |
| - -e BLOG_DOWNLOAD=${BLOG_DOWNLOAD} \ |
66 | 80 | twir:latest \
|
67 | 81 | bash create_html_friendly_page.sh
|
0 commit comments