Docly Developers
DocsUpdated 23 Oct 2026

The Folder folder

Place default files for your folders here. If a folder does not have a file with the requested name, Docly serves the one from #/Folder/ instead.

What it is

Files placed in #/Folder/ become defaults available inside every folder of your workspace. Think of it as a fallback layer: if a folder does not have a file with the requested name, the one from #/Folder/ is used. At the top level, #/Root/ is checked first, so #/Folder/ only applies there when #/Root/ has no match.

This is how you give every folder the same listing page, the same shared CSS, or the same display template — without copying the file into each folder.

Common use cases

  • Default folder index — #/Folder/Index.hash renders a listing for every folder that does not have its own index file. Request folder URLs with a trailing /; Docly redirects to it.

  • Shared assets — #/Folder/style.css is reachable as style.css inside every subfolder

  • Not display templates — a document is rendered only with #/<Schema>.hash or #/<Schema>.html (in the site or its app) or a schema template marked "Allow publish"; #/Folder/ is never searched for one

How resolution works

When Docly receives a request, it looks in this order:

  1. The document or folder at the requested path.

  2. #/Root/<the whole path> — or #/Root/<path>/Index when the path is a folder. #/Root/ mirrors the whole URL tree, not just the top level.

  3. #/Folder/<file name> — only the last part of the path. For a request for a folder, Docly looks for #/Folder/Index. This step needs the folder in the path to exist.

The first match wins, so a folder can always override a default by providing its own file with the same name. Docly does not look in parent folders — a file in /Products/ is not a default for /Products/Shoes/.

Example

A minimal #/Folder/Index.hash that lists the contents of any folder:

<!DOCTYPE html>
<html>
<head>
    <title>#docly.htmlEncode(request.foldername)#</title>
</head>
<body>
    <h1>#docly.htmlEncode(request.foldername)#</h1>
    <ul>
    #{
        for (let folder of docly.getFolders(request.folderpath)) {
            write("<li><a href=\"" + docly.htmlAttributeEncode(folder.Url) + "/\">" + docly.htmlEncode(folder.Name) + "</a></li>");
        }
        for (let file of docly.getFiles(request.folderpath)) {
            write("<li><a href=\"" + docly.htmlAttributeEncode(file.Url) + "\">" + docly.htmlEncode(file.filename) + "</a></li>");
        }
    }#
    </ul>
</body>
</html>

See The Root folder for workspace-wide defaults, and Templates & Rendering for the full template syntax.