Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): fix and cleanup VuePress config #3738

Merged
merged 7 commits into from
Mar 11, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
229 changes: 109 additions & 120 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
const sidebar = (lang, override = {}) =>
[
"", // "Home", which should always have a override
"guide", // README, which should always have a override
// Overrides for any page below is an inconsistency between the sidebar title and page title
"installing",
"config",
"advanced-config",
"faq",
"presets",
].map(page => {
let path = "/";

if (lang) {
path += `${lang}/`;
}

if (page) {
path += `${page}/`;
}

// If no override is set for current page, let VuePress fallback to page title
return page in override ? [path, override[page]] : path;
});

module.exports = {
locales: {
"/": {
Expand Down Expand Up @@ -85,6 +110,7 @@ module.exports = {
["meta", { name: "twitter:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }],
],
evergreen: true,
theme: "default-prefers-color-scheme",
themeConfig: {
logo: "/icon.png",
Expand Down Expand Up @@ -113,16 +139,9 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Configuration", link: "/config/" }],
// Custom sidebar values
sidebar: [
"/",
["/guide/", "Guide"],
["/installing/", "Advanced Installation"],
["/config/", "Configuration"],
["/advanced-config/", "Advanced Configuration"],
["/faq/", "Frequently Asked Questions"],
["/presets/", "Presets"],
["/migrating-to-0.45.0/", "Migrating to v0.45.0"],
],
sidebar: sidebar("", {
guide: "Guide",
}),
},
"/de-DE/": {
// text for the language dropdown
Expand All @@ -132,16 +151,14 @@ module.exports = {
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Bearbeite diese Seite auf GitHub",
// Custom navbar values
nav: [{ text: "Konfiguration", link: "/config/" }],
nav: [{ text: "Konfiguration", link: "/de-DE/config/" }],
// Custom sidebar values
sidebar: [
"/de-DE/",
["/de-DE/guide/", "Anleitung"],
["/de-DE/config/", "Konfiguration"],
["/de-DE/advanced-config/", "Erweiterte Konfiguration"],
["/de-DE/faq/", "Häufig gestellte Fragen"],
["/de-DE/presets/", "Konfigurations-Beispiele"],
],
sidebar: sidebar("de-DE", {
guide: "Anleitung",
installing: "Erweiterte Installation",
faq: "Häufig gestellte Fragen",
presets: "Konfigurations-Beispiele",
}),
},
"/es-ES/": {
// text for the language dropdown
Expand All @@ -153,14 +170,12 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Configuración", link: "/es-ES/config/" }],
// Custom sidebar values
sidebar: [
"/es-ES/",
["/es-ES/guide/", "Guía"],
["/es-ES/config/", "Configuración"],
["/es-ES/advanced-config/", "Configuración Avanzada"],
["/es-ES/faq/", "Preguntas frecuentes"],
["/es-ES/presets/", "Ajustes predeterminados"],
],
sidebar: sidebar("es-ES", {
guide: "Guía",
installing: "Instalación avanzada",
faq: "Preguntas frecuentes",
presets: "Ajustes predeterminados",
}),
},
"/fr-FR/": {
// text for the language dropdown
Expand All @@ -172,14 +187,10 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Configuration", link: "/fr-FR/config/" }],
// Custom sidebar values
sidebar: [
"/fr-FR/",
["/fr-FR/guide/", "Guide"],
["/fr-FR/config/", "Configuration"],
["/fr-FR/advanced-config/", "Configuration avancée"],
["/fr-FR/faq/", "Foire aux questions"],
["/fr-FR/presets/", "Paramètres par défaut"],
],
sidebar: sidebar("fr-FR", {
guide: "Guide",
installing: "Installation avancée",
}),
},
"/id-ID/": {
// text for the language dropdown
Expand All @@ -191,14 +202,12 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Konfigurasi", link: "/id-ID/config/" }],
// Custom sidebar values
sidebar: [
"/id-ID/",
["/id-ID/guide/", "Petunjuk"],
["/id-ID/config/", "Konfigurasi"],
["/id-ID/advanced-config/", "Konfigurasi Lanjutan"],
["/id-ID/faq/", "Pertanyaan Umum"],
["/id-ID/presets/", "Prasetel"],
],
sidebar: sidebar("id-ID", {
guide: "Petunjuk",
installing: "Advanced Installation",
faq: "Pertanyaan Umum",
presets: "Prasetel",
}),
},
"/it-IT/": {
// text for the language dropdown
Expand All @@ -210,14 +219,10 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Configuration", link: "/it-IT/config/" }],
// Custom sidebar values
sidebar: [
"/it-IT/",
["/it-IT/guide/", "Guide"],
["/it-IT/config/", "Configurazione"],
["/it-IT/advanced-config/", "Configurazione Avanzata"],
["/it-IT/faq/", "FAQ"],
["/it-IT/presets/", "Preset"],
],
sidebar: sidebar("it-IT", {
guide: "Guide",
installing: "Installazione Avanzata",
}),
},
"/ja-JP/": {
// text for the language dropdown
Expand All @@ -229,15 +234,10 @@ module.exports = {
// Custom navbar values
nav: [{ text: "設定", link: "/ja-JP/config/" }],
// Custom sidebar values
sidebar: [
"/ja-JP/",
["/ja-JP/guide/", "ガイド"],
["/ja-JP/config/", "設定"],
["/ja-JP/advanced-config/", "高度な設定"],
["/ja-JP/faq/", "FAQ"],
["/ja-JP/presets/", "準備するもの"],
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"],
],
sidebar: sidebar("ja-JP", {
guide: "ガイド",
installing: "高度なインストール",
}),
},
"/pt-BR/": {
// text for the language dropdown
Expand All @@ -249,14 +249,12 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Configuração", link: "/pt-BR/config/" }],
// Custom sidebar values
sidebar: [
"/pt-BR/",
["/pt-BR/guide/", "Guia"],
["/pt-BR/config/", "Configuração"],
["/pt-BR/advanced-config/", "Configuração avançada"],
["/pt-BR/faq/", "Perguntas frequentes"],
["/pt-BR/presets/", "Predefinições"],
],
sidebar: sidebar("pt-BR", {
guide: "Guia",
installing: "Instalação avançada",
faq: "Perguntas frequentes",
presets: "Predefinições",
}),
},
"/ru-RU/": {
// text for the language dropdown
Expand All @@ -268,14 +266,13 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Настройка", link: "/ru-RU/config/" }],
// Custom sidebar values
sidebar: [
"/ru-RU/",
["/ru-RU/guide/", "Руководство"],
["/ru-RU/config/", "Настройка"],
["/ru-RU/advanced-config/", "Расширенная Настройка"],
["/ru-RU/faq/", "Часто Задаваемые Вопросы"],
["/ru-RU/presets/", "Предустановки"],
],
sidebar: sidebar("ru-RU", {
guide: "Руководство",
installing: "Advanced Installation",
config: "Настройка",
"advanced-config": "Расширенная Настройка",
faq: "Часто Задаваемые Вопросы",
}),
},
"/vi-VN/": {
// text for the language dropdown
Expand All @@ -287,51 +284,43 @@ module.exports = {
// Custom navbar values
nav: [{ text: "Cấu hình", link: "/vi-VN/config/" }],
// Custom sidebar values
sidebar: [
"/vi-VN/",
["/vi-VN/guide/", "Hướng dẫn"],
["/vi-VN/config/", "Cấu hình"],
["/vi-VN/advanced-config/", "Cấu hình nâng cao"],
["/vi-VN/faq/", "Các hỏi thường gặp"],
["/vi-VN/presets/", "Mẫu thiết lập"],
],
sidebar: sidebar("vi-VN", {
guide: "Hướng dẫn",
installing: "Cài đặt nâng cao",
faq: "Các hỏi thường gặp",
}),
},
"/zh-TW/": {
// text for the language dropdown
selectText: "語言",
// label for this locale in the language dropdown
label: "繁體中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此頁面",
// Custom navbar values
nav: [{ text: "設定", link: "/zh-TW/config/" }],
// Custom sidebar values
sidebar: sidebar("zh-TW", {
guide: "指引",
installing: "進階安裝",
}),
},
"/zh-CN/": {
// text for the language dropdown
selectText: "语言",
// label for this locale in the language dropdown
label: "简体中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此页",
// Custom navbar values
nav: [{ text: "配置", link: "/zh-CN/config/" }],
// Custom sidebar values
sidebar: sidebar("zh-CN", {
guide: "指南",
installing: "高级安装",
presets: "社区配置分享",
}),
},
},
"/zh-TW/": {
// text for the language dropdown
selectText: "語言",
// label for this locale in the language dropdown
label: "繁體中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此頁面",
// Custom navbar values
nav: [{ text: "設定", link: "/zh-TW/config/" }],
// Custom sidebar values
sidebar: [
"/zh-TW/",
["/zh-TW/guide/", "指引"],
["/zh-TW/config/", "設定"],
["/zh-TW/advanced-config/", "進階設定"],
],
},
"/zh-CN/": {
// text for the language dropdown
selectText: "语言",
// label for this locale in the language dropdown
label: "简体中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此页",
// Custom navbar values
nav: [{ text: "配置", link: "/zh-CN/config/" }],
// Custom sidebar values
sidebar: [
"/zh-CN/",
["/zh-CN/guide/", "指南"],
["/zh-CN/config/", "配置"],
["/zh-CN/advanced-config/", "高级配置"],
["/zh-CN/faq/", "常见问题"],
["/zh-CN/presets/", "社区配置分享"],
],
},
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/faq/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FAQ
# Frequently Asked Questions

## What is the configuration used in the demo GIF?

Expand Down
2 changes: 1 addition & 1 deletion docs/installing/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🚀 Advanced Installation
# Advanced Installation

To install starship, you need to do two things:

Expand Down
10 changes: 5 additions & 5 deletions docs/presets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ If you have a preset to share, please [submit a PR](https://github.com/starship/

To get details on how to use a preset, simply click on the image.

## [Nerd Font Symbols](./nerd-font)
## [Nerd Font Symbols](./nerd-font.md)

This preset changes the symbols for each module to use Nerd Font symbols.

[![Screenshot of Nerd Font Symbols preset](/presets/img/nerd-font-symbols.png "Click to view Nerd Font Symbols preset")](./nerd-font)

## [Bracketed Segments](./bracketed-segments)
## [Bracketed Segments](./bracketed-segments.md)

This preset changes the format of all the built-in modules to show their segment
in brackets instead of using the default Starship wording ("via", "on", etc.).

[![Screenshot of Bracketed Segments preset](/presets/img/bracketed-segments.png "Click to view Bracketed Segments preset")](./bracketed-segments)

## [Plain Text Symbols](./plain-text)
## [Plain Text Symbols](./plain-text.md)

This preset changes the symbols for each module into plain text. Great if you
don't have access to Unicode.

[![Screenshot of Plain Text Symbols preset](/presets/img/plain-text-symbols.png "Click to view Plain Text Symbols preset")](./plain-text)

## [No Runtime Versions](./no-runtimes)
## [No Runtime Versions](./no-runtimes.md)

This preset hides the version of language runtimes. If you work in containers or virtualized environments, this one is for you!

[![Screenshot of Hide Runtime Versions preset](/presets/img/no-runtime-versions.png "Click to view No Runtime Versions preset")](./no-runtimes)

## [Pure Prompt](./pure-preset)
## [Pure Prompt](./pure-preset.md)

This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/bracketed-segments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Return to Presets](/presets/#bracketed-segments)
[Return to Presets](./README.md#bracketed-segments)

# Bracketed Segments Preset

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/nerd-font.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Return to Presets](/presets/#nerd-font-symbols)
[Return to Presets](./README.md#nerd-font-symbols)

# Nerd Font Symbols Preset

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/no-runtimes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Return to Presets](/presets/#no-runtime-versions)
[Return to Presets](./README.md#no-runtime-versions)

# No Runtime Versions Preset

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/plain-text.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Return to Presets](/presets/#plain-text-symbols)
[Return to Presets](./README.md#plain-text-symbols)

## Plain Text Symbols Preset

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/pure-preset.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Return to Presets](/presets/#pure)
[Return to Presets](./README.md#pure)

# Pure Preset

Expand Down