Based on Hugo Researcher which in turn is based on the Jekyll theme Researcher.
This site is prepared for Cloudflare Web Analytics.
- Cloudflare Pages automatic setup: no code changes needed, enable it in Workers & Pages → your project → Metrics → Enable.
- Manual setup: paste your token in
config.tomlunderparams.analytics.cloudflareToken.
The theme will load the Cloudflare beacon only when cloudflareToken is set.
Recommended Cloudflare Pages settings for this Hugo site:
- Production branch:
main - Build command:
hugo - Build output directory:
public - Environment variable:
HUGO_VERSION=0.161.1
Migration checklist:
- Create a Pages project from this GitHub repo in Cloudflare.
- Use the build settings above.
- Verify the generated
*.pages.devpreview works. - In Workers & Pages → your project → Custom domains, add
pablosproject.com. - Update DNS to Cloudflare when ready.
- Enable Web Analytics in the project Metrics tab.
- After traffic is serving correctly from Cloudflare, remove the Netlify site.
- Serve:
hugo server -D(-D for drafts) - Build:
hugo -D - Add a post:
hugo new posts/POST.md
This theme uses Sass to generate CSS files so make sure you have the extended Hugo version installed.
Add the theme to your site's themes directory:
git submodule add https://github.com/ojroques/hugo-researcher.git themes/researcher
# if your website is not managed by git:
# git clone https://github.com/ojroques/hugo-researcher.git themes/researcherUpdate the theme option in config.toml:
theme = "researcher"A self-explanatory configuration file is present in exampleSite/config.toml, along the files of a demo website.
You can enable KaTeX (math typesetting) by including
math: true in your content files. Or you can enable it globally by setting
math to true in your project config.
Hugo introduces tags when it sees newlines which breaks KaTeX block
environments. The theme has a math shortcode to circumvent this issue:
{{< math >}}
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
{{< /math >}}Check this issue for more details.