Hey there!
I have a question I don’t know to ask to Google or search here because I don’t know if this has a name or not.
I have a folder structure like this one.
- Content
+--- Folder1
+--- index.md
+--- pictures
+--- Sub1
+--- Picture1.png
+--- Sub2
+--- Picture1.png
+--- Folder2
+--- index.md
+--- pictures
+--- Sub1
+--- Picture1.png
+--- Sub2
+--- Picture1.png
In the .md
file, I have a shortcode that can take the name of one of the subfolders to display the pictures it contains. At the moment, I’m displaying the content of each subfolder from the same index.md
file if I go to http://example.com/Folder1
.
Now, I would like to do something different. While keeping the same folder structure, I’d like to have the following behavior instead:
- If I go to
http://example.com/Folder1
, the content ofFolder1/Sub1
should be displayed - If I go to
http://example.com/Sub2/Folder1
, the content ofFolder1/Sub2
should be displayed - If I go to
http://example.com/Folder2
, the content ofFolder2/Sub1
should be displayed - If I go to
http://example.com/Sub2/Folder2
, the content ofFolder2/Sub2
should be displayed
Is this something possible with Hugo? Said a bit differently, I would like that http://example.com/
and http://example.com/Sub2/
kinda act as two different BaseURL showing two different set of pictures when I navigate. And when I’m on http://example.com/Sub2/
, clicking a link to Folder2
should bring me to http://example.com/Sub2/Folder2