jekyll: use repo default branch for edit url of remote resources

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-05-23 20:55:50 +02:00
parent 977c1598ae
commit 050078c5f8
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 5 additions and 1 deletions

View File

@ -127,6 +127,7 @@ defaults:
# - src is a list of glob source paths within the remote repository
fetch-remote:
- repo: "https://github.com/docker/cli"
default_branch: "master"
ref: "20.10"
paths:
- dest: "engine/extend"
@ -145,6 +146,7 @@ fetch-remote:
- "docs/reference/commandline/dockerd.md"
- repo: "https://github.com/docker/docker"
default_branch: "master"
ref: "20.10"
paths:
- dest: "engine/api"
@ -152,6 +154,7 @@ fetch-remote:
- "docs/api/**"
- repo: "https://github.com/docker/compose-cli"
default_branch: "main"
ref: "main"
paths:
- dest: "cloud"
@ -161,6 +164,7 @@ fetch-remote:
- "!docs/architecture.md" # Compose-CLI architecture, unrelated to cloud integration
- repo: "https://github.com/distribution/distribution"
default_branch: "main"
ref: "release/2.7"
paths:
- dest: "registry/spec"

View File

@ -71,7 +71,7 @@ module Jekyll
next unless File.file?(ent.path) && File.extname(ent.path) == ".md"
# set edit url for markdown files in site config defaults
edit_url = "#{entry['repo']}/edit/#{entry['ref']}/#{file_clean}"
edit_url = "#{entry['repo']}/edit/#{entry['default_branch']}/#{file_clean}"
puts " edit_url: #{edit_url}"
site.config['defaults'] << {
"scope" => { "path" => destent.path },