Interpolated editURL?

Hi folks,

The CMS I am using seems to use a URL structure like this for editing individual pages:


Is there an way to set editURL in config.toml (or elsewhere) to something like that? Specifically the challenge is incorporating the appropriate category (subdirectory off of content/ in my hugo file tree) into the middle of the path for the URL.

Thanks in advance for your advice!

I don’t think you can create an editURL configuration variable that specifies the pattern for the edit URLs that your CMS uses. That’s something your CMS should do, not Hugo.

You can of course generate an edit URL on each page, but that’s simply building an URL pattern there. And not based on that custom configuration variable.

Subdirectories of the /content/ folder make up a ‘section’ in Hugo. See sections for what they are and how they work.

There are also nested sections (for subdirectories inside the first-level subdirectory of /content/). Bep made an example website for that here, and here you can explore the code of that example website.

Hope this helps.