From 116dbc1c09f263374df798b6b6b4211dd37253e4 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Fri, 5 Mar 2021 13:41:41 -0800 Subject: [PATCH 1/2] Override GitHub links partial --- .../layouts/partials/page-meta-links.html | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 daprdocs/layouts/partials/page-meta-links.html diff --git a/daprdocs/layouts/partials/page-meta-links.html b/daprdocs/layouts/partials/page-meta-links.html new file mode 100644 index 000000000..035a3c96d --- /dev/null +++ b/daprdocs/layouts/partials/page-meta-links.html @@ -0,0 +1,32 @@ +{{ if .Path }} +{{ $pathFormatted := replace .Path "\\" "/" }} +{{ $gh_repo := ($.Param "github_repo") }} +{{ $gh_subdir := ($.Param "github_subdir") }} +{{ $gh_project_repo := ($.Param "github_project_repo") }} +{{ $gh_branch := (default "master" ($.Param "github_branch")) }} +{{ if $gh_repo }} +
+{{ $gh_repo_path := printf "%s/content/%s" $gh_branch $pathFormatted }} +{{ if and ($gh_subdir) (.Site.Language.Lang) }} +{{ $gh_repo_path = printf "%s/%s/content/%s/%s" $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted }} +{{ else if .Site.Language.Lang }} +{{ $gh_repo_path = printf "%s/content/%s/%s" $gh_branch ($.Site.Language.Lang) $pathFormatted }} +{{ else if $gh_subdir }} +{{ $gh_repo_path = printf "%s/%s/content/%s" $gh_branch $gh_subdir $pathFormatted }} +{{ end }} +{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} +{{ $createURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }} +{{ $issuesURL := printf "%s/issues/new/choose" $gh_repo}} +{{ $newPageStub := resources.Get "stubs/new-page-template.md" }} +{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL }} +{{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS }} + + {{ T "post_edit_this" }} + {{ T "post_create_issue" }} +{{ if $gh_project_repo }} +{{ $project_issueURL := printf "%s/issues/new/choose" $gh_project_repo }} + {{ T "post_create_project_issue" }} +{{ end }} +
+{{ end }} +{{ end }} From 3a49a34b65fa4836e1fdf9fcba61230f7f75e811 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Fri, 5 Mar 2021 14:50:05 -0800 Subject: [PATCH 2/2] Update page-meta-links.html --- daprdocs/layouts/partials/page-meta-links.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/daprdocs/layouts/partials/page-meta-links.html b/daprdocs/layouts/partials/page-meta-links.html index 035a3c96d..bd55efdf3 100644 --- a/daprdocs/layouts/partials/page-meta-links.html +++ b/daprdocs/layouts/partials/page-meta-links.html @@ -23,10 +23,6 @@ {{ T "post_edit_this" }} {{ T "post_create_issue" }} -{{ if $gh_project_repo }} -{{ $project_issueURL := printf "%s/issues/new/choose" $gh_project_repo }} - {{ T "post_create_project_issue" }} -{{ end }} {{ end }} {{ end }}