Attempt to create Gemini files

Hi.

I attempt to modify my actual Hugo site for huc.fr.eu.org to manage outputs for gemini files.
For this I created a specific config files: cfg.gmi.yaml (only to use with hugo command)

Egual, I made new directories, just to use with this:

  • layoutsDir: gemini-layouts/; with index.gmi and two files (for list and single) on _default dir.
  • publishDir: gemini/
  • staticDir: gemini-static/ (just empty)
    (both directories are not commit on the repository)

When I try: hugo --config cfg.gmi.yaml, the result is that it doesn’t generate any files on gemini publishDir.
Somebody can help me to understand the reason, please.


Actual git: SH-Web / Hugo / huc.fr.eu.org · GitLab
Hugo version: hugo v0.159.1+extended linux/amd64 BuildDate=2026-03-30T08:11:37Z VendorInfo=debian:0.159.1-1

I got 8 pages created for each language, after touching the following points:

  • correct the type in cfg.gmi.yaml
    changed ouputFormats: to outputFormats: (add the t)

  • addresses config overwrites
    the config folder is read, too – even if a config file is used. Guess duplicate definitions in both files will produce some conflicts so I renamed:

    • mediatypes.yamlmediatypes.yaml1
    • outputformats.yamloutputformats.yaml1
    • outputs.yamloutputs.yaml1
  • removed the usage of layouts-gemini/_defaults
    guess that has to do with the new lookup order
    moved all files from layouts-gemini/_defaults → ‘layouts-gemini/’ directly

general hints:

  • use --logLevel debug to see something more when building
  • address the deprecations (languageCode) you are on 0159.1
  • use the new layout folders and template names of the New template system in Hugo v0.146.0
  • when playing with new formats/complex config settings renaming the config to config1 and use a config file only will ease up debugging.

Thanks for all those informations!

By default, this Hugo site allows me to generate HTML files for publication on my website.

Just about config; it seems not possible to change this behaviour.
This means I have to write a script to rename the directory before generating the gemini files; (because I’m not going to bother editing the YAML files in question), and not forget to rename it correctly after generation.
Or… create another hugo site, just configure with cfg.gmi.yaml and rsync before all are into this hugo site content, before generate into this new hugo site.

I’m sceptical. :frowning:


PS: With your instructions, I can too generate files; I’m going to modify and rectify all that needs. Thanks

There’s more than one way to skin a cat :wink:

  1. use multiple config files
    specify commons in the /config/ and specials in one or two config files
    hugo --config special.toml,common.toml

  2. use dedicated configDirs and maybe a config file
    hugo [--config config-file-1.toml] --configDir config-1
    hugo [--config config-file-2.toml] --configDir config-2

  3. maybe a combination of both
    hugo --config global,special.toml --configDir config

  4. use environments

    config
    ├───_default     <- global
    ├───normal
    └───gemini
    

    and call it like as hugo --environment gemini

  5. maybe a variation combining all these …

1 Like

Very interesting!
Really, thank you. :smiley:

I tested, with success, the environments :wink:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.