Skip to content

Handcrafted titanium wedding rings. This is the flat (post-retirement) website repo.

License

Notifications You must be signed in to change notification settings

exotica-jewelry/ringsforever

Repository files navigation

This is a flat export of the last stage of the Drupal site for TitaniumRingsForever.com.

License

All content, images, and designs copyright Exotica Jewelry, Inc.

Exotica, Exotica Jewelry and TitaniumRingsForever.com names and logos are registered trademarks. All rights reserved.

This site was originally exported from Drupal 7, consequently the license for all code originating from Drupal is GPLv2+. The license for all other code in this project is GPLv3, as described in LICENSE.txt, except where noted by other included code.

Regeneration

Should the site need to be regenerated, these are the steps:

  1. Spin up the full Drupal site with the post-retirement database (archived elsewhere). Note that even though search is disabled, the site requires Apache Solr and Redis to display category pages.

  2. Read through Lullabot's helpful Sending a Drupal site into retirement blog.

  3. Export using HTTrack (sudo apt install httrack httrack-doc). The command used, from the Lullabot blog, is:

httrack http://LOCALSITE -O OUTPUTDIR -N %h%p/%n/index%[page].%t -WqQ%v -s0 -%F ""
  1. cd into the output folder and run:
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\/index.html/\//g"

to fix links to individual index.html files.

  1. Fix links to the home page -- note that this must be done after the step above!
find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/..\/index.html/\//g' && find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/..\/..\/index.html/\//g' && find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/..\/..\/..\/index.html/\//g'
  1. Search for files that contain the text "Page has moved" or "No results" and redirect or remove these.

  2. Replace the default Search API meta description tag:

find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/Display all the products that are available, using Search API/Our catalog of handcrafted titanium wedding rings./g'
  1. Remove two meta tags which are no longer valid:
find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/<link rel="canonical" href="index.html" \/>//g' && find . -name "*.html" -type f -print0 | xargs -0 sed -i 's/<link rel="shortlink" href="index.html" \/>//g'
  1. Copy over all the contents of site/default/files/styles directories from the original Drupal files backups, since these files will not all be caught by HTTrack. Consult the HTTrack-generated file sites/default/files/skipped.log to see a (likely incomplete) list of these files. cd into each image directory and run:
../../../../../../../_scripts/move-images.sh
  1. Update references to these files by searching and replacing with the following regex patterns:
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\(frontpage_block\)\/public\/rings\/\([^\/]*?\)\.jpg/$1\/public\/rings\/$2\/index\.jpg/g"
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\(product_full\)\/public\/rings\/\([^\/]*?\)\.jpg/$1\/public\/rings\/$2\/index\.jpg/g"
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\(product_medium\)\/public\/rings\/\([^\/]*?\)\.jpg/$1\/public\/rings\/$2\/index\.jpg/g"
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\(product_thumbnail\)\/public\/rings\/\([^\/]*?\)\.jpg/$1\/public\/rings\/$2\/index\.jpg/g"

Notes: product_zoom references do not need to be updated, because they will not have been changed by HTTrack in the first place. You may also want to do a sanity check and ensure that no references like index/index.jpg have been created.

  1. Fix lazyloading by running:
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/src=\"sites\/all\/themes\/lazyloader-image-placeholder\/\"/src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"/g" && find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/src=\"\.\.\/sites\/all\/themes\/lazyloader-image-placeholder\/\"/src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"/g" && find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/src=\"\.\.\/\.\.\/sites\/all\/themes\/lazyloader-image-placeholder\/\"/src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"/g" && find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/src=\"\.\.\/\.\.\/\.\.\/sites\/all\/themes\/lazyloader-image-placeholder\/\"/src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"/g" && find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/src=\"\.\.\/\.\.\/\.\.\/\.\.\/sites\/all\/themes\/lazyloader-image-placeholder\/\"/src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"/g"
  1. Fix the home page logo:
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/sites\/default\/files\/exologo2010\.jpg/sites\/default\/files\/exologo2010\/index.jpg/g"
  1. Push the site up and, once rebuilt, run it through a link checker to make sure there are no broken links. Also check links to the home page (the "home" tab and the logo) from various pages such as category pages, ring pages, the blog index and blog entries, and "about" pages, to ensure these were correctly fixed in step 5 above.

  2. Do a quick sanity check to make sure things like images are loading on category pages, ring pages, the blog index and blog entries, and "about" pages.

  3. Ensure that HTTPS is still working properly.

Actions

Several GitHub Actions are implemented. Hierarchy below represents dependencies, in order to avoid dueling autocommits.

Theming changes

All CSS, HTML and JS theming changes should be recorded here as a list of commits, since if the site is exported again they may be overlooked.

CSS

HTML

JS

  • None so far.