# Foo.md being built as Foo/index.html?

**URL:** <https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953>\
**Category:** Help\
**Created:** [September 4, 2017, 3:48pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953 "2017-09-04T15:48:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 4, 2017, 3:48pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/1 "2017-09-04T15:48:44Z")

</div>

So I’ve got a Jekyll site, it has a file called [CHANGELOG.md](http://CHANGELOG.md) in it but when I get Jekyll to build the site, instead of getting CHANGELOG.html, I get a directory called CHANGELOG containing a file called index.html.

Why, please, and how can I get Jekyll to create CHANGELOG.html?

Thanks.

---

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 4, 2017, 4:07pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/2 "2017-09-04T16:07:06Z")

</div>

OK … so it looks like this is (a) by design and (b) being triggered by the permalink behaviour:

> When you use permalinks that omit the .html file extension (called “pretty URLs”) Jekyll builds the file as index.html placed inside a folder with the page’s name.

([Permalinks | Jekyll • Simple, blog-aware, static sites](https://jekyllrb.com/docs/permalinks/))

Testing has revealed that this is being triggered because the config file says:

> permalink: /news/:title/

which omits the .html extension.

So, if I want CHANGELOG.html, is my only choice to put an overriding permalink in the front matter for that specific file, or is it possible to have another permalink defined in the config, e.g.:

> permalink: title

so that this gets used if /news/ isn’t appropriate?

Updated: yes :). If I have:

> permalink: /news/:title/  
> permalink: title

Then CHANGELOG.md gets as CHANGELOG.html.

---

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 5, 2017, 9:01am UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/3 "2017-09-05T09:01:36Z")

</div>

OK, so it turns out that this doesn’t work after all ☹ Jekyll just uses the last defined permalink.

I’ll try putting

> permalink: title

in the markdown for the individual pages. You can probably tell that I’m not particularly experienced at this 😃

---

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 6, 2017, 1:22pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/4 "2017-09-06T13:22:56Z")

</div>

I’m giving up on this. I don’t seem to be able to come up with a permalink syntax for the **file** that can be generalised, e.g. taking the title and adding .html to it.

In other words, if I use something like:

> permalink: :title.html

the page isn’t built but no errors are generated.

So I’m just going to leave the permalink out and let Jekyll go back to creating a directory with index.html inside it. I don’t like it but at least the site builds.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [September 6, 2017, 3:57pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/5 "2017-09-06T15:57:42Z")

</div>

What are you trying to accomplish? for posts you want one thing, for pages you want another? Is it just the changelog page?

I think you can set permalinks by path in the config via front matter defaults - thought I don’t see an example of it in the docs:

> **[Configuration](https://jekyllrb.com/docs/configuration/#front-matter-defaults)**
>
> Jekyll gives you a lot of flexibility to customize how it builds your site. These options can either be specified in a \_config.yml or \_config.toml file placed in your site’s root directory, or can be specified as flags for the jekyll executable in...

Did you read this section - posts are treated different than pages?

> **[Permalinks](https://jekyllrb.com/docs/permalinks/#pages-and-collections)**
>
> Permalinks are the output path for your pages, posts, or collections. They allow you to structure the directories of your source code different from the directories in your output.

---

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 6, 2017, 5:08pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/6 "2017-09-06T17:08:22Z")

</div>

@rdyar For the site I’m working on, most of the pages are being manually edited and have got their permalink manually set in each page.

There are a _few_ pages that are being ingested from elsewhere so I have very limited control over what I can do by way of front matter. For those, I’m trying to find an automatic or templated way or setting the permalink, which is why I was trying to use the title approach.

Unfortunately, I don’t seem to be able to get much in the way of diagnostics out of Jekyll as to why it is refusing to build the pages when I’m trying out some of the ideas. It just doesn’t output the pages at all but doesn’t complain either.

I might see if I can do a bit more with altering the front matter on these files but it is tricky. As the moment, leaving it to no permalink at all does give me generated pages, just as a directory and a file rather than just as a file.

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [September 6, 2017, 7:47pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/7 "2017-09-06T19:47:14Z")

</div>

I see you’ve tried `permalink: :title.html`, but have you tried it with a forward slash?

```auto
permalink: /:title.html

```

This should give you `/CHANGELOG.html` or whatever the post/page’s title is `.html`

---

<div class="post-metadata">

**Author:** ![pcolmer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pcolmer/32/446_2.png) [@pcolmer](https://talk.jekyllrb.com/u/pcolmer)\
**Post date:** [September 7, 2017, 12:54pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/8 "2017-09-07T12:54:32Z")

</div>

I think I had tried that previously and just not noted it in this thread.

That said, I have just tried it and I am back to the “no output generated, no errors reported” status.

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [September 7, 2017, 1:13pm UTC](https://talk.jekyllrb.com/t/foo-md-being-built-as-foo-index-html/953/9 "2017-09-07T13:13:09Z")

</div>

Only other suggestion I can offer is if you have a public repo we can look at to see exactly what’s going on with your `_config.yml` settings and page content.

You can also run try running the Jekyll `serve` and `build` commands with the `--verbose` flag enabled. It’ll show you more detail on the pages Jekyll is reading, writing, or skipping…

```auto
jekyll serve --verbose

```

You’ll see stuff like this in your terminal/console which may give you a clue what is the problem.

```auto
Generating...
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
           Reading: _posts/2009-05-15-edge-case-nested-and-mixed-lists.md
         Rendering: _posts/2009-05-15-edge-case-nested-and-mixed-lists.md
  Pre-Render Hooks: _posts/2009-05-15-edge-case-nested-and-mixed-lists.md
  Rendering Liquid: _posts/2009-05-15-edge-case-nested-and-mixed-lists.md
  Rendering Markup: _posts/2009-05-15-edge-case-nested-and-mixed-lists.md

```
