Skip to content

Commit

Permalink
New HTML template for redirect pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 18, 2024
1 parent 7bdffd8 commit 1b0f227
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 86 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases
- uses: actions/checkout@v4 #see: https://github.com/actions/checkout/releases
with:
ref: main #supplies full git history needed by git-restore-mtime-action
fetch-depth: 0 #needed by git-restore-mtime-action
- uses: chetan/git-restore-mtime-action@v2
- uses: actions/setup-node@v4 #see: https://github.com/actions/setup-node/releases
ref: main #fetch the full git history of the "main"
fetch-depth: 0 #branch for git-restore-mtime-action below
- uses: chetan/git-restore-mtime-action@v2 #see: https://github.com/chetan/git-restore-mtime-action/releases
- uses: actions/setup-node@v4 #see: https://github.com/actions/setup-node/releases
- run: npm install
- run: npm test
- uses: actions/configure-pages@v5 #see: https://github.com/actions/configure-pages/releases
- uses: actions/upload-pages-artifact@v3 #see: https://github.com/actions/upload-pages-artifact/releases
- uses: actions/configure-pages@v5 #see: https://github.com/actions/configure-pages/releases
- uses: actions/upload-pages-artifact@v3 #see: https://github.com/actions/upload-pages-artifact/releases
with:
path: docs
- uses: actions/deploy-pages@v4 #see: https://github.com/actions/deploy-pages/releases
- uses: actions/deploy-pages@v4 #see: https://github.com/actions/deploy-pages/releases
id: deployment
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"build": [
"copy-folder src/website build --ext=.png,.jpg,.js",
"lessc src/website/style.less build/style.css",
"replacer src/website --ext=.html build",
"replacer src/website --ext=.html build",
"replacer src/redirects --ext=.html build",
"copy-file build/elsewhere/article-list.html build/article/index.html --move"
],
"publish": [
Expand Down
4 changes: 4 additions & 0 deletions src/redirects/fractions/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% assign title = 'Fractions are a Royal Pain in Imperial' %}
{% assign subtitle = 'What is 1/5 of a yard?' %}
{% assign uri = 'article/fractions-are-a-royal-pain-in-imperial' %}
{% render 'src/templates/redirect.html', title: title, subtitle: subtitle, uri: uri %}
4 changes: 4 additions & 0 deletions src/redirects/liberty/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% assign title = 'Liberty Units' %}
{% assign subtitle = 'FTW' %}
{% assign uri = 'article/liberty-units-ftw' %}
{% render 'src/templates/redirect.html', title: title, subtitle: subtitle, uri: uri %}
4 changes: 4 additions & 0 deletions src/redirects/poetry/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% assign title = 'Metric Poetry' %}
{% assign subtitle = 'Common Words for SI' %}
{% assign uri = 'article/metric-poetry' %}
{% render 'src/templates/redirect.html', title: title, subtitle: subtitle, uri: uri %}
27 changes: 27 additions & 0 deletions src/templates/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<!-- - - - - - - - -->
<!-- Think Metric -->
<!-- - - - - - - - -->
<!-- {{file.folder}}: {{title}} -->
<html lang=en>
<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<meta http-equiv=refresh content="1; url=../{{uri}}">
<meta name=description content="{{title}} &bull; {{subtitle}}">
<title>{{title}} &bull; {{subtitle}}</title>
<link rel=icon href=../assets/bookmark.png>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/web-ignition@{{package.dependencies.web-ignition|version}}/dist/reset.min.css>
<style>main { opacity: 0; }</style>
<script>globalThis.location.href = '../{{uri}}';</script>
</head>
<body>

<main>
<h1>{{title}}</h1>
<h2>{{subtitle}}</h2>
<a href=../{{uri}}>https://think-metric.org/{{file.folder}}</a>
</main>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ <h3>Imperial fractions muck up the internet:</h3>
<ol>
<li>Entering a fraction into an <b>input field is unpredictable</b></li>
<li>You're forced to <b>manually convert decimals to fractions</b> to verify orders</li>
<li>Fractions cause <b>extraneous product duplicates</b></li>
<li>Fractions are <b>chaos for sorting</b></li>
<li>Spaces in fractional units <b>break search tools</b></li>
<li>Fractions lead to <b>extraneous product duplicates</b></li>
<li>Fractions <b>break sorting</b></li>
<li>Spaces in fractional units inflict <b>chaos on search results</b></li>
</ol>
</div>
</section>
Expand All @@ -43,26 +43,27 @@ <h2>Tedium of Extra Manual Steps</h2>
both decimal and fractional imperial units, but the user interface is awkward and special
instructions are needed.&nbsp;
Without special instructions, users won't even know that fractions are allowed.&nbsp;
Likewise, the ordering system for custom windows at the America's largest home improvement
center automatically converts fractional inches to decimal inches.&nbsp;
To verify the correctness of an order, the customer is forced to manually convert decimal
inches back to fractional inches.&nbsp;
Even most imperial zeloets don't have the fractional equivalent of <code>0.625</code>
committed to memory.&nbsp;
Regardless, the fake precision of numbers like <code>0.625</code> should deeply offend all
decent people.&nbsp;
This problem crops up in the computerized ordering system for closet doors at
America's largest home improvement retailer.&nbsp;
The problem then snowballs because the system automatically converts fractional inches to
decimal inches, forcing customers to convert decimal inches back to fractions just to
verify the correctness of an order.&nbsp;
Even most imperial zealots don't have the fractional equivalent of
<code title=5/8>0.625</code> committed to memory.&nbsp;
Regardless, the fake precision of numbers like <code title=5/8>0.625</code>
should offend all decent people.&nbsp;
</p>
<p>
Even if the user doesn't need to type out a fraction, fractions still wreak havoc on
product listings because computers will consider sizes like
<code>3.5"</code>, <code>3 1/2"</code>, and <code>3 4/8"</code> to all be different sizes
when in fact they are identical.&nbsp;
when in fact they are all identical.&nbsp;
</p>
<p>
Fractions also break sorting algorithms.&nbsp;
Computers often consider <code>1/2</code> to be less then <code>3/16</code> because "1"
comes before "3".&nbsp;
Website search tools suffer a similar problem.&nbsp;
Website search tools suffer a related problem.&nbsp;
For example, the space character in <code>6 3/4"</code> tricks computers into thinking the
user might be interested in 6-packs and <code>3/4"</code> drill bits, neither of which
have anything at all to do with the measurement of <code>6 3/4"</code>.&nbsp;
Expand All @@ -73,7 +74,7 @@ <h2>Tedium of Extra Manual Steps</h2>
<h2>Stop the Insanity</h2>
<figure class=floating-card>
<img src=paper-cup-decimal-inches.jpg data-license=fair-use>
<figcaption>Online retailers don't do fractions&nbsp; 🤣 🤣 🤣 </figcaption>
<figcaption>Online retailers don't do fractions&nbsp; 🤣&nbsp;🤣&nbsp;🤣</figcaption>
</figure>
<p>
Many of these problems could be mitigated if software developers were given infinite time
Expand Down
12 changes: 8 additions & 4 deletions src/website/elsewhere/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ <h3>Resources and interesting stuff</h3>

<section id=shortcuts>
<h2>Article Shortcuts</h2>
<p>
<b>Metric Poetry</b><br>
<a href={{webRoot}}/poetry>https://think-metric.org/poetry</a>
</p>
<p>
<b>Fractions are a Royal Pain in Imperial</b><br>
<a href={{webRoot}}/fractions>https://think-metric.org/fractions</a>
</p>
<p>
<b>Liberty Units FTW</b><br>
<a href={{webRoot}}/liberty>https://think-metric.org/liberty</a>
</p>
<p>
<b>Metric Poetry</b><br>
<a href={{webRoot}}/poetry>https://think-metric.org/poetry</a>
</p>
</section>

<section id=noteworthy>
Expand Down
29 changes: 0 additions & 29 deletions src/website/fractions/index.html

This file was deleted.

30 changes: 0 additions & 30 deletions src/website/poetry/index.html

This file was deleted.

0 comments on commit 1b0f227

Please sign in to comment.