ryanlelek / Raneto

Markdown powered Knowledgebase Wiki for Node.js
https://raneto.com
MIT License
2.79k stars 447 forks source link

Strange 'undefined' in "Edit" link #378

Open Gaibhne opened 2 years ago

Gaibhne commented 2 years ago

When I click on the edit checkbox, I am forwarded to a (naturally not working) link that looks like this:

https://my.domain.comundefined/SomeFolder/SomeArticle/edit

The slashes are pasted above as they are, the undefined attaches directly to the .com of the domain.

In my config, I have both parameter that seem relevant set:

  base_url: 'https://my.domain.com',
  path_prefix: '',

Normal browsing my my articles works perfectly fine, both the main category as well as subcategories.

Vorsku commented 2 years ago

I had this exact symptom but the fix for me was that I was missing the path_prefix in my config, even though I don't use a path, so I just had to add path_prefix: '',

I also have nowrap: true, which you don't seem to have? Might be worth a try.

The only other thing I can say is that 'undefined' just seems to be a missing variable in the config file, so check it against the default config file in the repo and see if you're missing any in yours.

anantone commented 2 years ago

Same problem here. Any luck solving it?

ryanlelek commented 2 years ago

Thanks for reporting.

If you've upgraded the Raneto package recently, there might have been a config change. It depends how long you've been using Raneto, as earlier versions may have issues.

Try comparing your config and files to this example repo https://github.com/raneto/example Here's the config file in particular https://github.com/raneto/example/blob/master/config/config.js

If you are comfortable sharing your config, I can look at it and help

And I'd also suggest moving your content to the new file structure. It's a much simpler and hides most of the Raneto inner workings so you can focus on your content This wont work well if you made custom edits to the theme. IF you're using the default it should work fine

New structure

anantone commented 2 years ago

Hi @ryanlelek, thanks for following up. I installed Raneto yesterday using image linuxserver/raneto:0.17.2 with CapRover one-click install (on an Ubuntu VPS). Config file is default, I just added a site title and contact email from fresh install.

What happens is: if I add anything as "base_url", I get an error "Cannot GET /" at startup. If I leave "base_url" blank, everything works fine except when wanting to edit a file, "undefined" gets added to the link as described above. Manually removing it loads the edit page properly, so it's really a matter of the url.

Hopefully, you can shed some light on why this happens. Thanks again.

Gaibhne commented 2 years ago

I can confirm that I also experienced exactly what @anantone described, but unfortunately, I no longer have my config file, as I moved on to another personal Wiki due to the (possibly only perceived) inability to have a category hierarchy. Sorry.