List folders (for) Last updated: 02. Feb 2023
Gets folders from a specified folder and list the sub folders.
Example
Code
#{
var folders = docly.getFolders("/"); // Get all folders in site root
var sorted = docly.sort(folders, "Name"); // Sort them by name
}#
<table>
<thead>
<tr>
<th>Name</th>
<th>Last modified</th>
</tr>
</thead>
<tbody>
#for(var item of sorted) {#
<tr>
<td>#item.Name#</td>
<td>#docly.format(item.LastModified, "dd. MMM yyyy")#</td>
</tr>
#}#
</tbody>
</table>
Output
<table>
<thead>
<tr>
<th>Name</th>
<th>Last modified</th>
</tr>
</thead>
<tbody>
<tr>
<td>Blog</td>
<td>19. Nov 2024</td>
</tr>
<tr>
<td>Guidelines</td>
<td>07. May 2024</td>
</tr>
<tr>
<td>Hash folder</td>
<td>27. Aug 2024</td>
</tr>
<tr>
<td>JavaScript</td>
<td>14. Nov 2024</td>
</tr>
<tr>
<td>JavaScript examples</td>
<td>12. Oct 2024</td>
</tr>
<tr>
<td>Schemas</td>
<td>21. Jun 2024</td>
</tr>
<tr>
<td>Templates</td>
<td>12. Oct 2023</td>
</tr>
<tr>
<td>Test files</td>
<td>17. Sep 2023</td>
</tr>
</tbody>
</table>