Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Added: support of text, textile, text2tags, asciidoc file extensions …
Browse files Browse the repository at this point in the history
…for clean urls

Ref #852
  • Loading branch information
MoOx committed Nov 3, 2016
1 parent 2909764 commit 4228ab8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/_utils/urlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ export default function urlify(
url = url.replace(/\\/g, "/")

url = url
// something/index.md => something
// something/index.markdown => something
.replace(/\bindex\.(md|markdown)$/, "")
// something-else.md => something-else
// something-else.markdown => something-else
.replace(/\.(md|markdown)$/, "")
.replace(
/\.(md|markdown|txt|tex|textile|t2t|asciidoc|asc|adoc)$/, ""
)

// something/index.md => something
// something/index.markdown => something
.replace(
/\bindex$/, ""
)

// if url is not and html file, we will tweak it a little bit depending on the
// length wanted (full url or folder url)
Expand Down

0 comments on commit 4228ab8

Please sign in to comment.