reuixiy / hugo-theme-meme

😝 You can’t spell awesome without MemE!
https://io-oi.me/hugo-theme-meme
MIT License
1.03k stars 279 forks source link

Wrong GitInfo editURL on Windows #279

Open reuixiy opened 3 years ago

reuixiy commented 3 years ago

https://github.com/reuixiy/hugo-theme-meme/blob/e927542dbe1cb8329acfe475bcd77df2361118f8/layouts/partials/components/post-gitinfo.html#L42-L50

So in post-gitinfo.html we use .Path to combine editURL, it works well on Linux, but not working on Windows.

On Windows, .Path like foo/bar will be "converted" to foo\bar, which produces a wrong URL.

Also, we should check all usages of .Path and .Dir in MemE.

reuixiy commented 3 years ago

Notes:

  1. https://stackoverflow.com/a/40002602
  2. https://github.com/gohugoio/hugo/issues/2394
  3. https://github.com/gohugoio/hugo/issues/3187
  4. https://github.com/gohugoio/hugo/issues/4269
  5. https://gohugo.io/functions/path.base/