benschwarz / bonsai

A tiny static web site generator
http://tinytree.info/
MIT License
297 stars 39 forks source link

Index is created both as a directory and as /index.html #9

Closed dgoodlad closed 9 years ago

dgoodlad commented 14 years ago

The index page should only exist as /index.html. Right now, Bonsai generates /index.html AND /index/index.html. Both are put into the sitemap.xml as well. This is bad for all sorts of reasons.

http://github.com/benschwarz/bonsai/blob/master/lib/bonsai/sitemap.rb#L16 was identified as the source for it going into the sitemap (checking === '/index' is wrong, as permalinks have trailing slashes now).

robinpokorny commented 14 years ago

The easiest way how to solve it is to make /index.html redirect to /index/index.html. That could be done by:

/index.html:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

That would be a logical solution, however the best one is not to generate /index/index.html at all.