1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-31 12:01:54 +02:00

News! RSS! Fixed link-checker! Good stuff

This commit is contained in:
Pomax
2020-09-18 11:37:39 -07:00
parent bef638dc0b
commit 53f559001a
15 changed files with 184 additions and 192 deletions

View File

@@ -3,10 +3,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>A Primer on Bézier Curves</title>
<link rel="icon" href="images/favicon.png" type="image/png" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="news/rss.xml" />
<!-- page styling -->
<link rel="preload" href="images/paper.png" as="image" />
<link rel="stylesheet" href="placeholder-style.css" />
@@ -29,7 +31,7 @@
<meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-18T05:19:56+00:00" />
<meta property="og:updated_time" content="2020-09-18T18:37:03+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />
@@ -430,7 +432,7 @@
<ul>
<li>
<p>
First commit for the <a href="https://pomax.github.io/bezierinfo">bezierinfo</a> site, based on the pre-Primer webpage that covered
First commit for the <a href="https://pomax.github.io/bezierinfo/">bezierinfo</a> site, based on the pre-Primer webpage that covered
the basics of Bezier curves in HTML with Processing.js examples.
</p>
</li>

View File

@@ -3,11 +3,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ベジェ曲線入門</title>
<base href=".." />
<link rel="icon" href="images/favicon.png" type="image/png" />
<base href=".." />
<link rel="alternate" type="application/rss+xml" title="RSS" href="news/rss.xml" />
<!-- page styling -->
<link rel="preload" href="images/paper.png" as="image" />
@@ -31,7 +32,7 @@
<meta property="og:locale" content="ja-JP" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-18T05:19:56+00:00" />
<meta property="og:updated_time" content="2020-09-18T18:37:03+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />
@@ -407,7 +408,7 @@
<ul>
<li>
<p>
First commit for the <a href="https://pomax.github.io/bezierinfo">bezierinfo</a> site, based on the pre-Primer webpage that covered
First commit for the <a href="https://pomax.github.io/bezierinfo/">bezierinfo</a> site, based on the pre-Primer webpage that covered
the basics of Bezier curves in HTML with Processing.js examples.
</p>
</li>

View File

@@ -1,142 +0,0 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Rewriting the tech stack</title>
<link rel="icon" href="images/favicon.png" type="image/png" />
<base href=".." />
<!-- page styling -->
<link rel="preload" href="images/paper.png" as="image" />
<link rel="stylesheet" href="placeholder-style.css" />
<!-- And a slew of SEO related meta elements, because being discoverable is important -->
<meta name="description" content="Rewriting the tech stack" />
<!-- opengraph information -->
<meta property="og:title" content="Rewriting the tech stack" />
<meta property="og:image" content="https://pomax.github.io/bezierinfo/images/og-image.png" />
<meta property="og:type" content="text" />
<meta property="og:url" content="https://pomax.github.io/bezierinfo/news/2020-08-28.html" />
<meta property="og:description" content="Rewriting the tech stack" />
<meta property="og:locale" content="en-GB" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2020-08-28T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-18T05:19:56+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />
<!-- twitter card information -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@TheRealPomax" />
<meta name="twitter:creator" content="@TheRealPomax" />
<meta name="twitter:image" content="https://pomax.github.io/bezierinfo/images/og-image.png" />
<meta name="twitter:url" content="https://pomax.github.io/bezierinfo/news/" />
<meta name="twitter:description" content="Rewriting the tech stack" />
<!-- my own referral/page hit tracker, because Google knows enough -->
<script src="./js/site/referrer.js" type="module" async></script>
<!--
The part that makes interactive graphics work: an HTML5 <graphics-element> custom element.
Note that we're not defering this: we just want it to kick in as soon as possible, and
given how much HTML there is, that means this can, and thus should, kick in before the
document is done even transferring.
-->
<script src="./js/custom-element/graphics-element.js" type="module" async></script>
<link rel="stylesheet" href="./js/custom-element/graphics-element.css" />
<!-- make images lazy load much earlier -->
<script src="./js/site/better-lazy-loading.js" type="module" async defer></script>
</head>
<body>
<div class="dev" style="display: none;">
DEV PREVIEW ONLY
<script>
(function () {
var loc = window.location.toString();
if (loc.includes("localhost") || loc.includes("BezierInfo-2")) {
var e = document.querySelector("div.dev");
e.removeAttribute("style");
}
})();
</script>
</div>
<div class="github">
<img src="images/ribbon.png" alt="This page on GitHub" style="border: none;" usemap="#githubmap" width="200" height="149" />
<map name="githubmap">
<area shape="poly" coords="30,0, 200,0, 200,114" href="http://github.com/pomax/BezierInfo-2" alt="This page on GitHub" />
</map>
</div>
<header></header>
<main>
<h1>Rewriting the tech stack</h1>
<h5 class="post-date">Fri, 28 Aug 2020</h5>
<p>
Once upon a time, I needed to draw some Bezier curves because I was trying to create a Japanese kanji composition system that turned strokes
into outlines, and that required knowing how to offset Bezier curves and... at the time (2011, time flies) there was no good single source of
information for Bezier curves on the web. So I made one. Sure it started small, but it turns out that if you just keep adding bits to
something, several years later you have quite the monster, and a single HTML file becomes intractible.
</p>
<p>
So, in 2016, when <a href="">React.js</a> exploded onto the scene, I rewrote the primer as a React app, and it became a lot easier to
maintain. Like, <em>a lot</em> a lot. However, there was a downside: no JS meant no content. Sure, server-side rendering sort of existed, but
not really, and because the Primer is hosted through github, there was no "server" to run. Plus, trying to rehydrate an app the size of the
Primer from a giant HTML file had truly <em>dire</em> performance.
</p>
<p>
So I left it a regular React app, and every time I thought "wouldn't it be nice if it was just... a web page again?" the browser landscape
just hadn't caught up. Finally, in 2020, things are different: with a global pandemic, and some vacation time, and something random causing me
to look up the state of HTML custom elements, everything was pointing at it being time to finally, <em>finally</em>, turn the Primer back into
a normal web page.
</p>
<p>
The new tech stack is, frankly, pretty amazing. It does some thing that weren't possible even a year ago, let alone back in 2016, and this is
the first in a series of posts on how the new tech stack works. To give a bit of a teaser, the series will cover:
</p>
<ul>
<li>Essentially reinventing (a limited form of) Processing.js</li>
<li>Writing a custom build system, because I'm exhausted with Webpack and hope to never use it again.</li>
<li>Using modern ES module code that runs in both the browser and Node.js.</li>
<li>Chapter content written as easy to read and write markdown format.</li>
<li>A custom <code>&lt;graphics-element&gt;</code> element that turns a <code>src="blah.js"</code> into an interactive canvas graphic...</li>
<li>...with that same source code being read in and run by Node.js <em>on a canvas</em> to generate fallback images.</li>
<li>
Real LaTeX code, that gets compiled into optimized SVG using <code>xelatex</code>, <code>pdfcrop</code>, <code>pdf2svg</code>, and
<code>svgo</code>.
</li>
<li>Localized content based on a simple filenaming scheme.</li>
<li>Nicely formatted HTML, CSS, and JS thanks to <code>prettier</code>.</li>
<li>Responsive CSS, so the content intelligently reflows where possible.</li>
<li>A "Live build" setup for working on the content and code.</li>
<li>Automatic link-checking to make sure none of the links in the Primer lead you to a 404.</li>
<li>This "news" section, so that I can write posts to go along with new sections getting added, or notable changes being made.</li>
</ul>
<p>
It's going to take me a while to detail the entire tech stack, but ultimately what matters is that you get a Primer that is a normal "vanilla"
HTML, CSS, and JS page again, that "just works" even with JS disabled.
</p>
<p>
Enjoy <a href="https://pomax.github.io/bezierinfo">The new Primer on Bézier Curves</a>, and if you find any problems,
<a href="https://github.com/Pomax/BezierInfo-2/issues">you know where to go</a>.
</p>
<p>See you in the next post!</p>
<p>— Pomax</p>
</main>
<hr />
<footer class="copyright">This post is a news entry for the <a href="..">Primer on Bézier Curves</a></footer>
<!-- fix firefox's scroll position algorithm. Due to how it works, it cannot be async/defer -->
<script src="./js/site/fix-scroll.js"></script>
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h1>Posts</h1>
<ul>
<li><a href="./2020-08-28.html">Rewriting the tech stack</a> (Fri, 28 Aug 2020)</li>
</ul>
<p><a href="..">Back to the primer</a></p>
</body>
</html>

51
docs/news/rss.xml Normal file
View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>A Primer on Bézier Curves</title>
<link>https://pomax.github.io/bezierinfo</link>
<atom:link href="https://pomax.github.io/bezierinfo" rel="self"></atom:link>
<description>News updates for the <a href="https://pomax.github.io/bezierinfo">primer on Bézier Curves</a> by Pomax</description>
<language>en-GB</language>
<lastBuildDate>undefinedT12:00:00+00:00</lastBuildDate>
<image>
<url>https://pomax.github.io/bezierinfo/iamges/og-image.png</url>
<title>A Primer on Bézier Curves</title>
<link>https://pomax.github.io/bezierinfo</link>
</image>
<item>
<title>Rewriting the tech stack</title>
<link>https://pomax.github.io/bezierinfo/news/2020-08-28.html</link>
<description>
&lt;p&gt;Once upon a time, I needed to draw some Bezier curves because I was trying to create a Japanese kanji composition system that turned strokes into outlines, and that required knowing how to offset Bezier curves and... at the time (2011, time flies) there was no good single source of information for Bezier curves on the web. So I made one. Sure it started small, but it turns out that if you just keep adding bits to something, several years later you have quite the monster, and a single HTML file becomes intractible.&lt;/p&gt;
&lt;p&gt;So, in 2016, when &lt;a href=&quot;&quot;&gt;React.js&lt;/a&gt; exploded onto the scene, I rewrote the primer as a React app, and it became a lot easier to maintain. Like, &lt;em&gt;a lot&lt;/em&gt; a lot. However, there was a downside: no JS meant no content. Sure, server-side rendering sort of existed, but not really, and because the Primer is hosted through github, there was no &quot;server&quot; to run. Plus, trying to rehydrate an app the size of the Primer from a giant HTML file had truly &lt;em&gt;dire&lt;/em&gt; performance.&lt;/p&gt;
&lt;p&gt;So I left it a regular React app, and every time I thought &quot;wouldn&#39;t it be nice if it was just... a web page again?&quot; the browser landscape just hadn&#39;t caught up. Finally, in 2020, things are different: with a global pandemic, and some vacation time, and something random causing me to look up the state of HTML custom elements, everything was pointing at it being time to finally, &lt;em&gt;finally&lt;/em&gt;, turn the Primer back into a normal web page.&lt;/p&gt;
&lt;p&gt;The new tech stack is, frankly, pretty amazing. It does some thing that weren&#39;t possible even a year ago, let alone back in 2016, and this is the first in a series of posts on how the new tech stack works. To give a bit of a teaser, the series will cover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Essentially reinventing (a limited form of) Processing.js&lt;/li&gt;
&lt;li&gt;Writing a custom build system, because I&#39;m exhausted with Webpack and hope to never use it again.&lt;/li&gt;
&lt;li&gt;Using modern ES module code that runs in both the browser and Node.js.&lt;/li&gt;
&lt;li&gt;Chapter content written as easy to read and write markdown format.&lt;/li&gt;
&lt;li&gt;A custom &lt;code&gt;&amp;lt;graphics-element&amp;gt;&lt;/code&gt; element that turns a &lt;code&gt;src=&quot;blah.js&quot;&lt;/code&gt; into an interactive canvas graphic...&lt;/li&gt;
&lt;li&gt;...with that same source code being read in and run by Node.js &lt;em&gt;on a canvas&lt;/em&gt; to generate fallback images.&lt;/li&gt;
&lt;li&gt;Real LaTeX code, that gets compiled into optimized SVG using &lt;code&gt;xelatex&lt;/code&gt;, &lt;code&gt;pdfcrop&lt;/code&gt;, &lt;code&gt;pdf2svg&lt;/code&gt;, and &lt;code&gt;svgo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Localized content based on a simple filenaming scheme.&lt;/li&gt;
&lt;li&gt;Nicely formatted HTML, CSS, and JS thanks to &lt;code&gt;prettier&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Responsive CSS, so the content intelligently reflows where possible.&lt;/li&gt;
&lt;li&gt;A &quot;Live build&quot; setup for working on the content and code.&lt;/li&gt;
&lt;li&gt;Automatic link-checking to make sure none of the links in the Primer lead you to a 404.&lt;/li&gt;
&lt;li&gt;This &quot;news&quot; section, so that I can write posts to go along with new sections getting added, or notable changes being made.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&#39;s going to take me a while to detail the entire tech stack, but ultimately what matters is that you get a Primer that is a normal &quot;vanilla&quot; HTML, CSS, and JS page again, that &quot;just works&quot; even with JS disabled.&lt;/p&gt;
&lt;p&gt;Enjoy &lt;a href=&quot;https://pomax.github.io/bezierinfo&quot;&gt;The new Primer on Bézier Curves&lt;/a&gt;, and if you find any problems, &lt;a href=&quot;https://github.com/Pomax/BezierInfo-2/issues&quot;&gt;you know where to go&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;See you in the next post!&lt;/p&gt;
&lt;p&gt;— Pomax&lt;/p&gt;
</description>
<pubDate>2020-08-28</pubDate>
<guid>2020-08-28.html</guid>
</item>
</channel>
</rss>

View File

@@ -106,6 +106,10 @@ label[for="changelogtoggle"] {
margin-left: 2em;
}
main {
min-height: 75vh;
}
#changelogtoggle {
display: none;
}

View File

@@ -3,11 +3,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>贝塞尔曲线底漆</title>
<base href=".." />
<link rel="icon" href="images/favicon.png" type="image/png" />
<base href=".." />
<link rel="alternate" type="application/rss+xml" title="RSS" href="news/rss.xml" />
<!-- page styling -->
<link rel="preload" href="images/paper.png" as="image" />
@@ -31,7 +32,7 @@
<meta property="og:locale" content="zh-CN" />
<meta property="og:type" content="article" />
<meta property="og:published_time" content="2013-06-13T12:00:00+00:00" />
<meta property="og:updated_time" content="2020-09-18T05:19:56+00:00" />
<meta property="og:updated_time" content="2020-09-18T18:37:03+00:00" />
<meta property="og:author" content="Mike 'Pomax' Kamermans" />
<meta property="og:section" content="Bézier Curves" />
<meta property="og:tag" content="Bézier Curves" />
@@ -390,7 +391,7 @@
<ul>
<li>
<p>
First commit for the <a href="https://pomax.github.io/bezierinfo">bezierinfo</a> site, based on the pre-Primer webpage that covered
First commit for the <a href="https://pomax.github.io/bezierinfo/">bezierinfo</a> site, based on the pre-Primer webpage that covered
the basics of Bezier curves in HTML with Processing.js examples.
</p>
</li>