Skip to content

Commit

Permalink
Revert "feat: rename and move install and run page, create unique pag…
Browse files Browse the repository at this point in the history
…es for e…"

This reverts commit 7c06029.
  • Loading branch information
alexey-igrychev authored Mar 29, 2024
1 parent 7c06029 commit 92a0a73
Show file tree
Hide file tree
Showing 68 changed files with 222 additions and 458 deletions.
8 changes: 8 additions & 0 deletions _data/_common/install_sitemap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
links:
- "usage=localDev&os=linux&buildBackend=buildah"
- "usage=localDev&os=macos&buildBackend=docker"
- "usage=localDev&os=windows&buildBackend=docker"
- "usage=ci&ci=gitlabCiCd&runnerType=kubernetesRunner&os=linux&buildBackend=buildah&projectType=bestPractice&sharedCICD=no&repoType=application"
- "usage=ci&ci=githubActions&runnerType=hostRunner&os=linux&buildBackend=docker&projectType=simplified&sharedCICD=no&repoType=application"
- "usage=ci&ci=otherCiCdSystem&runnerType=dockerRunner&os=linux&buildBackend=buildah&projectType=simplified&sharedCICD=no&repoType=application"
- "usage=ci&ci=argoCdWithGitlabCiCd&runnerType=dockerRunner&os=linux&buildBackend=buildah&projectType=simplified&sharedCICD=no&repoType=application"
11 changes: 1 addition & 10 deletions _data/en/breadcrumbs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/about:
title: About
url: /about/release_channels.html
/getting_started:
title: Getting Started
url: /getting_started/
/getting_started/cicd:
title: CI/CD
url: /getting_started/сicd
/getting_started/local:
title: Local development
url: /getting_started/local
url: /about/release_channels.html
2 changes: 0 additions & 2 deletions _data/en/topnav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
- title: Getting Started
url: /getting_started/
- title: Documentation
url: /documentation/v1.2/
- title: Kubernetes guide
Expand Down
11 changes: 1 addition & 10 deletions _data/ru/breadcrumbs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/about:
title: О проекте
url: /about/release_channels.html
/getting_started:
title: Быстрый старт
url: /getting_started/
/getting_started/cicd:
title: CI/CD
url: /getting_started/сicd
/getting_started/local:
title: Локальная разработка
url: /getting_started/local
url: /about/release_channels.html
2 changes: 0 additions & 2 deletions _data/ru/topnav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
- title: Быстрый старт
url: /getting_started/
- title: Документация
url: /documentation/v1.2/
- title: Самоучитель по Kubernetes
Expand Down
8 changes: 1 addition & 7 deletions _includes/_common/head.html.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@
{%- assign breadcrumb_err = "Check breadcrumbs.yml: " | append: current_breadcrumb_url | append: " not defined" %}
{{ breadcrumb_err | raise_error }}
{% endunless -%}
{%- if current_breadcrumb_url != "/getting_started" %}
{%- assign title_parts = title_parts | push: breadcrumb.title -%}
{%- elsif current_breadcrumb_url == "/getting_started" %}
{%- if max_ind > 1 %}
{%- assign title_parts = title_parts | push: breadcrumb.title -%}
{%- endif %}
{%- endif %}
{%- assign title_parts = title_parts | push: breadcrumb.title -%}
{%- endfor %}

{%- if page.head_title %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/page-nosidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ <h1 class="docs__title">{{ page.title }}</h1>

<div class="post-content">

{%- if page.directive_summary %}
{%- include directive_summary.html directive=page.directive_summary %}
{%- if page.summary %}
<div class="summary">{{page.summary}}</div>
{%- endif %}

{%- unless page.toc == false %}
{%- include common/toc.html %}
{%- include toc.html %}
{%- endunless %}

{%- unless jekyll.environment == "production" %}
Expand Down
140 changes: 0 additions & 140 deletions bin/configurator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"regexp"
"strings"

"gopkg.in/yaml.v2"
)

const (
pathToConfiguratorYaml = "static/_data/_common/configurator.yaml"
startPhraseRu = "Установка и запуск на "
startPhraseEn = "Install and run on "
)

type config struct {
Options []configOption `yaml:"options"`
Combinations []configCombination `yaml:"combinations"`
Expand All @@ -42,43 +34,6 @@ type configCombinationOption struct {

type configCombinationSlug string

type configNames struct {
Groups []struct {
Name string `yaml:"name"`
Title struct {
En string `yaml:"en"`
Ru string `yaml:"ru"`
} `yaml:"title"`
Tooltip struct {
En string `yaml:"en"`
Ru string `yaml:"ru"`
} `yaml:"tooltip,omitempty"`
Buttons []struct {
Name string `yaml:"name"`
Title struct {
En string `yaml:"en"`
Ru string `yaml:"ru"`
PageName struct {
En string `yaml:"en"`
Ru string `yaml:"ru"`
} `yaml:"page-name"`
} `yaml:"title"`
} `yaml:"buttons"`
} `yaml:"groups"`
Tabs []struct {
Name string `yaml:"name"`
Title struct {
En string `yaml:"en"`
Ru string `yaml:"ru"`
} `yaml:"title"`
} `yaml:"tabs"`
}

type titlesStruct struct {
Ru string
En string
}

func (options configCombinationOptions) ToSlug() configCombinationSlug {
var opts []string
for _, option := range options {
Expand All @@ -88,101 +43,6 @@ func (options configCombinationOptions) ToSlug() configCombinationSlug {
return configCombinationSlug(strings.Join(opts, "_"))
}

func (options configCombinationOptions) ToUrlPath() configCombinationSlug {
var opts []string
var usage string
for _, option := range options {
if option.Value == "localDev" {
usage = "local/"
} else if option.Value == "ci" {
usage = "cicd/"
} else {
opts = append(opts, strings.ToLower(option.Value))
}
}

return configCombinationSlug(usage + strings.Join(opts, "-"))
}

func (options configCombinationOptions) GetTitle(lang string) string {
var opts []configCombinationOption
for _, option := range options {
if option.Name != "usage" &&
option.Name != "repoType" &&
option.Name != "sharedCICD" &&
option.Name != "projectType" {
opts = append(opts, option)
}
}

file, err := os.Open(pathToConfiguratorYaml)
if err != nil {
log.Fatalf("Failed to open configurator.yaml file: %v", err)
}
defer file.Close()
confData, err := ioutil.ReadAll(file)
if err != nil {
log.Fatalf("Failed to open configurator.yaml file: %v", err)
}
var configNames configNames
err = yaml.Unmarshal(confData, &configNames)
if err != nil {
log.Fatalf("Failed to unmarshal YAML data: %v", err)
}

var titles titlesStruct
titles.Ru = startPhraseRu
titles.En = startPhraseEn
count := 0
for _, opt := range opts {
count++
for _, group := range configNames.Groups {
if group.Name == opt.Name {
for _, btn := range group.Buttons {
if opt.Value == btn.Name {
switch lang {
case "ru":
if len(btn.Title.PageName.Ru) != 0 {
titles.Ru += btn.Title.PageName.Ru
} else {
titles.Ru += btn.Title.Ru
}
if count < len(opts) {
if count < len(opts)-1 {
titles.Ru += ", "
} else {
titles.Ru += " и "
}
}
case "en":
if len(btn.Title.PageName.Ru) != 0 {
titles.En += btn.Title.PageName.En
} else {
titles.En += btn.Title.En
}
if count < len(opts) {
if count < len(opts)-1 {
titles.En += ", "
} else {
titles.En += " and "
}
}
}
}
}
}
}
}

if lang == "ru" {
return titles.Ru
} else if lang == "en" {
return titles.En
}

return ""
}

type configCombinationTab struct {
Name string `yaml:"name"`
IncludePath string `yaml:"includePath"`
Expand Down
2 changes: 1 addition & 1 deletion bin/configurator/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module install_conf_generator

go 1.21
go 1.18

require gopkg.in/yaml.v2 v2.4.0
Loading

0 comments on commit 92a0a73

Please sign in to comment.