|
10 | 10 | TEMP_FILE=kubecon.html
|
11 | 11 | OUT_FILE=KUBECON.md
|
12 | 12 |
|
| 13 | +sed=sed |
| 14 | +head=head |
| 15 | + |
| 16 | +if [[ "$OSTYPE" == "darwin"* ]]; then |
| 17 | + sed=gsed |
| 18 | + head=ghead |
| 19 | +fi |
| 20 | + |
13 | 21 | if [[ -z "$DEBUG" ]]; then
|
14 | 22 | wget https://github.com/suntong/html2md/releases/download/${HTML2MD_VER}/${HTML2MD}.tar.gz -O ${HTML2MD}.tar.gz
|
15 | 23 | tar xvf ${HTML2MD}.tar.gz
|
|
21 | 29 | # sed 2: make site top-link self-referential, it should point at /kubecon
|
22 | 30 | # sed 3: remove empty image alt ref with no significance (branding logo)
|
23 | 31 | # sed 4-6: detect the images from their alt tags, then replace with figure refs
|
| 32 | +# sed 7: the header which is meant to float between images must also have float |
| 33 | +# sed 8: flux booth fun (a caption with a heading h1 followed by two paragraphs!) |
24 | 34 | wget ${SOURCE_SITE} -O ${TEMP_FILE} \
|
25 |
| - && ${HTML2MD_BIN} -i ${TEMP_FILE} |sed '1,6d'|head -n -13 \ |
26 |
| - | sed 's_# \[Copy heading link\](\\#h\.[a-z0-9]*)[[:space:]]*_# _' \ |
27 |
| - | sed 's_/view/flux-kubecon-paris-2024/home_/kubecon_' \ |
28 |
| - | sed -E 's_\[!\[\]\([^)]+\)_[_g' \ |
29 |
| - | sed -E 's_!\[flux-logo-inner-header-left[^)]+\)_\ |
30 |
| -{{< figure src="/img/flux-horizontal-color.png" alt="Flux Logo" class="flux-logo-inner-header-left" >}}_g' \ |
31 |
| - | sed -E 's_!\[inner-header-right-align[^)]+\)_\ |
32 |
| -{{< figure src="/img/blob-waving.gif" alt="Blob Waving" class="inner-header-right-align" >}}_g' \ |
33 |
| - | sed -E 's_!\[stickers-float-left[^)]+\)_\ |
34 |
| -{{< figure src="/img/flux-cuttlefish-stickers.jpeg" alt="Custom printed stickers with cuttlefish mascot and Flux logos" class="stickers-float-left" >}}_g' \ |
| 35 | + && ${HTML2MD_BIN} -i ${TEMP_FILE} |$sed '1,6d'|$head -n -13 \ |
| 36 | + | $sed 's_# \[Copy heading link\](\\#h\.[a-z0-9]*)[[:space:]]*_# _' \ |
| 37 | + | $sed 's_/view/flux-kubecon-paris-2024/home_/kubecon_' \ |
| 38 | + | $sed -E 's_\[!\[\]\([^)]+\)_[_g' \ |
| 39 | + | $sed -E 's_!\[flux-logo-inner-header-left[^)]+\)_\ |
| 40 | +<div class="clearfix">\ |
| 41 | +<div class="flux-logo-inner-header-left">\ |
| 42 | +{{< figure src="/img/flux-horizontal-color.png" alt="Flux Logo" >}}\ |
| 43 | +</div>_g' \ |
| 44 | + | $sed -E 's_!\[inner-header-right-align[^)]+\)_\ |
| 45 | +<div class="inner-header-right-align">\ |
| 46 | +{{< figure src="/img/blob-waving.gif" alt="Blob Waving" >}}\ |
| 47 | +</div></div>_g' \ |
| 48 | + | $sed -E 's_!\[stickers-float-left[^)]+\)_\ |
| 49 | +<div class="clearfix">\ |
| 50 | + <div class="stickers-float-left">\ |
| 51 | +{{< figure src="/img/flux-cuttlefish-stickers.jpeg" alt="Custom printed stickers with cuttlefish mascot and Flux logos" >}}\ |
| 52 | +</div>_g' \ |
| 53 | + | $sed -z 's_# KubeCon Paris 2024\n\nMarch 19-22, 2024_<div class="float-header-kubecon"><h1>KubeCon Paris 2024</h1><p>March 19-22, 2024</p></div>_' \ |
| 54 | + | $sed -Ez 's_# Flux Booth fun!\n\n([^\n]+)\n\n([^\n]+)\n\n#_\ |
| 55 | +<div class="float-booth-fun"><h1>Flux Booth fun!</h1><p>\1</p><p>\2</p></div></div>\n\n#_' \ |
35 | 56 | > ${OUT_FILE}
|
36 | 57 |
|
37 | 58 | if [[ -z "$DEBUG" ]]; then
|
|
0 commit comments