{{- /* for repo home (default branch) and /owner/repo/src/branch/the-name */ -}} {{- $branchDropdownCurrentRefType := "branch" -}} {{- $branchDropdownCurrentRefShortName := .BranchName -}} {{- if .IsViewTag -}} {{- /* for /owner/repo/src/tag/the-name */ -}} {{- $branchDropdownCurrentRefType = "tag" -}} {{- $branchDropdownCurrentRefShortName = .TagName -}} {{- else if .IsViewCommit -}} {{- /* for /owner/repo/src/commit/000000 */ -}} {{- $branchDropdownCurrentRefType = "commit" -}} {{- $branchDropdownCurrentRefShortName = ShortSha .CommitID -}} {{- end -}}