{{/* Get configuration values */}} {{- $githubUser := site.Params.github_username }} {{- $contentRepo := site.Params.github_repository }} {{- $contentRepoBranch := site.Params.github_repository_branch | default "main" }} {{- $contentRepoFolder := site.Params.github_submodule_folder }} {{- if and ($githubUser) ($contentRepo)}} {{- if .File.Path }} {{ $hugoFilePath := .File.Path }} {{ $pathInRepo := $hugoFilePath }} {{- if $contentRepoFolder }} {{ $pathInRepo = strings.TrimPrefix $contentRepoFolder $hugoFilePath }} {{- end }} {{- $editURL := printf "https://github.com/%s/%s/edit/%s/%s" $githubUser $contentRepo $contentRepoBranch $pathInRepo}}
{{- end }} {{- else }} {{ $page := .Page.RelPermalink }} {{- $errorCode := "ocd-fm-100" }} {{- $errorMessage := printf "Incomplete frontmatter param - github_edit = true" }} {{- $logMessage := printf "OcdError [%s] Page: %s | %s)" $errorCode $page $errorMessage }} {{- warnf "%s" $logMessage }} {{- /* OCD error card for: odc-fm-100 */}} {{- if and (eq hugo.Environment "development") (hugo.IsServer) (eq .Page.Site.Params.ocd_enabled true) }}{{- i18n "OcdScNumist100" . | default "The Edit on Github function is enabled, on:" }} {{ .Page.Title }} but there are missing values in params.toml
{{ i18n "OcdScAvailableStyle" . | default "Missing values:" }} github_username, github_repository