ppeetteerrs / obsidian-zola

A no-brainer solution to turning your Obsidian PKM into a Zola site.
http://peteryuen.netlify.app/
MIT License
684 stars 138 forks source link

Bypass the landing page / netlify.toml custom config not respected (problem + possible solution) #64

Closed orditeck closed 1 year ago

orditeck commented 1 year ago

Hey there! Let me start by thanking you for the amazing work you did and sharing it with the open source community.

For my use, I thought that the landing page was an unnecessary step that was getting in the way of the actual content I wanted my visitors to start with.

I looked at the configuration options but didn't find any way to not use the landing page. I then looked at Netlify's documentation and found that the Redirect options could be a good option to not mess too much with the default behavior of this project.

However, they don't work as-is with this project:

Here's the redirection rule I was trying to add:

[[redirects]]
from = "/"
to = "/docs/readme/"
status = 301
force = true

Ny solution was to not move netlify.toml (and also not move __obsidian to remove the warning):

command = "rm -rf __obsidian __site && mkdir __obsidian && mv !(__obsidian|netlify.toml) __obsidian || true && mv __obsidian/netlify.toml netlify.toml && git clone https://github.com/ppeetteerrs/obsidian-zola.git __site && __site/run.sh"

Not sure that's the best way but I thought I'd share this dirty hack in case anyone is looking to do something similar without having to fork the whole project.

Is there a reason for netlify.toml being moved to __obsidian or is it just an oversight?

Note: this issue can be closed since its fix is sufficient.

orditeck commented 1 year ago

I ended up forking a fork 😅, I added a few features, including the ability to redirect the landing page:

Here's my fork: https://github.com/orditeck/cheap-publish

Not much documentation about my changes, you'll have to read the code. I'll eventually edit the README.