# Without front matter?

**URL:** <https://talk.jekyllrb.com/t/without-front-matter/7089>\
**Category:** Uncategorized\
**Created:** [March 7, 2022, 11:57pm UTC](https://talk.jekyllrb.com/t/without-front-matter/7089 "2022-03-07T23:57:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahil627](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rahil627/32/4244_2.png) [@rahil627](https://talk.jekyllrb.com/u/rahil627)\
**Post date:** [March 7, 2022, 11:57pm UTC](https://talk.jekyllrb.com/t/without-front-matter/7089/1 "2022-03-07T23:57:41Z")

</div>

is there a way to configure Jekyll to process files _without_ front-matter? 😕

…it just seems silly to be forced to modify all of my files, instead of configuring the program…

update:  
okay, i found [jekyll-optional-front-matter](https://github.com/benbalter/jekyll-optional-front-matter), but i believe it only converts file with the file extension .md…? I use .txt 😕

_so so picky this Jekyll guy…_

update-2:

```auto
    def markdown_converter
      @markdown_converter ||= site.find_converter_instance(Jekyll::Converters::Markdown)
    end
    
    # An array of Jekyll::StaticFile's with a site-defined markdown extension
    def markdown_files
      site.static_files.select { |file| markdown_converter.matches(file.extname) }
    end

```

[reference vars](https://jekyllrb.com/docs/variables/)

and so… i believe Jekyll’s markdown “converter” (parser) has a list of file extensions it uses (.md, .markdown, etc.) in the match method function… sooo 🤔

… yeah i think i’ll just rewrite that bit:  
`site.static_files.select { markdown_converter.matches(file.extname) || file.extname == '.txt' }`

???

lol, i’ve never used Ruby, but reading that plugin, _wow… now that’s a special programming language! :o i think i’m in love…!_ lol, but that can’t be efficient!

maybe i’ll have to create a configuration option for that plugin…

update-3:  
i tried to add `include: /my-folder` (and `include: my-folder`, just in case), but nothing…

but then i realized, or remembered(?) 🤔, that my folder is a git sub-module! sooo… maybe GitHub Pages doesn’t know what to do with it! 😮 _ooohhhh nooooooo!!!_ 😭

… never-mind! [it should be fine](https://docs.github.com/en/pages/getting-started-with-github-pages/using-submodules-with-github-pages)… 🙂  
)

hmmm 🤔

update 4:

```auto
collections:
...
defaults:
   - # i hope this isn’t overriding my-notes...
    scope:
      path: "" # empty string means all files, but a '.' would be more clear...
    values:
      layout: "default" # i'm not sure how this works.., only works files with front matter, or with extension .md..?
   -
    scope:
      path: "my-notes" #or /my-notes ? or /my-notes/ ??
      type: posts #collection(-type)? why is it not a string??
    values:
      layout: "post"

```

still nothing…

update x:  
ahhhhhh hahahahaha _\*going mad\*_, i found it!

```auto
markdown_ext: "txt" # does it override, or append?

```

…but it throws an error 😭

the [default configs](https://jekyllrb.com/docs/configuration/default/) page is by far the most important i’ve seen, wish i knew about it earlier! 😭

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [March 9, 2022, 5:42am UTC](https://talk.jekyllrb.com/t/without-front-matter/7089/2 "2022-03-09T05:42:52Z")

</div>

If you want your whole to be .txt files without frontmatter, you can do that.

`index.txt`

```auto
My heading

My content 

```

Jekyll will copy each txt file to the output directory.

reasons to use frontmatter:

- converts .md to .html
- allow use of layouts for templating
- allow file processed so that Liquid is evaluated.

`index.md`

```auto
---
title: My heading
---

My content 

My site name {{ site.title }}

```

Yes the optional plugin is great. You can do this.

`index.md`

```auto
# My heading

My content

My site name {{ site.title }}

```

You’ll have to elaborate why txt is necessary for you. I’d say if you want the benefits of frontmatter in my bullet points and to use the plugin, then change your txt files to md

---

<div class="post-metadata">

**Author:** ![rahil627](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rahil627/32/4244_2.png) [@rahil627](https://talk.jekyllrb.com/u/rahil627)\
**Post date:** [March 9, 2022, 1:11pm UTC](https://talk.jekyllrb.com/t/without-front-matter/7089/3 "2022-03-09T13:11:06Z")

</div>

hmmm, but if i do use the optional plugin, doesn’t that meant it will force Jekyll to do these things?:

- converts **`.any-ext`** to .html
- allow use of layouts for templating
- allow file processed so that Liquid is evaluated.

your second bit is _exactly_ what i want, but with `.txt`.

> ```auto
> index*.txt*
> 
> # My heading
> 
> My content
> 
> My site name {{ site.title }}
> 
> ```

as for the reason, well, i don’t have a great one, but, basically, i’ve been using .txt files my whole life, and, well, they aren’t really markdown either, they have my own personal “markup”, i’d have to write my own little “converter” parser for it… but anyway, i’m not there, _yet_—that’s the next step! 🙂 . For now, i just want to just want them to display!

🤔  
…but maybe writing a converter is the way to go!.. Hmmm… i mean, my .txt files are simple, so if it went through the markdown processor, it’d be just fine… and at a certain point in life, when markdown became more prevalent, i even started using markdown for my own personal notes… so my personal notes format isn’t exactly consistent…

so then, if i can’t do what i want with the optional plugin, then i should just write a converter, and perhaps begin with using a markdown converter as a base!

thanks for the reply! I see some progress now. 🙂

_update:_

> Jekyll will copy each txt file to the output directory.

ohhh yeahhh, you’re totally right! if i go to `my-domain.tld/git-submodule-folder/file.txt `, it is indeed there! So… glad to at least know if git submodule is working! 🙂 But i can’t for the life of me get it processed 😭

also, i am not sure how i missed this one. i swear i searched! sorry. 😭  
[https://talk.jekyllrb.com/t/converting-markdown-file-without-front-matter/2071](https://talk.jekyllrb.com/t/converting-markdown-file-without-front-matter/2071)

from mmistakes:

> GitHub Pages using jekyll-optional-front-matter [as a dependency](https://github.com/github/pages-gem/blob/master/lib/github-pages/dependencies.rb#L38)

😮

update-2:

```auto
(markdown.rb)
def extname_list
        @extname_list ||= @config["markdown_ext"].split(",").map! { |e| ".#{e.downcase}" }
      end

(jeykll’s default values)
markdown_ext: "markdown,mkdown,mkdn,mkd,md"

```

surely, there’s gotta be a way to just modify `markdown_ext` from the config…? i’ll try again and actually read what the error is this time…

update-3:  
so, i think **setting `markdown_ext` in the config actually was the solution**!!! :party: … i just didn’t think it was because it threw an error, _lots of them_:

```auto
Error reading file /github/workspace/docs/my-notes/applications - iOS.txt: invalid byte sequence in UTF-8
...
x100

```

so, i’ve got some cleaning to do.

anyway, thanks again, i think it’ll be alright…
