/
githubmirror
/
hugo
Обзор
Документация
Войти
/
githubmirror
/
hugo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/layouts/_shortcodes/eturl.html
25 строк
1 KB
Bjørn Erik Pedersen
Merge commit 'c23d97904fd31ef745bece57133aa1b9275ec20c'
21 май 2026, 13:22
21 май 2026, 13:22
5f01b06
Код
Авторство
О чём код?
{{/* Renders an absolute URL to the source code for an embedded template. Accepts either positional or named parameters, and depends on the embedded_templates.toml file in the data directory. @param {string} filename The embedded template's file name, excluding extension. @example {{% et robots.txt %}} @example {{% et filename=robots.txt %}} */}} {{- with $filename := or (.Get "filename") (.Get 0) }} {{- with hugo.Data.embedded_template_urls }} {{- with index . $filename }} {{- urls.JoinPath hugo.Data.embedded_template_urls.base_url . }} {{- else }} {{- errorf "The %q shortcode was unable to find a URL for the embedded template named %q. Check the name. See %s" $.Name $filename $.Position }} {{- end }} {{- else }} {{- errorf "The %q shortcode was unable to find the embedded_template_urls data file in the site's data directory. See %s" $.Name $.Position }} {{- end }} {{- else }} {{- errorf "The %q shortcodes requires a named or positional parameter, the file name of the embedded template, excluding its extension. See %s" .Name .Position }} {{- end -}}