metalsmith / permalinks

A Metalsmith plugin for permalinks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make index.html optional

timdp opened this issue · comments

Would it make sense to make the target filename configurable? For example, when targeting S3, it makes more sense to rename e.g. foo/bar.html to foo/bar (with a Content-Type of text/html) rather than to foo/bar/index.html. That way, you don't get the trailing slash in the URI.

Stuff like metalsmith-serve will most likely choke because of the missing extension, but extensions are basically meaningless anyway, so we should just find a way to set a default MIME type or something.

Seems that there is some mistake in code, see https://github.com/segmentio/metalsmith-permalinks/blob/master/lib/index.js#L92
As I understand author wanted to get ability to configure index file generation, but:

  1. It sets globaly, not per linkset or per file.
  2. Event if it is set to false, index.html will be generated :)

Agreed. It seems that setting permalink: false on the root index.html file does not stop permalinks from acting on it.

I was able to avoid this by placing the permalinks call later in my Metalsmith plugin stack.

This issue has been resolved in the meantime with the indexFile option.