       data.categories = (data.categories or []).concat directoryCategories
     # Calculate the permalink
     data.url = getPermalink slug, data, config.permalink
+    # Use permalink as unique ID
+    data.id = data.url
 
     data.content = content
 

        # Use path as ID since it should be pretty stable
        data.id = data.path
        # Use filepath as URL at first (gets changed during output)
        data.url = data.path
        if config.pretty_urls
          data.url = helpers.stripExtension file

        data.content = content


    newExt = result.ext or page.ext
    paginator = page.paginator or {}

    # Pretty URLs don't get extensions
    if config.pretty_urls and newExt is '.html'
      page.url = helpers.stripExtension page.url
    else if newExt isnt ext
      # Update page url with new extension
      page.url = (helpers.stripExtension page.url) + newExt


    # Strip out index.html
    if path.basename(page.url, '.html') is 'index'
