Without front matter?

is there a way to configure Jekyll to process files without front-matter? :confused:

…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, but i believe it only converts file with the file extension .md…? I use .txt :confused:

so so picky this Jekyll guy…

update-2:

    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

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 :thinking:

… 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(?) :thinking:, that my folder is a git sub-module! sooo… maybe GitHub Pages doesn’t know what to do with it! :open_mouth: ooohhhh nooooooo!!! :sob:

… never-mind! it should be fine:slight_smile:
)

hmmm :thinking:

update 4:

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!

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

…but it throws an error :sob:

the default configs page is by far the most important i’ve seen, wish i knew about it earlier! :sob:

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

index.txt

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

---
title: My heading
---

My content 

My site name {{ site.title }}

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

index.md

# 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

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.

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! :slight_smile: . For now, i just want to just want them to display!

:thinking:
…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. :slight_smile:

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! :slight_smile: But i can’t for the life of me get it processed :sob:

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

from mmistakes:

GitHub Pages using jekyll-optional-front-matter as a dependency

:open_mouth:

update-2:

(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:

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…