[FIX] Issue with permalinks and subdirectories #216

Closed
christianhellsten opened this Issue Sep 17, 2010 · 3 comments

Comments

Projects
None yet
4 participants
@christianhellsten
Contributor

christianhellsten commented Sep 17, 2010

With this template file and Jekyll 0.6.2 and 0.7.0:


---
layout: default
title: xxx
permalink: /xxx/index.html

---

Hello

I get this error:

gems/jekyll-0.7.0/bin/../lib/jekyll/page.rb:114:in `initialize': No such file or directory - /tmp/xxx.com.git/_site/xxx/index.html (Errno::ENOENT)
        from gems/jekyll-0.7.0/bin/../lib/jekyll/page.rb:114:in `open'
        from gems/jekyll-0.7.0/bin/../lib/jekyll/page.rb:114:in `write'
        from gems/jekyll-0.7.0/bin/../lib/jekyll/site.rb:156:in `write'
        from gems/jekyll-0.7.0/bin/../lib/jekyll/site.rb:155:in `each'
        from gems/jekyll-0.7.0/bin/../lib/jekyll/site.rb:155:in `write'
        from gems/jekyll-0.7.0/bin/../lib/jekyll/site.rb:78:in `process'
        from gems/jekyll-0.7.0/bin/jekyll:150
        from bin/jekyll:19:in `load'
        from bin/jekyll:19

It works if I change the permalink to this:

permalink: /xxx/

However, this doesn't help if you want the permalink to be something other than /xxx/index.html; index.html is the default filename specified on line 114 in lib/jekyll/page.rb

This branch contains a fix that allows you to specify any permalink you like:
http://github.com/christianhellsten/jekyll/tree/fix_permalink

The fix makes it possible to use, for example, these permalinks:
permalink: /xxx/
permalink: /xxx/index.html
permalink: /xxx/about.html

@parkr

This comment has been minimized.

Show comment Hide comment
@parkr

parkr Dec 8, 2012

Member

The reason index.html was specified as the default filename is so that we could use directories instead of direct filenames (taking advantage of the default filename fetched by the servers). I don't think we'd want what you're proposing. Use a page!

Member

parkr commented Dec 8, 2012

The reason index.html was specified as the default filename is so that we could use directories instead of direct filenames (taking advantage of the default filename fetched by the servers). I don't think we'd want what you're proposing. Use a page!

@koriroys

This comment has been minimized.

Show comment Hide comment
@koriroys

koriroys Mar 13, 2013

@parkr Can this be closed?

@parkr Can this be closed?

@parkr parkr closed this Mar 13, 2013

@parkr

This comment has been minimized.

Show comment Hide comment
@parkr

parkr Mar 13, 2013

Member

God love you, @koriroys.

Member

parkr commented Mar 13, 2013

God love you, @koriroys.

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.