Hugo does not copy dot directories

Hello,

I’m new to hugo and this forum so first: thanks for your work !

What I did
I created a new project from quickstart guide:

hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml

So I have no exclusion rule in my config.toml file.

Then I added a page and some images as content following this content organisation

mkdir -p content/pages/test1
mkdir -p content/pages/test1/.lol
mkdir -p content/pages/test1/foo
echo > content/pages/test1/index.md <<EOF
---
title: "My First Post"
date: 2022-11-20T09:03:20-08:00
---
## Test first post
![](.lol/truc.jpg)
![](foo/truc.jpg)
EOF

(I put truc.jpg In both .lol and foo directories)

Then I ran hugo command.

What hugo did
Hugo copied the foo directory but not the .lol

$ ls -A public/pages/test1/
foo  index.html

What I expected
I’d like hugo to copy the .foo directory too because it contains my shiny picture! I can’t find any documentation about dotfiles or dotdir exception in the documentation.

Is this a bug or a feature? Is Hugo supposed to copy the dotdir in the public directory ?

My hugo version: hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended

Thanks for your time :heart:

Why do you use a hidden directory to store your shiny picture? If there’s no technical requirement (which one would that be?), why not simply use lol as a directory name?

There is a technical requirement, otherwise I would have renamed it :wink:
My markdown editor is putting attachments like pictures in dotdirs…

Hugo does not copy dot directories

This is functioning as designed. Hidden files and directories are… hidden.

The only exception that I am aware of is the static directory to accommodate subdirectories such as .well-known.

My markdown editor is putting attachments

I suggest you reconfigure your editor.

Thanks for your answer :slight_smile:

Is it possible to add exception ? In config.toml or elsewhere ?

I’d really like to, but it is a nextcloud server that I do not control :confused:, Again, I wouldn’t bother you with my questions if I had a workaround…

You could try using links to the dot directories. Or move to a different editor – there’s enough choice out there.
These products that try to make things “easy” by using archives or dot directories for images are not best suited to work with Hugo.

I tried creating a symlink lol.lol but hugo ignored it.