From 0ea82fe25da1bbfa4413b95c183a431273803c8e Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Sun, 19 Nov 2023 18:40:27 +0600 Subject: [PATCH] :memo: Updated README due changes in templates lookup --- docs/README.en.md | 4 +--- docs/README.ru.md | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/README.en.md b/docs/README.en.md index 47420f4..81b0181 100644 --- a/docs/README.en.md +++ b/docs/README.en.md @@ -82,11 +82,10 @@ Any static files can be hosted and published in two ways: * In `$HOME_STATIC_DIR` as publicly available static, "as is" without any restrictions, in the same path in which the file is located in the directory; * In `$HOME_CONTENT_DIR` next to the specific page: the file will be available in the `.Site.Resources` and `.Page.Resources` collections and restricted by the access settings of the parent page; -Templates are required to render page content in browsers and must be placed in `$HOME_THEME_DIR`. At least one template with a `baseof` block that will be called for each page is required, for example: +Templates are required to render page content in browsers and must be placed in `$HOME_THEME_DIR`. At least one template `baseof.html` that will be called for each page is required, for example: ```html -{{ define "baseof" }} @@ -102,7 +101,6 @@ Templates are required to render page content in browsers and must be placed in {{ block "body" . }}{{ .Page.Content | transform.Markdownify }}{{ end }} -{{ end }} ``` Templating works according to [the instructions of the standard Go templating engine](https://pkg.go.dev/html/template) with minor additions in the form of [additional utilities](../internal/templateutil/templateutil.go). In `$HOME_THEME_DIR`, any combination and hierarchy of templates and their relationships is allowed as long as there is a `baseof` as a single parent block. diff --git a/docs/README.ru.md b/docs/README.ru.md index f00c607..e373363 100644 --- a/docs/README.ru.md +++ b/docs/README.ru.md @@ -83,11 +83,10 @@ This is a sample page content for demo. * В `$HOME_STATIC_DIR` как публично доступная статика, без каких-либо ограничений "как есть", по тому же пути в котором файл расположен в директории; * В `$HOME_CONTENT_DIR` рядом с нужной страницей: файл будет доступен в коллекциях `.Site.Resources` и `.Page.Resources` и ограничен настройками доступа родительской страницы; -Для рендера содержимого страниц в браузерах необходимы шаблоны, которые должны размещаться в `$HOME_THEME_DIR`. Для работы необходим хотя бы один шаблон с блоком `baseof` который будет вызываться для каждой страницы, например: +Для рендера содержимого страниц в браузерах необходимы шаблоны, которые должны размещаться в `$HOME_THEME_DIR`. Для работы необходим хотя бы один шаблон `baseof.html` который будет вызываться для каждой страницы, например: ```html -{{ define "baseof" }} @@ -103,7 +102,6 @@ This is a sample page content for demo. {{ block "body" . }}{{ .Page.Content | transform.Markdownify }}{{ end }} -{{ end }} ``` Шаблонизация работает по [инструкциям стандартного шаблонизатора Go](https://pkg.go.dev/html/template) с небольшими дополнениями в виде [дополнительных утилит](../internal/templateutil/templateutil.go). В `$HOME_THEME_DIR` разрешена любая комбинация и иеархия шаблонов и их взаимосвязей до тех пор, пока существует `baseof` в качестве единого родительского блока.