Skip to content

Multi-Etch: A low-acid alternative to hydrofluoric acid for anodizing titanium and other metals.

License

Notifications You must be signed in to change notification settings

exotica-jewelry/multietch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multietch

Squarespace export

(Re)running the export

We run mirror.sh three times because Squarespace is finicky and tries to deny access randomly. wget will ignore files that have already been retrieved in the subsequent rounds.

One quick way to check if all files are there is to look at the etching- files; there should be 23. A complete list of all files (excluding third-party domain page assets) can be found on the sitemap.

rm -rf docs && mkdir docs && mkdir docs/files && mkdir docs/files/assets
./mirror.sh && ./mirror.sh && ./mirror.sh
./copy.sh

Mass-file updates

My regexfu failed me when combined with capture groups and sed and its many (nonstandard) (annoying) idiosyncrases. So then we need to do manual find and replace across the 'docs' files in Sublime Text (with regex enabled):

From To
(href|src)="[\.\.\/]*s\/ $1="\/files\/s\/
(href|src)="[\.\.\/]*static1.squarespace.com $1="\/files
(href|src)="[\.\.\/]*images.squarespace-cdn.com $1="\/files
(href|src)="[\.\.\/]*assets.squarespace.com $1="\/files\/assets
[\.\.\/]+universal \/files\/universal
(href|src)="[\/]*[\.\.\/]* $1="\/

Then for the simpler rewrites, run:

./rewrite.sh

Manual page updates

A few pages benefit from specific fixes that we were never able to do within Squarespace. Using Sublime Text (with regex enabled), find and replace in these files:

  • Open the deeply-nested site.css file and add the following to the top:
@import "/files/manual/fonts/stylesheet.css";
@import "/files/manual/additions.css";
  • about/testimonials.html: replace <p class="entry-more-link">.*</p> with nothing
  • multietch-blog.html: replace "baseUrl":"https://www.multietch.com" with "baseUrl":"/"

Run Linkchecker from the command line, on a local or hosted version of the exported site, to determine broken links. Commands:

linkchecker --no-robots -F html --ignore-url='/tag' --ignore-url='/category' <siteurl>`
linkchecker --no-robots -F csv --ignore-url='/tag' --ignore-url='/category' <siteurl>`

The latter of these was used to create brokenlinks.csv which can be used to manually, tediously, update broken images. (Be sure to do a search/find for all instances of the broken image, not only the instance it found, as it can overlook things like meta tags or JS files.)

Post-export fixes

  • Any embedded videos that were using custom image overlays in Squarespace need to be re-embedded directly. We could use other (non-SS) libraries in the future to have custom image overlays again, but we don't need that right away.

  • Slideshows don't show controls consistently and were always substandard anyway, so they need to be fully replaced.

  • Contact forms (contact page and "keeping etch times consistent" page) need to be replaced with a non-SS option.

Ongoing work

Minifying files

Minifying can be useful if you're running find-replace on multiple lines and don't want to worry about whitespace matching. It's also, of course, the natural state we should be serving HTML.

To minify all files from docs/ into a separate directory called minified/ install the binaries for tdewolff/minify and run:

~/bin/minify --html-keep-comments --html-keep-conditional-comments --html-keep-default-attrvals --html-keep-document-tags --html-keep-end-tags --html-keep-quotes -r -o minified/ --match=\.html docs

Prettifying files

Install Prettier with Node:

npm i -g prettier

Prettier defaults for HTML are fine, so you don't need to specify rules. Then run it on a specific file:

npx prettier -w <filename>

Ideally, run a minifier on the file once you're done with the work.

About

Multi-Etch: A low-acid alternative to hydrofluoric acid for anodizing titanium and other metals.

Resources

License

Stars

Watchers

Forks