Skip to content

Commit 5ad52e2

Browse files
authored
[core] A bunch of updates (#2)
Signed-off-by: Artem Kladov <artem.kladov@flant.com>
1 parent feb9782 commit 5ad52e2

30 files changed

+627
-341
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Hugo module for the Deckhouse websites
22

3-
This is the source for the Hugo module, used in Deckhouse documentation websites.
3+
This is the source for the Hugo module, used in Deckhouse documentation websites of the Deckhouse products.
4+
5+
## Usage
46

57
Add it in your hugo configuration.
68

@@ -10,4 +12,12 @@ For the local development, you can use the following replace directive in your `
1012
replace github.com/deckhouse/hugo-web-product-module => ../hugo-web-product-module
1113
```
1214

13-
or use use the modules configuration [replacements](https://gohugo.io/configuration/module/#replacements) option.
15+
or use use the modules configuration [replacements](https://gohugo.io/configuration/module/#replacements) option.
16+
17+
The Hugo version assumed to be 0.150.1. But it maybe will work with higher versions as well.
18+
19+
## Creating new Deckhouse product website
20+
21+
1. Use the folder `project_template` as a template for your new Deckhouse product website.
22+
1. Add content in the `content` folder and customize the configuration in the `config` folder.
23+
- Define product name and baseURL the `config/_default/hugo.yaml` file.

i18n/en.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Documentation: Documentation
2+
allowed_values: allowed values
3+
api: API
4+
array: array
5+
boolean: boolean
6+
category: category
7+
channel_or_version: "Channel/version"
8+
channel_or_version_of_module: "Module channel/version"
9+
commercial: Available in some commercial editions.
10+
commercial_editions_en: commercial editions
11+
community_edition_en: community edition
12+
conversion_action_message: The module is configured using the ModuleConfig resource, the schema of which contains a version number. When you apply an *old* version of the ModuleConfig schema in a cluster, automatic transformations are performed. To manually update the ModuleConfig schema version, the following steps must be completed **sequentially** for each version
13+
conversion_expressions: Actions performed by the conversion (jq syntax)
14+
conversion_from_version: Updates from version
15+
conversion_global_action_message: Global configuration settings are configured using the `global` ModuleConfig, the schema of which contains a version number. When you apply an *old* version of the ModuleConfig schema in a cluster, automatic transformations are performed. To manually update the ModuleConfig schema version, the following steps must be completed **sequentially** for each version
16+
conversion_missing_description: Conversion description is missing
17+
conversion_to: to
18+
conversions_title: Conversions
19+
core: core
20+
currency_sign: "$"
21+
deckhouse: deckhouse
22+
default_value: default
23+
deprecated_parameter: Deprecated
24+
deprecated_parameter_hint: Support for the parameter might be removed in a later release.
25+
documentation: documentation
26+
element_of_array: element of the array
27+
example: example
28+
examples: examples
29+
found: found
30+
javascript_required: "JavaScript must be [enabled](https://www.enable-javascript.com/) to view this content"
31+
integer: integer
32+
length: length
33+
max_length: maximum length
34+
min_length: minimal length
35+
module: module
36+
moduleLinkTitleADVANCED_USAGE: Advanced usage
37+
moduleLinkTitleCONFIGURATION: Configuration
38+
moduleLinkTitleCR: Custom Resources
39+
moduleLinkTitleCRD: Custom Resources
40+
moduleLinkTitleEXAMPLES: Examples
41+
moduleLinkTitleFAQ: FAQ
42+
moduleLinkTitleREADME: Description
43+
moduleLinkTitleSETUP: Setup
44+
moduleLinkTitleUSAGE: Usage
45+
module_alert_deprecated: Deprecated
46+
module_alert_deprecated_long: Deprecated version. Development and support have been terminated.
47+
module_alert_experimental: Experimental
48+
module_alert_experimental_long: Experimental version. The functionality may undergo significant changes. Compatibility with future versions is not guaranteed.
49+
module_alert_general_availability: Generally available version
50+
module_alert_general_availability_long: Generally available version. Ready to be used in production environments.
51+
module_alert_preview: Preview
52+
module_alert_preview_long: Preliminary version. The functionality may change, but the basic features will be preserved. Compatibility with future versions is ensured, but may require additional migration actions.
53+
module_available_editions_prefix: Available in
54+
module_available_with_limitations_prefix: Available with limitations in
55+
module_available_without_limitations_prefix: Available without limitations in
56+
module_has_restions_short: with limitations
57+
module_is_available_in_ee_only: The module is available only in Deckhouse Enterprise Edition.
58+
module_version: Module version
59+
module_versions: Module versions
60+
modules2: modules
61+
modules: modules
62+
modules_documentation: Modules documentation
63+
modules_list: Modules list
64+
no_custom_configuration: The module has no configuration parameters.
65+
notAvailableInThisEdition: Available in other commercial editions.
66+
number: number
67+
object: object
68+
of_array: of arrays
69+
of_boolean: of booleans
70+
of_integer: of integers
71+
of_number: of numbers
72+
of_object: of objects
73+
of_string: of strings
74+
of_x-kubernetes-int-or-string: of integers or strings
75+
parameters: parameters
76+
pattern: pattern
77+
platform: platform
78+
required_value_sentence: Required value
79+
reset_filter: reset filter
80+
search_context_dkpdocs_and_modules: The search is performed throughout DKP documentation and modules.
81+
search_context_modules: The search is performed throughout modules, excluding the DKP documentation.
82+
search_context_only_product_docs: The search is performed throughout the product documentation, excluding modules.
83+
search_placeholder_text: Search...
84+
show_more: Show more
85+
show_more_pattern: "Show %s more"
86+
string: string
87+
version: version
88+
version_of_module: "### module version"
89+
version_of_schema: Schema version
90+
x-kubernetes-int-or-string: integer or string

i18n/ru.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Documentation: Документация
2+
allowed_values: допустимые значения
3+
api: API
4+
array: массив
5+
boolean: булевый
6+
category: категория
7+
channel_or_version: "Канал/версия"
8+
channel_or_version_of_module: "Канал/версия модуля"
9+
commercial: Доступно в некоторых коммерческих редакциях.
10+
commercial_editions_en: commercial editions
11+
community_edition_en: community edition
12+
conversion_action_message: Модуль настраивается с помощью ресурса ModuleConfig, схема которого содержит номер версии. При применении в кластере *старой* версии схемы ModuleConfig выполняются автоматические преобразования. Чтобы обновить версию схемы ModuleConfig вручную, необходимо **последовательно** для каждой версии выполнить следующие действия
13+
conversion_expressions: Преобразования, выполняемые конверсией (синтаксис jq)
14+
conversion_from_version: Обновление из версии
15+
conversion_global_action_message: Глобальные параметры настраиваются с помощью ModuleConfig `global`, схема которого содержит номер версии. При применении в кластере *старой* версии схемы ModuleConfig выполняются автоматические преобразования. Чтобы обновить версию схемы ModuleConfig вручную, необходимо **последовательно** для каждой версии выполнить следующие действия
16+
conversion_missing_description: Описание конверсии отсутствует
17+
conversion_to: в
18+
conversions_title: Конверсии
19+
core: ядро
20+
currency_sign: ""
21+
deckhouse: deckhouse
22+
default_value: по умолчанию
23+
deprecated_parameter: Параметр устарел
24+
deprecated_parameter_hint: Поддержка параметра может быть исключена в следующих версиях.
25+
documentation: документация
26+
element_of_array: элемент массива
27+
example: пример
28+
examples: примеры
29+
found: найдено
30+
javascript_required: "Для просмотра этого содержимого необходимо [включить](https://www.enable-javascript.com/) JavaScript"
31+
integer: целочисленный
32+
length: длина
33+
max_length: максимальная длина
34+
min_length: минимальная длина
35+
module: модуль
36+
moduleLinkTitleADVANCED_USAGE: Расширенная конфигурация
37+
moduleLinkTitleCONFIGURATION: Настройка
38+
moduleLinkTitleCR: Custom Resources
39+
moduleLinkTitleCRD: Custom Resources
40+
moduleLinkTitleEXAMPLES: Примеры
41+
moduleLinkTitleFAQ: FAQ
42+
moduleLinkTitleREADME: Описание
43+
moduleLinkTitleSETUP: Настройка
44+
moduleLinkTitleUSAGE: Примеры использования
45+
module_alert_deprecated: Устарело
46+
module_alert_deprecated_long: Устарело. Развитие и поддержка прекращены.
47+
module_alert_experimental: Экспериментальная версия
48+
module_alert_experimental_long: Экспериментальная версия. Функциональность может сильно измениться. Совместимость с будущими версиями не гарантируется.
49+
module_alert_general_availability: Общедоступная версия
50+
module_alert_general_availability_long: Общедоступная версия. Готово к использованию в production-средах.
51+
module_alert_preview: Предварительная версия (preview)
52+
module_alert_preview_long: Предварительная версия. Функциональность может измениться, но основные возможности сохранятся. Совместимость с будущими версиями может потребовать ручных действий по миграции.
53+
module_available_editions_prefix: Доступно в редакциях
54+
module_available_with_limitations_prefix: Доступно с ограничениями в редакциях
55+
module_available_without_limitations_prefix: Доступно без ограничений в редакциях
56+
module_has_restions_short: с ограничениями
57+
module_is_available_in_ee_only: Модуль доступен только в Deckhouse Enterprise Edition.
58+
module_version: Версия модуля
59+
module_versions: Версии модуля
60+
modules2: модулей
61+
modules: модули
62+
modules_documentation: Документация модулей
63+
modules_list: Список модулей
64+
no_custom_configuration: У модуля нет параметров для настройки.
65+
notAvailableInThisEdition: Доступно в других коммерческих редакциях.
66+
number: число
67+
object: объект
68+
of_array: массивов
69+
of_boolean: булевых значений
70+
of_integer: целых чисел
71+
of_number: чисел
72+
of_object: объектов
73+
of_string: строк
74+
of_x-kubernetes-int-or-string: строк или чисел
75+
parameters: параметры
76+
pattern: шаблон
77+
platform: платформа
78+
required_value_sentence: Обязательный параметр
79+
reset_filter: Сбросить фильтр
80+
search_context_dkpdocs_and_modules: Поиск выполняется по всей документации DKP и модулям.
81+
search_context_modules: Поиск выполняется по всем модулям, не включая документацию DKP.
82+
search_context_only_product_docs: Поиск выполняется по всей документации продукта, не включая модули.
83+
search_placeholder_text: Поиск...
84+
show_more: Показать ещё
85+
show_more_pattern: "Показать ещё %s"
86+
string: строка
87+
version: версия
88+
version_of_module: "Версия модуля ###"
89+
version_of_schema: Версия схемы
90+
x-kubernetes-int-or-string: строка или число
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<pre class="mermaid">
2+
{{ .Inner | htmlEscape | safeHTML }}
3+
</pre>
4+
{{ .Page.Store.Set "hasMermaid" true }}

layouts/_markup/render-link.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- $u := urls.Parse .Destination -}}
2+
{{- $href := $u.String -}}
3+
{{- if strings.HasPrefix $u.String "#" -}}
4+
{{- $href = printf "%s#%s" .PageInner.RelPermalink $u.Fragment -}}
5+
{{- else if and $href (not $u.IsAbs) -}}
6+
{{- $path := strings.TrimPrefix "./" $u.Path -}}
7+
{{- with or
8+
($.PageInner.GetPage $path)
9+
($.PageInner.Resources.Get $path)
10+
(resources.Get $path)
11+
-}}
12+
{{- $href = .RelPermalink -}}
13+
{{- with $u.RawQuery -}}
14+
{{- $href = printf "%s?%s" $href . -}}
15+
{{- end -}}
16+
{{- with $u.Fragment -}}
17+
{{- $href = printf "%s#%s" $href . -}}
18+
{{- end -}}
19+
{{- end -}}
20+
{{- end -}}
21+
<a href="{{ $href }}" {{- with .Title }} title="{{ . }}" {{- end }}>{{ .Text }}</a>
22+
{{- /**/ -}}

layouts/_partials/documentation-section-badge.html

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{ $rootSiteUrl := site.Params.publicRootURL }}
2+
{{ $assetUrl := index . 0 }}
3+
{{ $url := printf "%s%s" $rootSiteUrl $assetUrl }}
4+
{{ $extension := path.Ext $assetUrl | strings.TrimPrefix "." }}
5+
{{ with try (resources.GetRemote $url) }}
6+
{{ with .Err }}
7+
{{ warnf "Failed to fetch remote asset: %s" . }}
8+
{{ else }}
9+
{{ if eq $extension "js" }}
10+
<script src="{{ $url }}"></script>
11+
{{ else if eq $extension "css" }}
12+
<link rel="stylesheet" href="{{ $url }}">
13+
{{ else if in (slice "jpg" "jpeg" "png" "gif" "svg" "webp") $extension }}
14+
<img src="{{ $url }}" alt="">
15+
{{ else }}
16+
<!-- Unknown asset type: {{ $extension }} -->
17+
{{ end }}
18+
{{ end }}
19+
{{ else }}
20+
{{ warnf "Unable to get remote resource %q" $url }}
21+
{{ end }}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{{ $rootSiteUrl := site.Params.publicRootURL }}
22
{{ $assetUrl := index . 0 }}
3+
{{ warnf "----------- ASSET %s\n" $assetUrl }}
34
{{ $url := printf "%s%s%s" $rootSiteUrl site.Params.remoteAssetURL $assetUrl }}
45
{{ with try (resources.GetRemote $url) }}
56
{{ with .Err }}
67
{{ warnf "Failed to fetch remote HTML: %s" . }}
78
{{ else with .Value }}
8-
{{ .Content | replaceRE `(["'])/(asset|assets|images)/` (printf "${1}%s/${2}/" $rootSiteUrl) | safeHTML }}
9+
{{/* warnf "----------- BEFORE:\n%s" .Content */}}
10+
{{ .Content | replaceRE `(["'])[\./]*/(asset|assets|images)/` (printf "${1}%s/${2}/" $rootSiteUrl) | safeHTML }}
911
{{ else }}
1012
{{ warnf "Unable to get remote resource %q" $url }}
1113
{{ end }}

layouts/_partials/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
<!-- Open Graph / Facebook -->
1313
<meta property="og:type" content="website">
14-
<meta property="og:url" content="{{ strings.TrimRight "readme.html" .Permalink }}">
14+
<meta property="og:url" content="{{ strings.TrimSuffix "readme.html" .Permalink }}">
1515
<meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}">
1616
<meta property="og:description" content="{{ $description }}">
1717
<meta property="og:image" content="{{ site.BaseURL }}/favicon-32x32.png" />
1818

1919
<!-- Twitter -->
2020
<meta name="twitter:card" content="summary">
21-
<meta name="twitter:url" content="{{ strings.TrimRight "readme.html" .Permalink }}">
21+
<meta name="twitter:url" content="{{ strings.TrimSuffix "readme.html" .Permalink }}">
2222
<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}">
2323
<meta name="twitter:description" content="{{ $description }}">
2424
<meta name="twitter:image" content="{{ site.BaseURL }}/favicon-32x32.png" />

0 commit comments

Comments
 (0)