google / docsy

A set of Hugo doc templates for launching open source content.
https://docsy.dev
Apache License 2.0
2.62k stars 904 forks source link

The "Create issue" feature should auto-include doc URL #91

Open sarahmaddox opened 5 years ago

sarahmaddox commented 5 years ago

When a user clicks Create issue on a doc page, Docsy should auto-include the relevant doc URL (or at least the path) in the created issue. Currently, Docsy includes the page title as the title of the issue, but nothing in the page body.

The Feedback widget should also include the URL of the page when a user creates an issue based on their feedback.

I got part of the way there by editing the file /docsy/layouts/partials/page-meta-links.html and adding the the issue body URL param with a value of .Permalink (or .Path) in this line:

{{ $issuesURL := printf "%s/issues/new?title=%s&body=%s" $gh_repo (htmlEscape $.Title) .Permalink }}

However, there's probably further testing required. For example, should we use .Path or .Permalink. Not all sites have their base URL set to include the domain. For example, in the Kubeflow site, our base URL is set to just a /. This affects the value of the .Path.

RichieEscarez commented 4 years ago

In Knative we add the path to the Create Issue link and also accommodate several different conditions due to the doc set versioning we have. You might be able to use some of our overrides to inspire a Kubeflow specific fix: https://github.com/knative/website/blob/master/layouts/partials/page-meta-links.html