diff --git a/README.md b/README.md index b9fb975..2d24489 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ A list of things to check once in a while to make sure I haven't broken them ina - Check the rss feed https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fthomashodson.com%2Ffeed.xml ## Todo + - add svgo https://github.com/svg/svgo + - Figure out a JS bundling script so that I don't have to include node_modules in the deployed site - change the OG image used for the landing page so it's not just my face. - add humans.txt https://humanstxt.org/ - fix the OG tags so that https://cards-dev.twitter.com/validator works diff --git a/_includes/header.html b/_includes/header.html index b9da812..736916c 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,7 +1,7 @@
-A picture of me. +A picture of me.

Tom Hodson

@@ -19,7 +19,7 @@

-
diff --git a/_includes/post_summary.html b/_includes/post_summary.html index 3719e1a..44be5cf 100644 --- a/_includes/post_summary.html +++ b/_includes/post_summary.html @@ -11,12 +11,14 @@
- +
{{post.alt | smartify}} + alt="{{post.alt | smartify}}" + width=128 height=128 + >
diff --git a/_includes/project_summary.html b/_includes/project_summary.html index fdd5c2c..2c1d947 100644 --- a/_includes/project_summary.html +++ b/_includes/project_summary.html @@ -1,8 +1,10 @@
- + + {% assign default_thumbnail = post.assets | append: '/thumbnail.min.svg' %} {{post.img.alt | smartify}} + src = "{{post.img.src | default: default_thumbnail}}" + alt="{{post.img.alt | smartify}}" + width=128 height=128>
diff --git a/_layouts/default.html b/_layouts/default.html index eced7a2..30904aa 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ - + {% include default_head_tags.html%} diff --git a/_layouts/exported_notebook.html b/_layouts/exported_notebook.html index 7f1b658..c0f43a4 100644 --- a/_layouts/exported_notebook.html +++ b/_layouts/exported_notebook.html @@ -1,7 +1,7 @@ --- --- - + diff --git a/_layouts/post.html b/_layouts/post.html index a9f5d2e..2241e4f 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,5 +1,5 @@ - + {% include default_head_tags.html%} diff --git a/_projects/bathroom_shelf.md b/_projects/bathroom_shelf.md index 9d9cac9..533522b 100644 --- a/_projects/bathroom_shelf.md +++ b/_projects/bathroom_shelf.md @@ -3,9 +3,9 @@ title: Bathroom Shelf layout: post excerpt: A little modification to an IKEA thingy. permalink: /projects/bathroom_shelf +assets: /assets/projects/bathroom_shelf img: - src: /assets/projects/bathroom_shelf/thumbnail.svg alt: A small bathroom shelf. class: invertable diff --git a/_projects/bike_lights.md b/_projects/bike_lights.md index f7bfa85..d0f80da 100644 --- a/_projects/bike_lights.md +++ b/_projects/bike_lights.md @@ -3,9 +3,9 @@ title: Bike Lights layout: post excerpt: Making a custom 3W dynamo light for a bike. permalink: /projects/bike_lights +assets: /assets/projects/bike_lights img: - src: /assets/projects/bike_lights/thumbnail.svg alt: A CAD model of a 3D printable mount for a common LED light onto a bike handlebar. class: invertable diff --git a/_projects/ceramics.md b/_projects/ceramics.md index 93e65ed..7d1fb38 100644 --- a/_projects/ceramics.md +++ b/_projects/ceramics.md @@ -3,9 +3,9 @@ title: Ceramics layout: post excerpt: Ongoing explorations in making pots! permalink: /projects/ceramics +assets: /assets/projects/ceramics img: - src: /assets/projects/ceramics/thumbnail.svg alt: class: invertable diff --git a/_projects/helmet_lights.md b/_projects/helmet_lights.md index a75f623..f9dc494 100644 --- a/_projects/helmet_lights.md +++ b/_projects/helmet_lights.md @@ -3,9 +3,9 @@ title: Helmet Lights layout: post excerpt: A few different custom mounts to attach lights to bike helmets. permalink: /projects/helmet_lights +assets: /assets/projects/helmet_lights img: - src: /assets/projects/helmet_lights/thumbnail.svg alt: A CAD model of a 3D printable mount for a common LED light onto a helmet. class: invertable diff --git a/_projects/lamps.md b/_projects/lamps.md index 158a336..d8c5fcc 100644 --- a/_projects/lamps.md +++ b/_projects/lamps.md @@ -3,9 +3,9 @@ title: Lamps layout: post excerpt: 3D Printed Lamp Shades permalink: /projects/lamps +assets: /assets/projects/lamps img: - src: /assets/projects/lamps/thumbnail.svg alt: A CAD model of a 3D printable mount for a common LED light onto a helmet. class: invertable diff --git a/_projects/lasercut_stool.md b/_projects/lasercut_stool.md index 3a0ddf8..2157799 100644 --- a/_projects/lasercut_stool.md +++ b/_projects/lasercut_stool.md @@ -3,9 +3,9 @@ title: Lasercut Stool layout: post excerpt: A lasercut hexagonal wooden stool. permalink: /projects/lasercut_stool +assets: /assets/projects/lasercut_stool img: - src: /assets/projects/lasercut_stool/thumbnail.svg alt: A CAD model of the this hexagonal lasercut stool. class: invertable diff --git a/_projects/lego_adapters.md b/_projects/lego_adapters.md index 5ba3a9b..6f04143 100644 --- a/_projects/lego_adapters.md +++ b/_projects/lego_adapters.md @@ -3,9 +3,9 @@ title: 3D Printed Lego Motor Adapters layout: post excerpt: Adapters to use common components with lego technic. permalink: /projects/lego_adapters +assets: /assets/projects/lego_adapters img: - src: /assets/projects/lego_adapters/thumbnail.svg alt: class: invertable diff --git a/_projects/projector_mount.md b/_projects/projector_mount.md index 00e9b7d..accb9c7 100644 --- a/_projects/projector_mount.md +++ b/_projects/projector_mount.md @@ -3,9 +3,9 @@ title: Projector Shelf Mount layout: post excerpt: A mount for a projector underneath a shelf with a tilt swivel joint. permalink: /projects/projector_mount +assets: /assets/projects/projector_mount img: - src: /assets/projects/projector_mount/thumbnail.svg alt: A CAD model of a 3D printable mount for a common LED light onto a helmet. class: invertable diff --git a/_projects/toothbrush_shelf.md b/_projects/toothbrush_shelf.md index c997646..3d2d230 100644 --- a/_projects/toothbrush_shelf.md +++ b/_projects/toothbrush_shelf.md @@ -3,9 +3,9 @@ title: Toothbrush Shelf layout: post excerpt: A shelf to put your toothbrush charger on. permalink: /projects/toothbrush_shelf +assets: /assets/projects/toothbrush_shelf img: - src: /assets/projects/toothbrush_shelf/thumbnail.svg alt: A CAD model of a small shelf to put a toothbrush right above the charging socket so that the cabling can be hidden inside the shelf. class: invertable diff --git a/_projects/usbc_power_station.md b/_projects/usbc_power_station.md index 1c25c78..56fac14 100644 --- a/_projects/usbc_power_station.md +++ b/_projects/usbc_power_station.md @@ -3,10 +3,10 @@ title: USB-C Power Station layout: post excerpt: One charging station to rule them all! permalink: /projects/usbc_charging_station +assets: /assets/projects/usbc_power_supply img: - src: /assets/projects/usbc_power_supply/thumbnail.svg - alt: + alt: A line rendered CAD model of a laser-cut, book shaped device with exposed internal parts. It wouldn't be obvious without reading the description but it's a USB-C power supply. class: invertable social_image: /assets/projects/usbc_power_supply/thumbnail.png diff --git a/_projects/vector_magnet.md b/_projects/vector_magnet.md index cdecf17..5e5739e 100644 --- a/_projects/vector_magnet.md +++ b/_projects/vector_magnet.md @@ -3,9 +3,9 @@ title: Vector Magnet layout: post excerpt: Make your magnetic fields all 3D like. permalink: /projects/vector_magnet +assets: /assets/projects/vector_magnet img: - src: /assets/projects/vector_magnet/thumbnail.svg alt: A line drawn CAD model of vector magnet. class: invertable diff --git a/assets/projects/bathroom_shelf/thumbnail.min.svg b/assets/projects/bathroom_shelf/thumbnail.min.svg new file mode 100644 index 0000000..fc079ae --- /dev/null +++ b/assets/projects/bathroom_shelf/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/bike_lights/thumbnail.min.svg b/assets/projects/bike_lights/thumbnail.min.svg new file mode 100644 index 0000000..e379ad9 --- /dev/null +++ b/assets/projects/bike_lights/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/ceramics/thumbnail.min.svg b/assets/projects/ceramics/thumbnail.min.svg new file mode 100644 index 0000000..f2190b5 --- /dev/null +++ b/assets/projects/ceramics/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/helmet_lights/thumbnail.min.svg b/assets/projects/helmet_lights/thumbnail.min.svg new file mode 100644 index 0000000..73f8674 --- /dev/null +++ b/assets/projects/helmet_lights/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/lamps/thumbnail.min.svg b/assets/projects/lamps/thumbnail.min.svg new file mode 100644 index 0000000..a1fa822 --- /dev/null +++ b/assets/projects/lamps/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/lasercut_stool/thumbnail.min.svg b/assets/projects/lasercut_stool/thumbnail.min.svg new file mode 100644 index 0000000..0285c4e --- /dev/null +++ b/assets/projects/lasercut_stool/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/lego_adapters/thumbnail.min.svg b/assets/projects/lego_adapters/thumbnail.min.svg new file mode 100644 index 0000000..17b65ec --- /dev/null +++ b/assets/projects/lego_adapters/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/projector_mount/thumbnail.min.svg b/assets/projects/projector_mount/thumbnail.min.svg new file mode 100644 index 0000000..1f4a162 --- /dev/null +++ b/assets/projects/projector_mount/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/toothbrush_shelf/thumbnail.min.svg b/assets/projects/toothbrush_shelf/thumbnail.min.svg new file mode 100644 index 0000000..4efc64a --- /dev/null +++ b/assets/projects/toothbrush_shelf/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/usbc_power_supply/thumbnail.min.svg b/assets/projects/usbc_power_supply/thumbnail.min.svg new file mode 100644 index 0000000..5ee8a9e --- /dev/null +++ b/assets/projects/usbc_power_supply/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/projects/vector_magnet/thumbnail.min.svg b/assets/projects/vector_magnet/thumbnail.min.svg new file mode 100644 index 0000000..601f6d6 --- /dev/null +++ b/assets/projects/vector_magnet/thumbnail.min.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 736a6e4..a342b01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "es-module-shims": "^1.8.1", "lil-gui": "^0.19.1", "mathjax": "^3.2.2", + "svgo": "^3.3.2", "three": "^0.158.0" }, "devDependencies": { @@ -1246,7 +1247,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "dev": true, "engines": { "node": ">=10.13.0" } @@ -1355,8 +1355,7 @@ "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, "node_modules/braces": { "version": "3.0.2", @@ -1622,7 +1621,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -1638,7 +1636,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -1651,7 +1648,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, "engines": { "node": ">= 6" }, @@ -1663,7 +1659,6 @@ "version": "5.0.5", "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", - "dev": true, "dependencies": { "css-tree": "~2.2.0" }, @@ -1676,7 +1671,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", - "dev": true, "dependencies": { "mdn-data": "2.0.28", "source-map-js": "^1.0.1" @@ -1689,8 +1683,7 @@ "node_modules/csso/node_modules/mdn-data": { "version": "2.0.28", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", - "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", - "dev": true + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" }, "node_modules/deepmerge": { "version": "4.3.1", @@ -1729,7 +1722,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -1743,7 +1735,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, "funding": [ { "type": "github", @@ -1755,7 +1746,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -1770,7 +1760,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -1825,7 +1814,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, "engines": { "node": ">=0.12" }, @@ -2479,8 +2467,7 @@ "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" }, "node_modules/merge2": { "version": "1.4.1", @@ -2560,7 +2547,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, "dependencies": { "boolbase": "^1.0.0" }, @@ -2710,8 +2696,7 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -3134,7 +3119,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -3235,10 +3219,10 @@ } }, "node_modules/svgo": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", - "integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", - "dev": true, + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz", + "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==", + "license": "MIT", "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", @@ -3263,7 +3247,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, "engines": { "node": ">= 10" } diff --git a/package.json b/package.json index 713e593..f95ff05 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "es-module-shims": "^1.8.1", "lil-gui": "^0.19.1", "mathjax": "^3.2.2", + "svgo": "^3.3.2", "three": "^0.158.0" }, "devDependencies": { diff --git a/scripts/optimise_svgs.py b/scripts/optimise_svgs.py new file mode 100644 index 0000000..7f9fcfe --- /dev/null +++ b/scripts/optimise_svgs.py @@ -0,0 +1,11 @@ +import subprocess as sb +from pathlib import Path + +svgs = Path("assets/projects/").rglob("*.svg") + +for svg_path in svgs: + minified_name = svg_path.with_suffix(".min.svg") + print(svg_path, minified_name) + sb.run( + ["svgo", str(svg_path), "-o", str(minified_name)] + )