<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>TkMWorks TechBytes</title>
  <subtitle>How TkMWorks is designed, built and run on AWS, written up for cloud enthusiasts and aspiring cloud architects. From Bhubaneswar.</subtitle>
  <link href="https://techbytes.tkmworks.co.in/feed.xml" rel="self"/>
  <link href="https://techbytes.tkmworks.co.in/"/>
  <id>https://techbytes.tkmworks.co.in/</id>
  <updated>2026-11-25T00:00:00+00:00</updated>
  <author><name>Tushar Kanti Mishra</name></author>
  <entry>
    <title>How this blog is built</title>
    <link href="https://techbytes.tkmworks.co.in/posts/how-this-blog-is-built/"/>
    <id>https://techbytes.tkmworks.co.in/posts/how-this-blog-is-built/</id>
    <published>2026-11-25T00:00:00+00:00</published>
    <updated>2026-11-25T00:00:00+00:00</updated>
    <summary>Markdown in a private CodeCommit repository, turned into static pages by CodeBuild and shipped to S3 and CloudFront by the same build-agent pipeline that runs the rest of tkmworks.co.in.</summary>
    <content type="html">&lt;p&gt;TechBytes is the fourth site under tkmworks.co.in, after the landing page, the apps page and the websites portal. It&amp;rsquo;s also the simplest one, on purpose: no server, no database, no CMS. Just files.&lt;/p&gt;
&lt;p&gt;This post walks through how a post goes from a Markdown file on my laptop to a page you can read, and why each piece is there.&lt;/p&gt;
&lt;h2 id="writing-a-post"&gt;Writing a post&lt;a class="anchor" href="#writing-a-post" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each post is a folder in a private CodeCommit repository, holding an &lt;code&gt;index.md&lt;/code&gt; and any images it uses. The file starts with a few lines of front matter:&lt;/p&gt;
&lt;div class="hl"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;---
title: How this blog is built
date: 2026-11-25
summary: One or two sentences for the list, the feed and link previews.
tags: [aws, cloudfront]
&lt;span class="gu"&gt;draft: true&lt;/span&gt;
&lt;span class="gu"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;While &lt;code&gt;draft&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;, the post is skipped when the site is built for publishing. I can still preview it locally with &lt;code&gt;python3 scripts/build.py --drafts&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="from-markdown-to-pages"&gt;From Markdown to pages&lt;a class="anchor" href="#from-markdown-to-pages" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When I push to &lt;code&gt;main&lt;/code&gt;, a CodePipeline in the CICD account starts. Its Validate stage is a CodeBuild job that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;runs the generator&amp;rsquo;s unit tests,&lt;/li&gt;
&lt;li&gt;lints the CloudFormation template with &lt;code&gt;cfn-lint&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;turns every post into HTML with Python-Markdown and Pygments, and&lt;/li&gt;
&lt;li&gt;checks that every link and image in the output points at a real file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The generator is a single Python script of under 500 lines. It writes one &lt;code&gt;index.html&lt;/code&gt; per page, so the URLs stay clean: &lt;code&gt;/posts/how-this-blog-is-built/&lt;/code&gt;, not &lt;code&gt;/posts/how-this-blog-is-built.html&lt;/code&gt;. It also writes an Atom feed, a sitemap and a 404 page.&lt;/p&gt;
&lt;h2 id="build-once-deploy-once"&gt;Build once, deploy once&lt;a class="anchor" href="#build-once-deploy-once" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The rest is the same build-agent pattern as every other site here:&lt;/p&gt;
&lt;div class="table-wrap"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Package&lt;/td&gt;
&lt;td&gt;A Lambda function in the CICD account zips CodeBuild&amp;rsquo;s output and stores it in the shared artifacts bucket, under the commit ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approve&lt;/td&gt;
&lt;td&gt;I get an email and approve the deploy to Prod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infrastructure&lt;/td&gt;
&lt;td&gt;The agent assumes a deploy role in the Prod account and updates the CloudFormation stack through a change set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Content&lt;/td&gt;
&lt;td&gt;The agent uploads only the files that changed, removes deleted ones and clears the CloudFront cache&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Nothing in Prod is created by hand, and no laptop holds Prod credentials.&lt;/p&gt;
&lt;h2 id="serving-the-pages"&gt;Serving the pages&lt;a class="anchor" href="#serving-the-pages" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The pages sit in a private S3 bucket that only this CloudFront distribution can read, through Origin Access Control. A tiny CloudFront Function turns &lt;code&gt;/posts/some-post/&lt;/code&gt; into &lt;code&gt;/posts/some-post/index.html&lt;/code&gt; before the cache lookup, because S3 behind OAC doesn&amp;rsquo;t serve folder index pages by itself.&lt;/p&gt;
&lt;p&gt;The theme is the landing page&amp;rsquo;s: same fonts, same colour tokens, and the same Odisha-inspired theme every day across all four sites.&lt;/p&gt;
&lt;h2 id="counting-readers-without-tracking-them"&gt;Counting readers without tracking them&lt;a class="anchor" href="#counting-readers-without-tracking-them" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each page load sends one request to a small Lambda function behind &lt;code&gt;apps.tkmworks.co.in&lt;/code&gt;. It counts each visitor once a day, using a hash of the IP address and browser with a salt that changes daily. The IP address is never stored, and after two days DynamoDB&amp;rsquo;s TTL deletes the hashes and the salt. There are no cookies and no third-party scripts, and browsers that send Do Not Track or Global Privacy Control aren&amp;rsquo;t counted at all.&lt;/p&gt;
&lt;h2 id="what-it-costs"&gt;What it costs&lt;a class="anchor" href="#what-it-costs" title="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Close to nothing at this traffic. CloudFront&amp;rsquo;s free tier covers the requests, the certificate is free, and S3 storage for a few megabytes of HTML rounds to zero.&lt;/p&gt;
&lt;p&gt;The next posts go deeper into the parts this one skimmed: the multi-account landing zone underneath, the build agent, and the release pipeline behind the apps page.&lt;/p&gt;</content><category term="aws"/><category term="cloudfront"/><category term="codepipeline"/><category term="static-sites"/>
  </entry>
</feed>
