From b672f3cf0db8b0f94ef54e765f013fb2e35c4fc8 Mon Sep 17 00:00:00 2001 From: Elouan Martinet Date: Sun, 3 Jun 2018 22:32:53 +0200 Subject: [PATCH] Add .html to archive file names without extension --- lib/jekyll-archives/archive.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-archives/archive.rb b/lib/jekyll-archives/archive.rb index b5f9492..3bd3a5b 100644 --- a/lib/jekyll-archives/archive.rb +++ b/lib/jekyll-archives/archive.rb @@ -114,7 +114,11 @@ def date # Returns the destination relative path String. def relative_path path = URL.unescape_path(url).gsub(%r!^\/!, "") - path = File.join(path, "index.html") if url =~ %r!\/$! + if url =~ %r!\/$! + path = File.join(path, "index.html") + elsif url !~ %r!\.html$! + path += ".html" + end path end