{{ $lang := cond (eq .docs_type "tidb") "" (cond .isCn "zh/" "en/") }} {{ $docs_repo := cond (eq .repo "docs") (cond .isCn (print .repo "-cn") .repo) .repo}} {{ $file_prefix_with_version := cond (in .file_prefix "stable") (replace .file_prefix "stable" .sv) .file_prefix }} {{ $path_prefix := print "content/" (cond (eq .docs_type "tidb") (cond .isCn "docs-cn/" "docs/") "docs/") (replace $file_prefix_with_version "_" "-") "___"}} {{ $md_file_path_with_version := cond (in .global.File.Path "stable") (replace .global.File.Path "stable" .sv) .global.File.Path }} {{ $branch := strings.TrimPrefix "v" (index (findRE "(v\\d+\\.\\d+)" $file_prefix_with_version) 0) }} {{ $md_file_path := strings.TrimPrefix (print (cond .isCn "docs-cn/" "docs/") (replace $file_prefix_with_version "_" "-") "/") $md_file_path_with_version }} {{ $filter_name := print $path_prefix $lang (cond (eq .multi_level_url "") $md_file_path .multi_level_url) }} {{- range $item := .global.Site.Data.sub_git_info -}} {{- if and $item $item.name -}} {{- if eq $item.name $filter_name -}} {{- $infos := split $item.info "___" -}} {{- $hash := index $infos 0 -}} {{- $msg := index $infos 2 -}} {{- $date := index $infos 3 -}} {{- $date_str := split $date " " -}} {{- $month := index $date_str 1 -}} {{- $day := index $date_str 2 -}} {{- $year := index $date_str 4 -}} {{- $commit_id := index $infos 4 -}} {{- $filename := index (split $item.name "___") 1 -}}