Generated .md links from ruby plugin does not work on GitHub pages

Hi everyone, I’ve been working on a project called jekyll-obsidian which as you can guess, loads an Obsidian vault directory into your Jekyll site. I just pushed it to RubyGems but immediately encountered a bunch of problems only on the live site, specifically GitHub pages.

Everything works fine locally, you can try it out on your own site with your own obsidian vault, but I came across a bunch of issues on the live deployed version of the site, like on my GitHub Page.

The main issue is my file tree generator. First, I don’t know why the data is null when generated from the live site but is generated correctly locally, for example const vaultData = '{{ site.data.obsidian_counts | escape }}';. Second of all, I don’t know why all the links generated from the file tree are moved to the site header. It’s really bizarre as to why it does this, and I even specified a collections in _config.yml to prevent .md files from being turned into html links.

If you serve your jekyll site locally with this plugin, it should look like Obsidian, but go on my website and the explorer panel is completely empty, none of the links work (because they were all converted into .html files) and get misinterpreted as page links and moved to the header, and the generated site data is null. I’m at my wit’s end and tried everything, hopefully someone here can give me some guidance. Thank you.

GH pages only works with a small number of white listed plugins so if what you have is a plugin it won’t work with regular GH pages. You probably could use it via an action or other build script though I don’t have any experience using those.

Plugins work no problem locally - but GH pages can’t allow custom plugins for security reasons I think.

Yes, it seems that a lot of forum posts are mentioning that GH are picky with what plugins they allow on github pages. However this doesn’t seem to be the case, after modifying the workflows build script to include the bundle exec jekyll build command, it still has the same problem where all the links generated by the file tree, which are links pointing to a .md file, are turned into separate html links, hence why they are all moved to the header.

The .md notes are of course the same ones that you would use to take notes in Obsidian, but I think jekyll misinterprets these are different pages. They do not have front matter which makes it all the more confusing as to why they’re being turned into html. Likewise, by clicking a note link in the header of the github.io site, you are instead send to another page, seeing how the URL has changed to reflect that of the note you clicked on. This is not intended and the goal is to only be on the permalink set by the obsidian layout.

In the local site, I only have one link to my obsidian vault, and all the notes within it are loaded in as strings to be parsed only within that permalink (ex. /blade-ballad/). I think this is more of an issue of how to tell jekyll, specifically the minima theme, to not include certain .md files or any files within a directory (ex ./vaults) and turn them into html files.

In my case, I have my Obsidian vault stored within a directory called vaults/, which when built locally, can be accessed by page index at http://127.0.0.1:4000/vaults/. However, the github.io page does not have this index page, returning a 404 when I entered https://khiemgluong.github.io/vaults/

Sorry, I’m not too familiar with how sites are built, so forgive me if these questions seem out of place.

Alright… Finally got it working. Turns out jekyll will generate html for any files that is a .md, which means all I had to do was rename the file extension to something else like .mdnote and it works.

You can also add it to the exclude section in your _config.yml and keep the .md extension.

Late response but this doesn’t work because I still need the .md files to be loaded into _site before it gets served. Excluding the directory where all the .md files are just prevents it from being loaded to the site.
The goal is to load the .md files into _site on build, but not have these .md files convert into separate site pages. It’s not excluding it from being loaded, but excluding it from being converted to pages after it is loaded.

The easiest solution I can think of is separating into 2 different repositories, being 1 for the jekyll site and the second one for the Obsidian vault, and putting the Obsidian vault in another baseurl.

If you are using github-pages gem, note that it contains jekyll-optional-front-matter as a dependency, so it automatically adds the frontmatter to markdown files. Maybe that’s why it is processing these files?

Yeah that’s likely the case, and I can’t remove it so renaming the .md file extension is my best option.

Could you explain more on your idea of using 2 separate repositories? How would I have a jekyll site repository read data from another repo storing an Obsidian vault and load its files into _site before it is built?

It is not like that, it is more like, the 2 repositories would build independently, but write to different locations at the GitHub page.

In my case, I have a template website repository and it’s sample page at https://george-gca.github.io/multi-language-al-folio/, and also my personal page repository and the page itself at https://george-gca.github.io/. Both are independent.