Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong GitInfo editURL on Windows #279

Open
reuixiy opened this issue Dec 12, 2020 · 1 comment
Open

Wrong GitInfo editURL on Windows #279

reuixiy opened this issue Dec 12, 2020 · 1 comment
Assignees
Labels
bug Something isn't working upstream
Milestone

Comments

@reuixiy
Copy link
Owner

reuixiy commented Dec 12, 2020

{{ with .Site.Params.repoEditURL }}
{{ $contentDir := (cond $.Site.IsMultiLingual (printf `/%s/` $.Site.Params.contentDir) "/content/") }}
<div class="gitinfo-item edit">
<a href="{{ . }}{{ $contentDir }}{{ $.Path }}" target="_blank" rel="noopener">
{{- partial "utils/icon.html" (dict "$" $ "name" $.Site.Params.editIcon "class" "edit-icon") -}}
{{- $.Site.Params.editText -}}
</a>
</div>
{{ end }}

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 reuixiy added the bug Something isn't working label Dec 12, 2020
@reuixiy reuixiy added this to the v4.6.0 milestone Dec 12, 2020
@reuixiy reuixiy changed the title Wrong GitInfo editURL in Windows Wrong GitInfo editURL on Windows Dec 12, 2020
@reuixiy reuixiy self-assigned this Dec 12, 2020
reuixiy pushed a commit that referenced this issue May 23, 2021
ulmefors pushed a commit to ulmefors/hugo-theme-meme that referenced this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

1 participant