Setting Up a Simple Github Pages Jekyll Blog
by Google Gemini
The “No Software” Solution
The absolute simplest software you can use is none at all. Because your goal is to write directly in GitHub’s web-based Markdown editor, you can rely entirely on GitHub Pages’ built-in processing engine (Jekyll). You do not need to install any frameworks, static site generators, or command-line tools.
Here is the exact setup to achieve your browser-only workflow.
Phase 1: Repository Setup
- Create the Repository: Go to GitHub and create a new public repository named exactly
your-username.github.io. - Enable Pages: Go to the repository’s Settings > Pages. Ensure the build source is set to Deploy from a branch and select your
mainbranch. - Establish the Homepage: To display a list of your articles, create a file named
index.htmlin the root of your repository and paste this minimal code:
<!DOCTYPE html>
<html>
<body>
<h1>My Blog</h1>
<ul>
{% for post in site.posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</body>
</html>
- Create the Posts Directory: Create a new folder in your repository named
_posts. GitHub requires this specific folder name to automatically recognize and render your articles.
Phase 2: Cloudflare DNS Configuration
To route your custom domain through Cloudflare to GitHub Pages, you need to configure your DNS records.
- Log in to Cloudflare and navigate to your domain’s DNS settings.
- Create A Records: Add four separate A records for your apex domain (e.g.,
yourdomain.com). Set the Name to@and point them to GitHub’s IP addresses:185.199.108.153185.199.109.153185.199.110.153185.199.111.153
- Create a CNAME Record: Add a CNAME record for the
wwwsubdomain. Set the Name towwwand the Target toyour-username.github.io. - SSL/TLS Settings: Navigate to Cloudflare’s SSL/TLS tab and set the encryption mode to Full (Strict). This ensures secure end-to-end communication.
- Add Domain to GitHub: Go back to your GitHub repository’s Settings > Pages. Under the “Custom domain” section, enter your domain (e.g.,
yourdomain.com) and click Save. GitHub will automatically generate aCNAMEfile in your repository.
Phase 3: Publishing with Base64 Images
You are now ready to publish entirely through the web interface.
- Write an Article: Inside your
_postsfolder on GitHub, click Add file > Create new file. - Name the File: You must use this strict naming convention for the engine to process it as a blog post:
YYYY-MM-DD-title-of-post.md(e.g.,2026-06-19-my-first-post.md). - Add Front Matter: At the very top of the Markdown editor, add a simple YAML block to define the title of the article:
---
title: "My First Post"
---
- Embed Base64 Images: Write your content using standard Markdown. When you need to insert your base64 encoded image, use the standard Markdown image syntax, replacing the traditional URL with the base64 data string.
Syntax:

Important Note: Base64 strings are massive blocks of text. It is highly recommended to aggressively compress your images before encoding them. Otherwise, your Markdown file will become incredibly long, sluggish, and difficult to edit inside the browser.
- Publish: Click Commit changes. GitHub’s background processes will automatically build and publish your new article to your custom domain within a minute or two.
Phase 4: Google Analytics:
To add modern Google Analytics (GA4) to the Hacker theme using only the GitHub web interface, you will use the theme’s built-in header override feature.
While some newer themes allow you to simply drop an ID into your _config.yml, Hacker’s default configuration was built for an older version of Google Analytics that is now deprecated. Injecting the raw HTML snippet directly into a custom include file ensures your tracking works perfectly with Google’s latest standards.
Step 1: Get your Tracking Snippet
- Create a property in your Google Analytics account.
- Navigate to your Web Stream Details.
- Copy the entire Global site tag (gtag.js) HTML snippet. It will look something like this:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Step 2: Inject it into GitHub
- Open your repository on GitHub.
- Click Add file > Create new file.
- In the file name box, type
_includes/head-custom-google-analytics.html. (Note: Typing the forward slash/will automatically create the_includesfolder for you). - Paste your exact Google Analytics HTML snippet into the main text area.
- Click Commit changes.
GitHub’s background engine will rebuild your site and automatically inject this tracking script into the <head> of your homepage and every single blog post you publish. You should start seeing live traffic data in your Google Analytics dashboard within a few minutes of your next deployment.