I’ve got a lot of content in folders like /<topic>/<sub category>/year/<topic-title> (eg /food/cake/2016/chocolate/and I’m wondering how I get index pages for subtopic and year generated?
I can get one generated for /<topic>/ by creating one for the type in /layouts/indexes/<topic>.html. I understand its likely got something to do with taxonomies but I’ve got no idea how to use them to be honest!
for /F %%A in ('dir %1 /B') do (
for /f "tokens=2 delims=:" %%I in ('type "%1\%%A" ^|findstr /B title:') do (echo - ^[%%~I^]^(%%~nA^/^) >>"%1\index4list.md")
)
pause
It should be placed at C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\SendTo\dir2index.cmd
And run through the right mouse button, select the folder and right-click send to>dir2index.cmd
pushd "%~1"
if exist index.md (
rename index.md index.%date:.=%.bak
)
for /f %%A in ('dir /a-d/b "*.m*"') do (
for /f "tokens=1* delims=:" %%B in ('type "%%A"^| findstr /b title:') do (
for /f "tokens=*" %%D in ("%%C") do (
for /f "delims='" %%E in ("%%~D") do (
echo - [%%E](%%~nA/^)>>index.md
echo.>>index.md
)
)
)
)
pause
For list of subfolders like ‘article1/index.md’
subdir2list.cmd
pushd "%~1"
if exist index.md (
rename index.md index.%date:.=%.bak
)
for /f %%A in ('dir /ad/b') do (
for /f "tokens=1* delims=:" %%B in ('type ".\%%A\index.md" ^|findstr /B title:') do (
for /f "tokens=*" %%D in ("%%C") do (
for /f "delims='" %%E in ("%%~D") do (
echo - [%%E](%%~nA/^)>>index.md
echo.>>index.md
)
)
)
)
pause
I’m having the same issue. I’m not sure it’s possible, since top-level folders are treated in a special way as sections. The only sort-of work-around that I’m finding is to create a file with the same name as the folder. So, if you want an index page for 2016, create 2016.md and manually create the list.
I would like to see this feature become available. Seems like it should be possible.