
Template details
Primer
Primer is a Jekyll theme for GitHub Pages.
About this template
Primer is a Jekyll theme for GitHub Pages that turns a standard Jekyll site into a clean, GitHub-styled website with configurable title, description, download links, and Google Analytics.
What is Primer?
Primer is an official GitHub Pages theme maintained in the pages-themes organization on GitHub. It is a Jekyll theme that takes your site's configuration and content, then renders a static website with a default layout that follows the Primer design system. You can use it by adding a single remote_theme line to your _config.yml, or by installing the jekyll-theme-primer gem locally. The theme's repository includes a preview site and a documented set of customization options.
Key Features
- Remote theme installation — Use
remote_theme: pages-themes/primer@v0.6.0in_config.ymlso GitHub Pages fetches the theme automatically at build time. - Configuration variables — Set
titleanddescriptionto populate the site header; optionally enableshow_downloadsand supply agoogle_analyticstracking ID. - Custom stylesheet support — Create
assets/css/style.scssand import the theme with@import "{{ site.theme }}";, then override Sass variables before the import. - Layout and include overrides — Add custom files to
_includesfor changes like a favicon, or copy the default_layouts/default.htmlfrom the theme's repository and edit it extensively. - Google Analytics customization — Replace the theme's built-in analytics code entirely by pasting the latest snippet into
_includes/head-custom-google-analytics.html. - GitHub URL overrides — Override auto-generated links such as
site.github.zip_urlby defining equivalent keys undergithub:in_config.yml.
Who is it for?
- GitHub Pages beginners — Anyone who wants a functional Jekyll site without learning theme development; adding the remote_theme line is enough to publish.
- Open-source project maintainers — Teams that need a documentation or project landing page with GitHub-style default styling and optional download links.
- Developers customizing Jekyll themes — Users who want a simple baseline layout that can be copied into
_layoutsand modified, with documented Sass variable overrides.
What can you do with Primer?
- Launch a project site quickly — Configure the theme in minutes and rely on GitHub Pages for automatic building and hosting.
- Style with Sass overrides — Change colors, fonts, and layout rules by editing
assets/css/style.scsswith new variable values. - Add analytics tracking — Set your Google Analytics ID in the config, or drop in the newest code via the head include.
- Enable download buttons — Turn on
show_downloadsto make the theme link to archive files from your repository.
How does Primer work?
Primer works through Jekyll's theme mechanism. When you set remote_theme in your site's _config.yml, GitHub Pages pulls the theme from the pages-themes repository during each build. The theme's default layout then renders your site's title, description, and content, and it reads configuration variables from _config.yml to toggle optional features like download links and analytics.
FAQ
How do I install Primer?
Add remote_theme: pages-themes/primer@v0.6.0 to your _config.yml. If you don't already have the jekyll-remote-theme plugin in your plugins list, add it. For local development, add the github-pages gem to your Gemfile and run bundle exec jekyll serve.
Can I customize the colors and fonts?
Yes. Create a file at assets/css/style.scss and put the @import line for the theme at the top, then define your desired Sass variable values before that import. Any custom CSS you add after the import will also be included.
How do I change the layout?
For small changes like a custom favicon, add files to your local _includes folder. For larger changes, copy the theme's _layouts/default.html into your repository as /_layouts/default.html and edit the copied template to suit your needs.
Does Primer support Google Analytics?
Yes, set the google_analytics variable in _config.yml with your tracking ID. The theme includes a head include specifically for this; you can also overwrite that file with the latest Analytics code if you need a newer version.
How can I override GitHub-generated URLs?
Look at the theme's default layout to find the variable you want to override, such as site.github.zip_url. Then, in _config.yml, create a github: section and list the same property name (without site.) with the URL you want to use.















