Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Copy the page-meta-links.html file from docsy to the local directory
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRLee authored and Ian Lewis committed Dec 3, 2019
1 parent eecdc5b commit 57907f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions layouts/partials/page-meta-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ if .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 }}
{{ if and ($gh_subdir) (.Site.IsMultiLingual) }}
{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $.Path }}
{{ else if .Site.IsMultiLingual }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
{{ else if $gh_subdir }}
{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $.Path }}
{{ 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>
<a href="{{ $issuesURL }}" target="_blank"><i class="fab fa-github fa-fw"></i> {{ T "post_create_issue" }}</a>
{{ if $gh_project_repo }}
{{ $project_issueURL := printf "%s/issues/new" $gh_project_repo }}
<a href="{{ $project_issueURL }}" target="_blank"><i class="fas fa-tasks fa-fw"></i> {{ T "post_create_project_issue" }}</a>
{{ end }}
</div>
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions themes/docsy/layouts/partials/page-meta-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{{ 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 }}
{{ if and ($gh_subdir) (.Site.IsMultiLingual) }}
{{ if and ($gh_subdir) (.Site.Language.Lang) }}
{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $.Path }}
{{ else if .Site.IsMultiLingual }}
{{ else if .Site.Language.Lang }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
{{ else if $gh_subdir }}
{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $.Path }}
Expand Down

0 comments on commit 57907f8

Please sign in to comment.