From 4228ab86b1094ca5be26ae4a8852b638c38f71a5 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Thu, 3 Nov 2016 08:32:11 +0100 Subject: [PATCH] Added: support of text, textile, text2tags, asciidoc file extensions for clean urls Ref #852 --- src/_utils/urlify/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/_utils/urlify/index.js b/src/_utils/urlify/index.js index 6f77cfac2..289be900c 100644 --- a/src/_utils/urlify/index.js +++ b/src/_utils/urlify/index.js @@ -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)