Browse files

--multiviews flag to not use .html in post links. For use with Apache…

… "Options +MultiViews".
  • Loading branch information...
henrik committed Apr 23, 2009
1 parent 5f7bd00 commit 1d42b39f70415fc69f80e6736649bc570ff4e2cb
Showing with 18 additions and 2 deletions.
  1. +9 −0 README.textile
  2. +5 −1 bin/jekyll
  3. +4 −1 lib/jekyll/post.rb
@@ -217,6 +217,15 @@ date parts and post name will be made and an index.html will be placed in the
leaf directory resulting in URLs like 2008/11/17/blogging-like-a-hacker/.
$ jekyll --permalink [date|none|pretty]
Another way to leave off the .html is to configure Apache with 'Options +MultiViews'.
Just link to pages without the extension (and without a trailing slash, like '/about').
Then tell Jekyll not to add '.html' when linking to blog posts, like so:
$ jekyll --multiviews
Note that this has no effect with '--permalink pretty' since that makes an index.html
file in a directory.
h3. Permalink Date Format
@@ -55,7 +55,11 @@ opts = do |opts|
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
options['permalink'] = style unless style.nil?
opts.on("--multiviews", "Don't use .html in links since Apache has 'Options +MultiViews'") do |style|
options['multiviews'] = true
opts.on("--permalink-date [FORMAT]", 'A strftime type format string. No times. (default format %Y/%m/%d)') do |format|
options['permalink_date'] = format unless format.nil?
@@ -123,7 +123,7 @@ def permalink
# Returns <String>
def url
ext = == :pretty ? '' : '.html'
ext = (site.permalink_style == :pretty || site.config['multiviews']) ? '' : '.html'
permalink || + ext
@@ -214,6 +214,9 @@ def write(dest)
if == :pretty
path = File.join(path, "index.html")
# Ensure .html extension even if URL doesn't have it, e.g. with --multiviews.
path.sub!(/(\.html)?$/, '.html')
end, 'w') do |f|

0 comments on commit 1d42b39

Please sign in to comment.