Moved the index.html logic into theme.html.