Tool to find broken links to assets on a Hugo site, or unused assets
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README.md
hugoasset.go

README.md

Hugo Asset Management

Introduction

This utility helps manage the static assets under the static/ subdirectory of your Hugo installation:

  • Find broken links (missing assets)
  • Find assets that are not linked to anywhere in the content so you can reclaim the disk space

It searches for <a href="...">, <img src="..." srcset="..."> and <script src="...">

Building from source

You need Go as a prerequisite (but then you need it for Hugo as well).

Git clone or extract the source code from a tarball, then run make

Usage

Just run it under your hugo directory, just as you would hugo itself. The parameter -prefix tells it what the URL prefix is for the site URLs. It assumes static assets are under static/ and output files under public/