From d607c7864428d76ebf019eade1a6548e390b1bbe Mon Sep 17 00:00:00 2001 From: "Zak B. Elep" Date: Mon, 4 Sep 2017 17:09:33 +0800 Subject: [PATCH] Link to non-raw GitHub page, with edit link Let the pod6 docs link to their non-raw GitHub pages, so visitors can see and maybe help out on improving some more. And for convenience, also provide an edit link. There's probably some more improvement to do on the footer as well; will further work on separate commits/PRs. --- lib/Pod/Htmlify.pm6 | 6 +++++- template/footer.html | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Pod/Htmlify.pm6 b/lib/Pod/Htmlify.pm6 index 9050bc8dc..4e2543e21 100644 --- a/lib/Pod/Htmlify.pm6 +++ b/lib/Pod/Htmlify.pm6 @@ -93,14 +93,18 @@ sub footer-html($pod-path) is export { my $footer = slurp 'template/footer.html'; $footer.subst-mutate(/DATETIME/, ~DateTime.now.utc.truncated-to('seconds')); my $pod-url; + my $edit-url; my $gh-link = q[perl6/doc on GitHub]; if $pod-path eq "unknown" { $pod-url = "the sources at $gh-link"; + $edit-url = ""; } else { - $pod-url = "$pod-path\ from $gh-link"; + $pod-url = "$pod-path\ from $gh-link"; + $edit-url = "Edit this page\."; } $footer.subst-mutate(/SOURCEURL/, $pod-url); + $footer.subst-mutate(/EDITURL/, $edit-url); state $source-commit = qx/git rev-parse --short HEAD/.chomp; $footer.subst-mutate(:g, /SOURCECOMMIT/, $source-commit); diff --git a/template/footer.html b/template/footer.html index 60cc67294..1021e18c3 100644 --- a/template/footer.html +++ b/template/footer.html @@ -4,6 +4,7 @@ Generated on DATETIME from SOURCEURL, commit SOURCECOMMIT. This is a work in progress to document Perl 6, and known to be incomplete. + EDITURL Please report any issues. Your contribution is appreciated.