web/Makefile

165 lines
8.2 KiB
Makefile
Raw Normal View History

all:
2024-02-07 23:12:20 +00:00
.PHONY: all
2024-02-09 19:17:56 +00:00
.NOTINTERMEDIATE:
.DELETE_ON_ERROR:
2024-02-09 17:55:02 +00:00
.PHONY: sync-from-webflow
2024-02-12 16:27:23 +00:00
2024-02-09 01:03:03 +00:00
# HTML
sync-from-webflow: static/index.html
#sync-from-webflow: static/about/index.html
#sync-from-webflow: static/home-copy/index.html
#sync-from-webflow: static/contact/index.html
#sync-from-webflow: static/team/index.html
#sync-from-webflow: static/blog/index.html
#sync-from-webflow: static/styleguide/index.html
#sync-from-webflow: static/press/index.html
2024-02-12 16:27:23 +00:00
2024-02-09 01:03:03 +00:00
# CSS & JS
2024-02-09 17:55:02 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/js/webflow.fbf9e890f.js
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/css/umorpha.webflow.a8989709b.min.css
sync-from-webflow: static/other-assets/typed.min.js
sync-from-webflow: static/other-assets/jquery-3.5.1.min.dc5e7f18c8.js
2024-02-12 16:27:23 +00:00
2024-02-09 01:03:03 +00:00
# Images
2024-04-30 17:23:14 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae3d_portfolio-2---wide.svg
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae42_portfolio-1---wide.svg
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae43_portfolio-3---wide.svg
2024-02-09 17:55:02 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/65137e999ce90eda6bc2c5f1_placeholder_background.jpg
2024-04-30 17:38:46 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/65139fa5e0b8553d4c913fe5_logo_horizontal_2.svg
2024-02-09 17:55:02 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/6514f53226dcd604df7bb02c_oshwa.png
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/65150cff2a5918f4659245bb_eeba-new.svg
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/65151c532305724bd7375cc3_colorado_green_building_guild.svg
2024-04-30 17:38:46 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/6515ffbd1e90dc6f533c7a85_umorpha_favcon.jpg
2024-04-30 17:23:14 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/651603b40788b95807194509_umorpha_opengraph.jpg
2024-02-09 17:55:02 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/6544458754dbcf28bbba8c70_umorpha_square_logo_black.svg
2024-04-30 17:38:46 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21adaa/65c2e2af7a1dadffe6300e57_umorpha_logo_square_noborder_blue_256.png
2024-02-09 17:55:02 +00:00
sync-from-webflow: static/webflow-assets/650a2b4cc0091d7b7c21ae2e/6515e92ca9da14dcb48bcb9e_html_image_full.jpg
2024-02-12 16:27:23 +00:00
2024-02-09 01:03:03 +00:00
# Uploads
sync-from-webflow: static/webflow-uploads/650a2b4cc0091d7b7c21adaa/650a2db03a157b2c46cdd565_Futura-Std-Medium.ttf
2024-02-12 16:27:23 +00:00
# TODO: There aught to be a way to automate this:
2024-02-09 01:03:03 +00:00
#
# Open Firefox DevTools to the "Network" tab. Check "Disable Cache"
# and "Persist Logs". Visit the following pages:
#
# - https://umorpha.webflow.io/
# - https://umorpha.webflow.io/about
# - https://umorpha.webflow.io/home-copy
# - https://umorpha.webflow.io/contact
# - https://umorpha.webflow.io/team
# - https://umorpha.webflow.io/blog
# - https://umorpha.webflow.io/styleguide
# - https://umorpha.webflow.io/press
2024-04-30 17:23:14 +00:00
# - https://assets-global.website-files.com/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae3d_portfolio%202%20-%20wide.svg
# - https://assets-global.website-files.com/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae42_portfolio%201%20-%20wide.svg
# - https://assets-global.website-files.com/650a2b4cc0091d7b7c21adaa/650a2b4cc0091d7b7c21ae43_portfolio%203%20-%20wide.svg
# - https://assets-global.website-files.com/650a2b4cc0091d7b7c21adaa/651603b40788b95807194509_umorpha_opengraph.jpg
2024-02-09 01:03:03 +00:00
#
# "Save All As HAR"
#umorpha.webflow.io.har:
# ffscript ...
mirror: umorpha.webflow.io.har unhar.go
2024-02-07 23:12:20 +00:00
rm -rf $@
2024-02-07 22:33:16 +00:00
go run unhar.go $@ <$<
2024-02-07 23:12:20 +00:00
mirror/%: mirror
2024-02-09 19:17:56 +00:00
touch --no-create $@
2024-02-07 23:12:20 +00:00
rewrite = sed
rewrite += -e 's,https://assets-global\.website-files\.com/,/webflow-assets/,g'
rewrite += -e 's,https://uploads-ssl\.webflow\.com/,/webflow-uploads/,g'
rewrite += -e 's,https://cdn\.jsdelivr\.net/npm/typed\.js@2\.0\.9,/other-assets/typed.min.js,g'
rewrite += -e 's,https://cdnjs\.cloudflare\.com/ajax/libs/typed\.js/2\.0\.10/typed\.min\.js,/other-assets/typed.min.js,g'
rewrite += -e 's,https://d3e54v103j8qbb\.cloudfront\.net/js/jquery-3\.5\.1\.min\.dc5e7f18c8\.js?site=650a2b4cc0091d7b7c21adaa,/other-assets/jquery-3.5.1.min.dc5e7f18c8.js,g'
rewrite.css = sed
2024-04-30 17:36:32 +00:00
rewrite.css += -e 's/%20/-/g'
rewrite.css += -e '/background-image\.svg/d'
2024-02-07 23:12:20 +00:00
2024-02-12 19:15:55 +00:00
# TODO: Figure out what to do with the following URLs in
# webflow.fbf9e890f.js:
#
# - https://(formdata\.)?webflow\.com/api/v1/form/650a2b4cc0091d7b7c21adaa(/signFile\?.*)?
# - list-manage[0-9]?.com
2024-02-12 19:15:55 +00:00
2024-02-12 17:22:51 +00:00
rewrite.js1 = $(rewrite)
rewrite.js1 += -e 's@var ve=(t,f)=>()=>(f||t((f={exports:{}})\.exports,f),f\.exports);@var ve = function(body, module) { return function() { if (!module) { module = { exports: {} }; body(module.exports, module); } return module.exports; }; }@'
rewrite.js2 = sed -E
2024-02-12 18:30:45 +00:00
# Base
2024-02-12 17:22:51 +00:00
rewrite.js2 += -e 's/\bve\b/defineModule/g'
2024-02-12 18:30:45 +00:00
# Module names
2024-02-12 17:22:51 +00:00
rewrite.js2 += -e 's/\bVe\b/requireTramJS/g'
rewrite.js2 += -e 's/\brt\b/requireWebflowUnderscore/g'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bLe\b/requireWebflow/g'
2024-02-12 17:22:51 +00:00
rewrite.js2 += -e 's/\bvt\b/requireWebflowBadge/g'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bmt\b/requireWebflowEdit/g'
rewrite.js2 += -e 's/\bwt\b/requireWebflowFocusVisible/g'
rewrite.js2 += -e 's/\bEt\b/requireWebflowFocus/g'
rewrite.js2 += -e 's/\b_t\b/requireWebflowLinks/g'
rewrite.js2 += -e 's/\bOt\b/requireWebflowScroll/g'
rewrite.js2 += -e 's/\bSt\b/requireWebflowTouch/g'
2024-02-12 18:46:03 +00:00
rewrite.js2 += -e 's/\bAt\b/requireWebflowForms_helper/g'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bCt\b/requireWebflowForms/g'
2024-02-12 18:46:03 +00:00
rewrite.js2 += -e 's/\bIt\b/requireWebflowNavbar_helper_helper/g'
rewrite.js2 += -e 's/\bPt\b/requireWebflowNavbar_helper/g'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bNt\b/requireWebflowNavbar/g'
# Module args
2024-02-12 17:22:51 +00:00
rewrite.js2 += -e 's/\b(cn|ln|dn|hn|vn|pn|mn|gn|Je|bn|yn|En|xn)\b/exports/g'
rewrite.js2 += -e 's/\(fn\b/(exports/g'
rewrite.js2 += -e 's/\b(nt|lt|ht|gt|yt|xt|kt|Lt|Tt|Mt|Dt|qt)\b/module/g'
rewrite.js2 += -e 's/\bpt([^|])/module\1/g'
2024-02-12 18:30:45 +00:00
# Variables
rewrite.js2 += -e 's/\bie\b/Webflow/g'
rewrite.js2 += -e 's/\bWe\b/webflowModules/g'
rewrite.js2 += -e 's/\bat\b/activate/g'
rewrite.js2 += -e 's/\bst\b/deactivate/g'
2024-02-12 18:46:03 +00:00
rewrite.js2 += -e 's/\b(Fe|et|nn|Bt)\b/jQuery/g' # can't use '$' because other vars/funcs got minified to '$'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bxe\b/underscore/g' # can't use '_' because other vars/funcs got minified to '_'
2024-02-12 18:46:03 +00:00
rewrite.js2 += -e 's/\b(Qe|Jt|bt|Pe|Ue|en|Be|Me)\b/Webflow/g'
rewrite.js2 += -e 's/(\bot|\$$t)\b/tram/g'
2024-02-12 18:30:45 +00:00
rewrite.js2 += -e 's/\bOe=[^.]*\.isFunction,//' -e 's/\bOe\(/jQuery.isFunction(/g'
rewrite.js2 += -e 's/\bXt=[^.]*\(document\),//' -e 's/\bXt\b/jQuery(document)/g'
rewrite.js2 += -e 's/\b_e=[^.]*\(window\),//' -e 's/\b_e\b/jQuery(window)/g'
rewrite.js2 += -e 's/\bSe\b/exports/g'
# Un-golf
rewrite.js2 += -e 's/!0\b/true/g'
rewrite.js2 += -e 's/!1\b/false/g'
2024-02-12 17:22:51 +00:00
2024-04-30 18:33:34 +00:00
rewrite.js3 = sed -E
# Module args
rewrite.js3 += -e '/^ Webflow\.define\("[^"]+", module\.exports = function\(t, f\)/,/^ }\)/{ s/\bt\b/jQuery/g; s/\bf\b/underscore/g; }'
rewrite.js3 += -e '/^ Webflow\.define\("[^"]+", module\.exports = function\(t\)/,/^ }\)/{ s/\bt\b/jQuery/g; }'
2024-02-12 18:30:45 +00:00
# Functional changes
2024-04-30 18:33:34 +00:00
rewrite.js3 += -e '/requireWebflowBadge\(\);/d' -e '/var requireWebflowBadge =/,/^ }\);/d'
rewrite.js3 += -e '/requireWebflowEdit\(\);/d' -e '/var requireWebflowEdit =/,/^ }\);/d'
2024-02-12 17:22:51 +00:00
2024-02-09 17:30:52 +00:00
static/%.html: mirror/umorpha.webflow.io/%.html patches/%.html.patch Makefile
mkdir -p $(@D)
<$< $(rewrite) | (tidy -quiet -indent -wrap 0||true) >$@
patch -i patches/$*.html.patch $@
2024-02-09 01:03:03 +00:00
static/%.html: mirror/umorpha.webflow.io/%.html Makefile
2024-02-07 23:12:20 +00:00
mkdir -p $(@D)
2024-02-07 23:28:07 +00:00
<$< $(rewrite) | (tidy -quiet -indent -wrap 0||true) >$@
2024-02-09 17:30:52 +00:00
! test -f patches/$*.html.patch
2024-02-12 17:22:51 +00:00
static/webflow-assets/%.js: mirror/assets-global.website-files.com/%.js Makefile
2024-02-07 23:28:07 +00:00
mkdir -p $(@D)
2024-02-12 17:22:51 +00:00
<$< $(rewrite.js1) | $(rewrite.js2) | js-beautify --stdin --end-with-newline | $(rewrite.js3) >$@
2024-02-09 19:17:56 +00:00
static/webflow-assets/%.css: mirror/assets-global.website-files.com/%.css Makefile
mkdir -p $(@D)
<$< $(rewrite) | css-beautify --stdin --end-with-newline | $(rewrite.css) >$@
2024-02-07 23:12:20 +00:00
static/webflow-assets/%: mirror/assets-global.website-files.com/% Makefile
mkdir -p $(@D)
$(rewrite) <$< >$@
static/webflow-uploads/%: mirror/uploads-ssl.webflow.com/% Makefile
mkdir -p $(@D)
$(rewrite) <$< >$@
static/other-assets/typed.min.js: mirror/cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.10/typed.min.js
mkdir -p $(@D)
cp $< $@
static/other-assets/jquery-3.5.1.min.dc5e7f18c8.js: mirror/d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js
mkdir -p $(@D)
cp $< $@