Skip to content

Commit

Permalink
Merge pull request #163 from ThomasMPorter/patch-1
Browse files Browse the repository at this point in the history
Add fix for Windows formatted path values
  • Loading branch information
LisaFC authored Dec 18, 2019
2 parents 6523dd9 + 2537897 commit f060b79
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions layouts/partials/page-meta-links.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{{ if .Path }}
{{ $pathFormatted := replace .Path "\\" "/" }}
{{ $gh_repo := ($.Param "github_repo") }}
{{ $gh_subdir := ($.Param "github_subdir") }}
{{ $gh_project_repo := ($.Param "github_project_repo") }}
{{ if $gh_repo }}
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
{{ $editURL := printf "%s/edit/master/content/%s" $gh_repo .Path }}
{{ $editURL := printf "%s/edit/master/content/%s" $gh_repo $pathFormatted }}
{{ if and ($gh_subdir) (.Site.Language.Lang) }}
{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $.Path }}
{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $pathFormatted }}
{{ else if .Site.Language.Lang }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) $pathFormatted }}
{{ else if $gh_subdir }}
{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $.Path }}
{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $pathFormatted }}
{{ end }}
{{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (htmlEscape $.Title )}}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
Expand Down

0 comments on commit f060b79

Please sign in to comment.