Skip to content

Commit f7ba22b

Browse files
committed
fix: links
1 parent f7544ed commit f7ba22b

10 files changed

Lines changed: 118 additions & 1 deletion

File tree

en/docs/eitri-shopping/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Eitri Shopping
22
nav:
3+
- index.md
34
- exposed-apis.md
45
- recaptcha.md
56
- deeplinks.md
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Language Selector for Eitri Docs
2+
document.addEventListener('DOMContentLoaded', function() {
3+
// Find the header's right section
4+
const headerRight = document.querySelector('header .ml-auto');
5+
if (!headerRight) return;
6+
7+
// Create language selector container
8+
const langSelector = document.createElement('div');
9+
langSelector.className = 'language-selector flex items-center gap-2';
10+
langSelector.innerHTML = `
11+
<a href="https://docs.eitri.tech/en/"
12+
class="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all hover:bg-accent hover:text-accent-foreground rounded-md px-3 h-8"
13+
title="English">
14+
EN
15+
</a>
16+
<span class="text-muted-foreground">|</span>
17+
<a href="https://docs.eitri.tech/pt/"
18+
class="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all hover:bg-accent hover:text-accent-foreground rounded-md px-3 h-8"
19+
title="Português">
20+
PT
21+
</a>
22+
`;
23+
24+
// Insert before the theme toggle button
25+
const themeButton = headerRight.querySelector('button[title="Toggle theme"]');
26+
if (themeButton) {
27+
// Insert separator and language selector before theme button
28+
const separator = document.createElement('div');
29+
separator.setAttribute('data-orientation', 'vertical');
30+
separator.setAttribute('role', 'none');
31+
separator.setAttribute('data-slot', 'separator');
32+
separator.className = 'bg-border shrink-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px hidden lg:block';
33+
34+
themeButton.parentNode.insertBefore(separator, themeButton);
35+
themeButton.parentNode.insertBefore(langSelector, themeButton);
36+
}
37+
});

en/docs/quick-guides/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Quick Guides
22
nav:
3+
- index.md
34
- create-eitri-app.md
45
- ci-cd.md
56
- functional.md

en/docs/stylesheets/extra.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@
139139
color: #1a1a1a;
140140
}
141141

142+
/* ===========================================
143+
Navbar customizada - esconde GitHub
144+
=========================================== */
145+
146+
/* Esconde o link do GitHub na navbar */
147+
header a[href*="github"],
148+
header a[target="_blank"][rel="noreferrer"] {
149+
display: none !important;
150+
}
151+
152+
/* Esconde o separador antes do GitHub */
153+
header [data-orientation="vertical"][role="none"]:has(+ a[target="_blank"]) {
154+
display: none !important;
155+
}
156+
142157
/* ===========================================
143158
Footer customizado - esconde créditos do tema
144159
=========================================== */

en/mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
site_name: Eitri Docs
2+
site_url: https://docs.eitri.tech/en/
23
docs_dir: 'docs/'
34
site_dir: 'site/'
45
theme:
56
name: shadcn
6-
logo: assets/eitri-logo.svg
7+
# icon: assets/eitri-logo.svg
78
favicon: assets/android-chrome-192x192.png
89
language: en
10+
show_stargazers: false
911
pygments_style:
1012
light: shadcn-light
1113
dark: github-dark
@@ -52,6 +54,9 @@ extra:
5254
extra_css:
5355
- stylesheets/extra.css
5456

57+
extra_javascript:
58+
- javascripts/language-selector.js
59+
5560
copyright:
5661
© 2023 <a href="https://github.com/Calindra" target="_blank" rel="noopener">Calindra</a>
5762

pt/docs/eitri-shopping/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Eitri Shopping
22
nav:
3+
- index.md
34
- exposed-apis.md
45
- recaptcha.md
56
- deeplinks.md
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Language Selector for Eitri Docs
2+
document.addEventListener('DOMContentLoaded', function() {
3+
// Find the header's right section
4+
const headerRight = document.querySelector('header .ml-auto');
5+
if (!headerRight) return;
6+
7+
// Create language selector container
8+
const langSelector = document.createElement('div');
9+
langSelector.className = 'language-selector flex items-center gap-2';
10+
langSelector.innerHTML = `
11+
<a href="https://docs.eitri.tech/en/"
12+
class="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all hover:bg-accent hover:text-accent-foreground rounded-md px-3 h-8"
13+
title="English">
14+
EN
15+
</a>
16+
<span class="text-muted-foreground">|</span>
17+
<a href="https://docs.eitri.tech/pt/"
18+
class="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all hover:bg-accent hover:text-accent-foreground rounded-md px-3 h-8"
19+
title="Português">
20+
PT
21+
</a>
22+
`;
23+
24+
// Insert before the theme toggle button
25+
const themeButton = headerRight.querySelector('button[title="Toggle theme"]');
26+
if (themeButton) {
27+
// Insert separator and language selector before theme button
28+
const separator = document.createElement('div');
29+
separator.setAttribute('data-orientation', 'vertical');
30+
separator.setAttribute('role', 'none');
31+
separator.setAttribute('data-slot', 'separator');
32+
separator.className = 'bg-border shrink-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px hidden lg:block';
33+
34+
themeButton.parentNode.insertBefore(separator, themeButton);
35+
themeButton.parentNode.insertBefore(langSelector, themeButton);
36+
}
37+
});

pt/docs/stylesheets/extra.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@
139139
color: #1a1a1a;
140140
}
141141

142+
/* ===========================================
143+
Navbar customizada - esconde GitHub
144+
=========================================== */
145+
146+
/* Esconde o link do GitHub na navbar */
147+
header a[href*="github"],
148+
header a[target="_blank"][rel="noreferrer"] {
149+
display: none !important;
150+
}
151+
152+
/* Esconde o separador antes do GitHub */
153+
header [data-orientation="vertical"][role="none"]:has(+ a[target="_blank"]) {
154+
display: none !important;
155+
}
156+
142157
/* ===========================================
143158
Footer customizado - esconde créditos do tema
144159
=========================================== */

pt/docs/tutoriais/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Tutoriais
22
nav:
3+
- index.md
34
- create-eitri-app.md
45
- ci-cd.md
56
- functional.md

pt/mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
site_name: Eitri Docs
2+
site_url: https://docs.eitri.tech/pt/
23
docs_dir: "docs/"
34
site_dir: "site/"
45
theme:
@@ -53,6 +54,9 @@ extra:
5354
extra_css:
5455
- stylesheets/extra.css
5556

57+
extra_javascript:
58+
- javascripts/language-selector.js
59+
5660
copyright: © 2023 <a href="https://github.com/Calindra" target="_blank" rel="noopener">Calindra</a>
5761

5862
# Extensões para features markdown (compatíveis com shadcn)

0 commit comments

Comments
 (0)