Raneto icon indicating copy to clipboard operation
Raneto copied to clipboard

Urls generated with full file path on Windows

Open zaunaf opened this issue 8 years ago • 8 comments

This problem https://github.com/gilbitron/Raneto/issues/8 re-appears in 0.9.0.. The solution pretty much the same, in raneto-core\lib\raneto.js line number 146:

      var dir = raneto.config.content_dir.replace(/\\/g, "/");
      var shortPath = filePath.replace(dir, '').trim();

zaunaf avatar Mar 08 '16 20:03 zaunaf

Thanks zaunaf for narrowing down the issue with the file and lines. Has something to do with filepaths and we need to normalize

If someone has time this weekend, here's an article that helps. http://shapeshed.com/writing-cross-platform-node/ Please comment before you start working on it so we don't duplicate your efforts :)

ryanlelek avatar Mar 11 '16 20:03 ryanlelek

This seemed to fix it for me. Thanks. :+1:

Not sure if this is related or not, but when searching on Windows, I get Cannot read property 'excerpt' of null. Thanks for the help.

Zackery avatar Mar 17 '16 05:03 Zackery

Hello, I ran into the issue yesterday and I'd like to take it into work.

RiverSongFox avatar Apr 19 '16 08:04 RiverSongFox

I am also getting the "Cannot read property 'excerpt' of null" error message when searching an article. Line 146 mentioned above is:

slug = slug.replace('.md', '').trim();

How to apply the fix? Around line 188 I see code that addresses the shortPath:

files.forEach(function (filePath) {

  var shortPath = path.normalize(filePath).replace(content_dir, '').trim();
  var stat      = fs.lstatSync(filePath);

Is this code already supposed to account for the fix mentioned above? If so, it doesn't resolve the "Cannot read proprty 'excerpt' when searching.

gallarotti avatar Jul 03 '16 08:07 gallarotti

@gallarotti this might be another issue. Are you on the latest version of Raneto? (v0.10.1)

I'll dig into it more this weekend. Any additional info you can provide (OS, Node version, etc) would help narrow it down

ryanlelek avatar Jul 07 '16 04:07 ryanlelek

Hey @ryanlelek, I'm getting the same issue as @gallarotti. The fix supplied didn't help (or I'm doing something wrong).

OS: Win10 Pro64 Node: 4.4.7 Raneto: 0.10.1

Thanks!

ToasterBR avatar Aug 09 '16 15:08 ToasterBR

Booting a Windows 10 Pro x64 VM right now to help diagnose

ryanlelek avatar Sep 11 '16 00:09 ryanlelek

Ok, all booted up fine with these commands. I was able to browse and login

Code used is the master branch as of the time of this comment.

From project directory run:

npm install
npm run start_win

ryanlelek avatar Sep 11 '16 01:09 ryanlelek