google / docsy

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

Add support for BitBucket #1859

Open AntoineGlacet opened 4 months ago

AntoineGlacet commented 4 months ago

I have to work from Bitbucket and sadly, the Repository links feature does not work out of the box. Ideally, hugo.toml would have a section like below:

[params]
# choose between github, gitlab, bitbucket, aws codecommit,
repo_host = github 
repo_base_url = "https://github.com/google/docsy"
repo_branch = "main"
smainz commented 2 months ago

can you provide the relevant urls?

{{ $viewURL := printf "%s/src/branch/%s" .repo.url .repo_path -}}
{{ $editURL := printf "%s/_edit/%s" .repo.url .repo_path -}}
{{ $issuesURL := printf "%s/issues/new?title=%s" .repo.url (safeURL $.Title ) -}}
{{ $newPageStub := resources.Get "stubs/new-page-template.md" -}}
{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL -}}
{{ $newPageURL := printf "%s/_new/%s?%s" .repo.url (path.Dir .repo_path) $newPageQS }}
 {{ $project_issueURL := printf "%s/issues/new" .repo.project_url -}}

What does it need between the double quotes to make the correct urls?