Pr0dt0s / obsidian-html-server

Obsidian plugin to serve a vault as an html site.
GNU General Public License v3.0
81 stars 4 forks source link

Server answers only when there is no file loaded #7

Closed Djyp closed 1 year ago

Djyp commented 1 year ago

I'm using the plugin on Linux. I can start the server, I can get to the index page if I don't set any index file.

If I write a path to a file in the URL or if I select and index file, the server does not answer.

On the dev console, I get this error on each request from the client :

plugin:html-server:317 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'set')
    at yl.renderHtmlFromMarkdown (plugin:html-server:317:8033)
    at eval (plugin:html-server:317:26888)
    at async eval (plugin:html-server:317:19698)

I understand that it cannot render the file, maybe ? I'm not sure how my OS could influence on the issue. I tried changing the theme to the default one but it didn't help. EDIT : I also tried in another vault and tried with no other plugin than this one in case there'd be a conflict somewhere

Pr0dt0s commented 1 year ago

Hello @Djyp,

Could you please test changing the following:

  1. Testing a file with a path that doesn't contain any spaces or charachters that would need to be URL encoded, for example a file named test.md in the root of your vault.
  2. Test all the options for the default viewing mode (Editting View - Live Preview, Edit View - Source mode and Reading View).

In the meantime I am goind to look up into the problem.

Djyp commented 1 year ago

I already used only files with simple names like README.md or Start.md. My test.md didn't change much.

But using the Reading view by default fixed the problem. I don't know if you can fix this because it forces me to use the Reading view by default on my whole vault. But at least it's working now :grin:

Just weirdly, my banner and custom css are not showing on the navigator but that's another issue

Pr0dt0s commented 1 year ago

@Djyp I just released a new minor version that should fix this error.

Please let me know if everything is working as intended after updating.

Djyp commented 1 year ago

It is ! It's not perfect but the server shows the Reading view and my Obsidian is set to show the Editing view by default 🎉

Thank you for that :)

Pr0dt0s commented 1 year ago

Im really glad you liked it!

If you find any other issue or would like to submit a feature request fell free to open a new issue.