Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Hugo + Gulp boilerplate that powered the Forestry.io site, with PostCSS, Webpack, BrowserSync, and Algolia search.
Forestry.io Website is an open-source Hugo + Gulp boilerplate that was used to build the Forestry.io documentation, blog, and marketing site. It combines the Hugo static site generator with a Gulp asset pipeline, giving you a production-ready foundation for building fast content sites.
The Forestry.io Website is a starter repository that wraps Hugo with Gulp as an asset pipeline, compiling CSS, SCSS, JavaScript, and images into a deployable static site. It takes Markdown content from the hugo/content/ directory and source files from src/, then outputs a production build to dist/. The project runs on Node (with NPM) and was originally developed by the Forestry.io team for their own website.
This boilerplate bundles the following build tools and integration points directly into the template:
hugo/, with site-wide settings in config.toml.gulpfile.babel.js.src/css/ and src/scss/, while Webpack with Babel compiles ES6 JavaScript from src/js/; configuration lives in postcss.config.js and webpack.config.js.src/img/ are optimized and compressed into hugo/static/img/ for use in layouts and content.src/img/ are combined into a single sprite at hugo/static/svg/sprite.symbol.svg, referenced via a Hugo partial.npm start launches a development server at http://localhost:3000/ with live CSS/JS injection and automatic page reloads; npm run preview serves the production build.list.algolia.json) and an OpenSearch definition (list.opensearch.xml) for any section configured in front matter.npm run eslint and npm run stylelint commands plus :fix variants.Three groups get the most out of this repository:
You can repurpose this template for several concrete workflows:
outputs: algolia and outputs: opensearch in front matter; the included layouts generate the search index and browser-discoverable search definition.outputs: redirects to a section's front matter, using Hugo aliases plus the custom Redirects output format.require()/import in src/js/, use SCSS or plain CSS imports, and let the build optimize images and produce an SVG sprite automatically.After cloning the repository, run npm install to install Hugo and all Node dependencies. Use npm start for local development with BrowserSync at http://localhost:3000/, npm run preview to view the production build locally, and npm run build to generate the production site into dist/. The build is self-cleaning, removing dist/ and .tmp/ on each run to keep output current.
Here are quick answers to common questions about this template:
The repository is publicly available on GitHub, so you can clone it, modify it, and use it as a starting point for your own static site without license fees.
It uses Hugo, with Gulp acting as the asset pipeline. Hugo builds the HTML from Markdown content and layouts, while Gulp processes CSS, JavaScript, and images.
Run npm install once, then npm start. This launches a BrowserSync server at http://localhost:3000/ with automatic CSS/JS injection and page reloads when content changes.
Yes. The template ships with custom Hugo output formats for Algolia and OpenSearch. Adding the relevant outputs values to a section's front matter generates a searchable JSON index and an OpenSearch definition.
Yes. Environment variables can be placed in .env.js (use .env.js.stub as a reference). The HUGO_ENV variable is exposed to templates, with values development, production, or staging for Forestry previews.
