Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Foam/Obsidian template using gatsby-theme-kb for publishing your knowledge base
Foam Template Gatsby Kb is a documentation template that turns a Foam or Obsidian vault of Markdown notes into a static knowledge-base website using Gatsby and the gatsby-theme-kb theme. It is a GitHub template repository, so you start by pressing the "Use this template" button and cloning your own copy into VS Code.
Foam Template Gatsby Kb is a GitHub template repository created for users of Foam (and compatible with Obsidian) who want to publish their local knowledge base as a static website. It takes Markdown notes written in a Foam workspace — including [[wiki-links]], tags, and backlinks — and compiles them into a Gatsby site. The site output is configured through _layouts/gatsby-config.js, where you set the path prefix, site title, author, and description. The core theme is gatsby-theme-kb, and the template adds plugins for code syntax highlighting with gatsby-remark-prismjs, math rendering with remark-math and rehype-katex, and copying linked static files with gatsby-plugin-copy-files-enhanced.
.vscode/settings.json.noInlineHighlight: true; you can replace it with shiki or twoslash using an example linked in the README.gatsby-plugin-copy-files-enhanced serves files from an assets directory at the absolute path /assets; additional directories can be added by duplicating the plugin config..github/workflows/Deploy.yml) builds on every push to master and publishes to the gh-pages branch; Vercel deployment instructions are also provided.inbox, foam-tips, and todo markdown files that demonstrate how wiki-links and backlinks behave.gatsby-plugin-copy-files-enhanced sections to serve images or other static files under absolute paths.Set up the template by forking it with the "Use this template" button, cloning the repo, and opening it in VS Code with the recommended extensions installed. Then edit _layouts/gatsby-config.js to change the path prefix and site metadata. To deploy, choose Vercel and set _layouts as the source directory with the Gatsby.js framework preset, or enable GitHub Pages and push to master to trigger the included GitHub Actions workflow, which builds the site to the gh-pages branch.
Pros
Cons
[[wiki-links]] do not render in the GitHub.com Markdown preview until foambubble/foam issue #16 is resolved; they work in VS Code and in the rendered GitHub Pages site.Yes. The template is a GitHub repository you can fork, clone, and deploy freely. No pricing or licensing fee is mentioned in the README. You need a GitHub account and VS Code to get started.
The repository description explicitly calls it a "Foam/Obsidian template." The gatsby-theme-kb theme and the link-reference configuration are compatible with both Foam's wiki-link syntax and Obsidian's Markdown vaults.
After enabling GitHub Pages in your repository settings with gh-pages as the source, push to the master branch. The .github/workflows/Deploy.yml workflow automatically builds the Gatsby site and adds the generated files to the gh-pages branch. The public URL will be something like https://yourname.github.io/your-repo-name/.
This is a known limitation of GitHub's Markdown preview with Foam-style wiki-links, tracked in foambubble/foam issue #16. Until that is resolved, links are generated as reference-style definitions at the bottom of each file, which work in VS Code and in the rendered site.
