|
|
|
|
@ -26,11 +26,13 @@ |
|
|
|
|
{{ range $key, $val := . }} |
|
|
|
|
{{ $branch := $val.branch | default "master" }} |
|
|
|
|
{{ $.Scratch.Set "__repo_updated_time" "" }} |
|
|
|
|
{{ if (findRE "github\\.com" $val.source) }} |
|
|
|
|
{{ $github_source := findRE "github\\.com" $val.source }} |
|
|
|
|
{{ $gitlab_source := findRE "gitlab\\.com" $val.source }} |
|
|
|
|
{{ if $github_source }} |
|
|
|
|
{{ $repo := replaceRE "^.*github\\.com/([^/]+/[^/]+).*" "${1}" $val.source }} |
|
|
|
|
{{ $repo_json := getJSON (printf "https://api.github.com/repos/%s/branches/%s" $repo $branch) }} |
|
|
|
|
{{ $.Scratch.Set "__repo_updated_time" (index (index (index (index $repo_json "commit") "commit") "committer") "date") }} |
|
|
|
|
{{ else if (findRE "gitlab\\.com" $val.source) }} |
|
|
|
|
{{ else if $gitlab_source }} |
|
|
|
|
{{ $repo := replaceRE "^.*gitlab\\.com/([^/]+/[^/]+).*" "${1}" $val.source }} |
|
|
|
|
{{ $repo_json := getJSON (printf "https://gitlab.com/api/v4/projects/%s/repository/branches/%s" ($repo | replaceRE "/" "%2F") $branch) }} |
|
|
|
|
{{ $.Scratch.Set "__repo_updated_time" (index (index $repo_json "commit") "committed_date") }} |
|
|
|
|
@ -39,8 +41,16 @@ |
|
|
|
|
{{ $org_dir := $val.org_dir | default "" | replaceRE "/$" "" }} |
|
|
|
|
{{ if (findRE "\\.org$" $val.source) }} <!-- If the "source" is direct link to an Org file --> |
|
|
|
|
{{ $.Scratch.Set "__org_src" $val.source }} |
|
|
|
|
{{ else }} |
|
|
|
|
{{ else if (or $github_source $gitlab_source) }} |
|
|
|
|
{{ $.Scratch.Set "__org_src" (printf "%s/tree/%s/%s" ($val.source | replaceRE "/$" "") $branch $org_dir) }} |
|
|
|
|
{{ else }} |
|
|
|
|
<!-- Example: https://www.kengrimes.com/gitweb/?p=kengrimes.com/content.git;a=tree;f=content;hb=refs/heads/master |
|
|
|
|
$val.source = https://www.kengrimes.com/gitweb/?p=kengrimes.com/content.git |
|
|
|
|
$org_dir if non-nil will be used as f=$org_dir |
|
|
|
|
$branch = master |
|
|
|
|
--> |
|
|
|
|
{{ $folder_switch := (cond (eq "" $org_dir) "" (printf ";f=%s" $org_dir)) }} |
|
|
|
|
{{ $.Scratch.Set "__org_src" (printf "%s;a=tree%s;hb=refs/heads/%s" ($val.source | replaceRE "/$" "") $folder_switch $branch) }} |
|
|
|
|
{{ end }} |
|
|
|
|
<tr> |
|
|
|
|
<td>{{ $val.author }}</td> |
|
|
|
|
|