12.9. Autogenerated Document Titles
Problem
You want to have the description of HTML files autogenerated.
Solution
Place the following in the <Directory> scope where you want to have descriptions automatically loaded from the <Title> tags of HTML files:
IndexOptions ScanHTMLTitles
Discussion
If generating a directory listing of a directory full of HTML files, it is often convenient to have the titles of those documents automatically displayed in the description column.
The ScanHTMLTitles option has mod_autoindex look in each HTML file for the contents of the <Title> tag, and use that value for the description.
This process is, of course, rather file-access intensive, and so will cause a significant performance degradation proportional to the number of HTML files that are in the directory.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access