Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/build-docs-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ on:
branches:
- main
paths:
- 'docs-gen/**'
- '.github/workflows/build-docs-gen.yaml'
pull_request:
paths:
- 'docs-gen/**'
- '.github/workflows/build-docs-gen.yaml'
- "docs-gen/**"
- ".github/workflows/build-docs-gen.yaml"

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -41,9 +37,8 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -57,4 +52,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
14 changes: 5 additions & 9 deletions .github/workflows/build-docs-mint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ on:
branches:
- main
paths:
- 'mintlify/**'
- '.github/workflows/build-docs-mint.yaml'
pull_request:
paths:
- 'mintlify/**'
- '.github/workflows/build-docs-mint.yaml'
- "mintlify/**"
- ".github/workflows/build-docs-mint.yaml"

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -41,9 +37,8 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -57,4 +52,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max

4 changes: 4 additions & 0 deletions common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ footer:
- anchor: "Community"
href: "https://slack.dev.talos-systems.io/"
icon: "slack"

integrations:
ga4:
measurementId: "G-PT2W5NT93B"
81 changes: 46 additions & 35 deletions docs-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ import (

// Config represents the YAML configuration file structure
type Config struct {
Schema string `yaml:"schema"`
Theme string `yaml:"theme"`
Name string `yaml:"name"`
Colors Colors `yaml:"colors"`
Favicon string `yaml:"favicon"`
Banner *Banner `yaml:"banner,omitempty"`
Contextual *Contextual `yaml:"contextual,omitempty"`
Logo *Logo `yaml:"logo,omitempty"`
Navbar *Navbar `yaml:"navbar,omitempty"`
Footer *Footer `yaml:"footer,omitempty"`
Redirects []Redirect `yaml:"redirects,omitempty"`
Navigation NavigationConfig `yaml:"navigation"`
Schema string `yaml:"schema"`
Theme string `yaml:"theme"`
Name string `yaml:"name"`
Colors Colors `yaml:"colors"`
Favicon string `yaml:"favicon"`
Banner *Banner `yaml:"banner,omitempty"`
Contextual *Contextual `yaml:"contextual,omitempty"`
Logo *Logo `yaml:"logo,omitempty"`
Navbar *Navbar `yaml:"navbar,omitempty"`
Footer *Footer `yaml:"footer,omitempty"`
Integrations *Integrations `yaml:"integrations,omitempty"`
Redirects []Redirect `yaml:"redirects,omitempty"`
Navigation NavigationConfig `yaml:"navigation"`
}

type Colors struct {
Expand Down Expand Up @@ -63,6 +64,14 @@ type Footer struct {
Socials map[string]string `yaml:"socials" json:"socials"`
}

type Integrations struct {
GA4 *GA4Integration `yaml:"ga4,omitempty" json:"ga4,omitempty"`
}

type GA4Integration struct {
MeasurementId string `yaml:"measurementId" json:"measurementId"`
}

type NavigationConfig struct {
Tabs []TabConfig `yaml:"tabs"`
Global *GlobalNav `yaml:"global,omitempty"`
Expand Down Expand Up @@ -124,18 +133,19 @@ type Redirect struct {

// MintlifyConfig represents the output docs.json structure
type MintlifyConfig struct {
Schema string `json:"$schema"`
Theme string `json:"theme"`
Name string `json:"name"`
Colors Colors `json:"colors"`
Favicon string `json:"favicon"`
Banner *Banner `json:"banner,omitempty"`
Contextual *Contextual `json:"contextual,omitempty"`
Logo *Logo `json:"logo,omitempty"`
Navbar *Navbar `json:"navbar,omitempty"`
Footer *Footer `json:"footer,omitempty"`
Redirects []Redirect `json:"redirects,omitempty"`
Navigation MintlifyNavigation `json:"navigation"`
Schema string `json:"$schema"`
Theme string `json:"theme"`
Name string `json:"name"`
Colors Colors `json:"colors"`
Favicon string `json:"favicon"`
Banner *Banner `json:"banner,omitempty"`
Contextual *Contextual `json:"contextual,omitempty"`
Logo *Logo `json:"logo,omitempty"`
Navbar *Navbar `json:"navbar,omitempty"`
Footer *Footer `json:"footer,omitempty"`
Integrations *Integrations `json:"integrations,omitempty"`
Redirects []Redirect `json:"redirects,omitempty"`
Navigation MintlifyNavigation `json:"navigation"`
}

type MintlifyNavigation struct {
Expand Down Expand Up @@ -187,17 +197,18 @@ func main() {

// Generate Mintlify config
mintlifyConfig := MintlifyConfig{
Schema: mergedConfig.Schema,
Theme: mergedConfig.Theme,
Name: mergedConfig.Name,
Colors: mergedConfig.Colors,
Favicon: mergedConfig.Favicon,
Banner: mergedConfig.Banner,
Contextual: mergedConfig.Contextual,
Logo: mergedConfig.Logo,
Navbar: mergedConfig.Navbar,
Footer: mergedConfig.Footer,
Redirects: mergedConfig.Redirects,
Schema: mergedConfig.Schema,
Theme: mergedConfig.Theme,
Name: mergedConfig.Name,
Colors: mergedConfig.Colors,
Favicon: mergedConfig.Favicon,
Banner: mergedConfig.Banner,
Contextual: mergedConfig.Contextual,
Logo: mergedConfig.Logo,
Navbar: mergedConfig.Navbar,
Footer: mergedConfig.Footer,
Integrations: mergedConfig.Integrations,
Redirects: mergedConfig.Redirects,
Navigation: MintlifyNavigation{
Global: mergedConfig.Navigation.Global,
},
Expand Down