Architecture of gohugoio/hugo
gohugoio/hugo is 2,110 source files holding 11,448 symbols across 38 modules, written mainly in Go, JavaScript, Shell. The largest module is docs, with 1,109 files, and 7 files are entry points into the dependency graph.
How hugo fits together
Input enters through the command layer, where commands/server.go is an entry point that starts the embedded web server used during development. hugolib/site.go holds the central site-building code that reads content and configuration and assembles the pages. The tpl directory contains the templating system that turns those pages into HTML using templates. The resources directory handles asset processing, including image handling such as resources/images/config.go, which covers conversion and other image operations. The markup directory contains code for content markup formats, and the output of the build is the static site files.
Largest modules
- docs: 1,109 files and 49,668 lines of code
- tpl: 237 files and 45,193 lines of code
- resources: 152 files and 23,687 lines of code
- hugolib: 127 files and 47,708 lines of code
- common: 108 files and 12,008 lines of code
- markup: 58 files and 9,626 lines of code
- internal: 37 files and 9,746 lines of code
- hugofs: 30 files and 3,889 lines of code
Languages
By file count: Go 896 files, JavaScript 24 files, Shell 10 files, C 3 files, Makefile 3 files, C++ 1 file.
Documentation
Repowise documents hugo in 1,685 pages generated from the source.
More on hugo: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos