· 2 min read

hello, world

Discover the classic computer program 'hello, world' and by extension, 'hello, internet' for this website.

Discover the classic computer program 'hello, world' and by extension, 'hello, internet' for this website.

According to Wikipedia, a “Hello, World!” program outputs to the screen some simple text while ignoring any user input.

In the C Programming Language, it looks like this:

main( ) {
        printf("hello, world");
}

…hello, internet

Putting text on a screen with a program like the one above is almost the same as generating a static website (like this blog). But how do you get from ‘code’ to ‘website’?

Enter the JAMstack

A popular pattern for building sites nowadays (~ 2023) is called JAMstack. In case you’re curious, the “JAM” of JAMstack stands for:

  • JavaScript
  • APIs
  • Markup

The main benefit of using a JAMstack is that a webpage can be pre-generated into static HTML files… which can then be loaded super fast.

More info here on freeCodeCamp: What is the JAMstack and how do I get started?

Which JAMstack?

JAMstacks are cool. But one of the first choices we need to make is to decide which static page generator to use.

Should I choose Next.js, or Gatsby, or 11ty, or Jekyll, or Hexo, or any one of the other dozens of options you can find?

I’ve played around with most of the ones listed above. In fact, years ago I had a different site set up in 11ty which looked ok. But I wound up starting over when I couldn’t get it to look just right.

For this site, I finally landed on using Astro, with the AstroWind template.

In true JAMstack fashion, Astro takes Markdown documents stored in GitHub and converts them into static pages, which can be quickly deployed to CloudFlare Pages. Some folks use Netlify to do that final deployment piece… I just found Cloudflare easy to use.

Markdown + Astro + Cloudflare Pages = Success!

It’s so fast! (~15 seconds to build and deploy)

12:54:04.539	Cloning repository...
............    
12:54:16.779	✨ Upload complete!
12:54:18.925	Success: Assets published!
12:54:19.752	Success: Your site was deployed!

Want to try?

  1. Sign up for a GitHub account and make a personal repository.
  2. Follow the Astro Getting Started guide.
  3. Sign up for a Cloudflare account.
  4. Follow Cloudflare’s instructions to Deploy an Astro site.

Minor Tweaks

When I first tried to build this site, it wouldn’t build. I think there was a version mismatch between the version of NodeJS I was running locally and the default version used by Cloudflare workers.

That’s easily fixed by updating the build environment variables under Settings -> Environment Variables.

  • NODE_VERSION: 18

Give it a try… and build your own “Hello, World” page on the web!

Back to Blog