Skip to content

Commit 001413d

Browse files
authored
Merge pull request #2 from github/brunoborges-add-front-page-footer
Match front page footer to GitHub.com
2 parents 20954a3 + e7da931 commit 001413d

4 files changed

Lines changed: 110 additions & 67 deletions

File tree

es/index.html

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
</head>
4646
<body>
4747
<div style="position:fixed;top:1rem;right:1rem;z-index:1000;display:flex;gap:0.5rem;align-items:center;">
48-
<div class="locale-picker" id="localePicker">
49-
<button type="button" class="locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Seleccionar idioma">🌐</button>
50-
<ul role="listbox" aria-label="Idioma">
51-
<li role="option" data-locale="en" aria-selected="false">🇬🇧 English</li>
52-
<li role="option" data-locale="es" aria-selected="true" class="active">🇪🇸 Español</li>
53-
<li role="option" data-locale="pt-BR" aria-selected="false">🇧🇷 Português (Brasil)</li>
54-
</ul>
55-
</div>
5648
<button class="theme-toggle" onclick="toggleTheme()">☀️ Light</button>
5749
</div>
5850

@@ -352,6 +344,20 @@ <h2 class="section-title">Requisitos Previos</h2>
352344
</div>
353345
<p class="footer-credit">Hecho con 💜 por el equipo de GitHub Copilot</p>
354346
<p class="footer-credit" style="margin-top: 1rem;">Organizadores de GitHub Copilot Dev Days, visita <a href="https://github.com/github/GitHub-Copilot-Dev-Days/" target="_blank" style="color: var(--neon-cyan);">github.com/github/GitHub-Copilot-Dev-Days</a> para más información.</p>
347+
<div class="footer-locale-picker">
348+
<div class="locale-picker" id="localePicker">
349+
<button type="button" class="locale-toggle footer-locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Seleccionar idioma">
350+
<svg class="locale-globe" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.36 4.18c.26.43.55.83.86 1.21.25-.3.55-.7.86-1.21a9.64 9.64 0 0 0 1.36-4.18Zm4.44-1.5a9.64 9.64 0 0 0-1.36-4.18A9.93 9.93 0 0 0 8 1.86a9.93 9.93 0 0 0-.86 1.21A9.64 9.64 0 0 0 5.78 7.25Zm-5.94 1.5H1.54a6.51 6.51 0 0 0 4.67 5.5c-.12-.18-.24-.37-.35-.55-.72-1.19-1.44-2.88-1.58-4.95Zm-2.74-1.5h2.74c.14-2.07.86-3.76 1.58-4.95.12-.2.23-.38.35-.55a6.51 6.51 0 0 0-4.67 5.5Zm10.18 1.5c-.14 2.07-.86 3.76-1.58 4.95-.12.2-.23.38-.35.55a6.51 6.51 0 0 0 4.67-5.5Zm2.74-1.5a6.51 6.51 0 0 0-4.67-5.5c.12.18.24.37.35.55.72 1.19 1.44 2.88 1.58 4.95Z"/></svg>
351+
<span class="locale-current">Español</span>
352+
<svg class="locale-chevron" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.78 5.22a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 1 1 1.06-1.06L8 8.94l3.72-3.72a.75.75 0 0 1 1.06 0Z"/></svg>
353+
</button>
354+
<ul role="listbox" aria-label="Idioma">
355+
<li role="option" data-locale="en" aria-selected="false">🇬🇧 English</li>
356+
<li role="option" data-locale="es" aria-selected="true" class="active">🇪🇸 Español</li>
357+
<li role="option" data-locale="pt-BR" aria-selected="false">🇧🇷 Português (Brasil)</li>
358+
</ul>
359+
</div>
360+
</div>
355361
</div>
356362
</footer>
357363
<script>
@@ -372,12 +378,14 @@ <h2 class="section-title">Requisitos Previos</h2>
372378
</script>
373379
<script>
374380
(function () {
375-
var match = location.pathname.match(/^\/(pt_BR|es)\//);
381+
var match = location.pathname.match(/\/(pt_BR|es)(?:\/|$)/);
376382
var locale = match ? match[1] : 'en';
377383
var picker = document.getElementById('localePicker');
378384
if (!picker) return;
379385
var toggleBtn = picker.querySelector('.locale-toggle');
380386
var list = picker.querySelector('ul');
387+
var labels = { en: 'English', es: 'Español', pt_BR: 'Português (Brasil)' };
388+
picker.querySelector('.locale-current').textContent = labels[locale] || labels.en;
381389
list.querySelectorAll('li').forEach(function(li) {
382390
var liLocale = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
383391
if (liLocale === locale) { li.classList.add('active'); li.setAttribute('aria-selected','true'); }
@@ -393,11 +401,10 @@ <h2 class="section-title">Requisitos Previos</h2>
393401
e.stopPropagation();
394402
var target = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
395403
if (target === locale) { close(); return; }
396-
var path = location.pathname;
397-
if (locale !== 'en') path = path.replace(new RegExp('^/' + locale), '');
398-
if (target !== 'en') path = '/' + target + path;
404+
var base = locale === 'en' ? new URL('./', location.href) : new URL('../', location.href);
405+
var path = target === 'en' ? './' : target + '/';
399406
localStorage.setItem('preferred-locale', target);
400-
window.location.href = path;
407+
window.location.href = new URL(path, base).href;
401408
});
402409
});
403410
})();

index.html

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
</head>
4646
<body>
4747
<div style="position:fixed;top:1rem;right:1rem;z-index:1000;display:flex;gap:0.5rem;align-items:center;">
48-
<div class="locale-picker" id="localePicker">
49-
<button type="button" class="locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Select language">🌐</button>
50-
<ul role="listbox" aria-label="Language">
51-
<li role="option" data-locale="en" aria-selected="true" class="active">🇬🇧 English</li>
52-
<li role="option" data-locale="es" aria-selected="false">🇪🇸 Español</li>
53-
<li role="option" data-locale="pt-BR" aria-selected="false">🇧🇷 Português (Brasil)</li>
54-
</ul>
55-
</div>
5648
<button class="theme-toggle" onclick="toggleTheme()">☀️ Light</button>
5749
</div>
5850

@@ -353,19 +345,29 @@ <h2 class="section-title">General Prerequisites</h2>
353345
<p class="footer-credit">Built with 💜 by the GitHub Copilot Team</p>
354346
<p class="footer-credit" style="margin-top: 1rem;">Organizers of GitHub Copilot Dev Days, visit <a href="https://github.com/github/GitHub-Copilot-Dev-Days/" target="_blank" style="color: var(--neon-cyan);">github.com/github/GitHub-Copilot-Dev-Days</a> for more information.</p>
355347
</div>
356-
<div class="subfooter container">
357-
<nav aria-label="Legal and resource links">
358-
<ul class="subfooter-legal">
359-
<li><time datetime="2026">© 2026 GitHub, Inc.</time></li>
360-
<li><a href="https://docs.github.com/site-policy/github-terms/github-terms-of-service">Terms</a></li>
361-
<li><a href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement">Privacy</a></li>
362-
<li><a href="https://docs.github.com/site-policy/privacy-policies/github-cookies">Manage cookies</a></li>
363-
<li><a href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement#privacy-choices">Do not share my personal information</a></li>
364-
</ul>
365-
</nav>
366-
<div class="subfooter-social-and-locale">
367-
<nav aria-label="GitHub social media links">
368-
<ul class="social-links">
348+
<div class="subfooter-bar">
349+
<div class="subfooter">
350+
<nav aria-label="Legal and Resource Links" class="subfooter-legal-nav">
351+
<ul class="subfooter-legal">
352+
<li class="subfooter-copyright"><time datetime="2026">© 2026 GitHub, Inc.</time></li>
353+
<li><a href="https://docs.github.com/site-policy/github-terms/github-terms-of-service">Terms</a></li>
354+
<li><a href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement">Privacy</a></li>
355+
<li>
356+
<!-- Hydrated by the dotcom asset pipeline to open GitHub's shared OneTrust UI. -->
357+
<cookie-consent-link>
358+
<button
359+
type="button"
360+
class="cookie-button"
361+
data-action="click:cookie-consent-link#showConsentManagement"
362+
data-analytics-event='{"location":"footer","tag":"link","action":"cookies","context":"subfooter"}'
363+
>Manage cookies</button>
364+
</cookie-consent-link>
365+
</li>
366+
</ul>
367+
</nav>
368+
<div class="subfooter-social-and-locale">
369+
<nav aria-label="GitHub's Social Media Links">
370+
<ul class="social-links">
369371
<li>
370372
<a href="https://www.linkedin.com/company/github" aria-label="GitHub on LinkedIn">
371373
<svg viewBox="0 0 19 18" aria-hidden="true"><path d="M3.94 2A2 2 0 1 1 2 0a2 2 0 0 1 1.94 2zM4 5.48H0V18h4zm6.32 0H6.34V18h3.94v-6.57c0-3.66 4.77-4 4.77 0V18H19v-7.93c0-6.17-7.06-5.94-8.72-2.91z"/></svg>
@@ -401,8 +403,21 @@ <h2 class="section-title">General Prerequisites</h2>
401403
<svg viewBox="0 0 98 96" aria-hidden="true"><path d="M48.85 0C21.84 0 0 22 0 49.22c0 21.75 13.99 40.17 33.41 46.69 2.42.49 3.31-1.06 3.31-2.36 0-1.14-.08-5.05-.08-9.13-13.59 2.94-16.42-5.87-16.42-5.87-2.18-5.7-5.42-7.17-5.42-7.17-4.45-3.01.33-3.01.33-3.01 4.93.32 7.52 5.05 7.52 5.05 4.37 7.5 11.4 5.38 14.24 4.07.4-3.18 1.7-5.38 3.07-6.6-10.84-1.14-22.24-5.38-22.24-24.28 0-5.38 1.94-9.78 5.01-13.2-.48-1.22-2.18-6.28.49-13.04 0 0 4.12-1.3 13.42 5.05a46.97 46.97 0 0 1 12.22-1.63c4.12 0 8.33.57 12.21 1.63 9.3-6.35 13.43-5.05 13.43-5.05 2.67 6.76.97 11.82.48 13.04 3.16 3.42 5.02 7.82 5.02 13.2 0 18.9-11.4 23.06-22.32 24.28 1.78 1.55 3.31 4.48 3.31 9.13 0 6.6-.08 11.9-.08 13.53 0 1.3.89 2.85 3.32 2.36 19.41-6.52 33.4-24.94 33.4-46.69C97.71 22 75.79 0 48.85 0z"/></svg>
402404
</a>
403405
</li>
404-
</ul>
405-
</nav>
406+
</ul>
407+
</nav>
408+
<div class="locale-picker" id="localePicker">
409+
<button type="button" class="locale-toggle footer-locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Select language">
410+
<svg class="locale-globe" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.36 4.18c.26.43.55.83.86 1.21.25-.3.55-.7.86-1.21a9.64 9.64 0 0 0 1.36-4.18Zm4.44-1.5a9.64 9.64 0 0 0-1.36-4.18A9.93 9.93 0 0 0 8 1.86a9.93 9.93 0 0 0-.86 1.21A9.64 9.64 0 0 0 5.78 7.25Zm-5.94 1.5H1.54a6.51 6.51 0 0 0 4.67 5.5c-.12-.18-.24-.37-.35-.55-.72-1.19-1.44-2.88-1.58-4.95Zm-2.74-1.5h2.74c.14-2.07.86-3.76 1.58-4.95.12-.2.23-.38.35-.55a6.51 6.51 0 0 0-4.67 5.5Zm10.18 1.5c-.14 2.07-.86 3.76-1.58 4.95-.12.2-.23.38-.35.55a6.51 6.51 0 0 0 4.67-5.5Zm2.74-1.5a6.51 6.51 0 0 0-4.67-5.5c.12.18.24.37.35.55.72 1.19 1.44 2.88 1.58 4.95Z"/></svg>
411+
<span class="locale-current">English</span>
412+
<svg class="locale-chevron" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.78 5.22a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 1 1 1.06-1.06L8 8.94l3.72-3.72a.75.75 0 0 1 1.06 0Z"/></svg>
413+
</button>
414+
<ul role="listbox" aria-label="Language">
415+
<li role="option" data-locale="en" aria-selected="true" class="active">🇬🇧 English</li>
416+
<li role="option" data-locale="es" aria-selected="false">🇪🇸 Español</li>
417+
<li role="option" data-locale="pt-BR" aria-selected="false">🇧🇷 Português (Brasil)</li>
418+
</ul>
419+
</div>
420+
</div>
406421
</div>
407422
</div>
408423
</footer>
@@ -424,12 +439,14 @@ <h2 class="section-title">General Prerequisites</h2>
424439
</script>
425440
<script>
426441
(function () {
427-
var match = location.pathname.match(/^\/(pt_BR|es)\//);
442+
var match = location.pathname.match(/\/(pt_BR|es)(?:\/|$)/);
428443
var locale = match ? match[1] : 'en';
429444
var picker = document.getElementById('localePicker');
430445
if (!picker) return;
431446
var toggleBtn = picker.querySelector('.locale-toggle');
432447
var list = picker.querySelector('ul');
448+
var labels = { en: 'English', es: 'Español', pt_BR: 'Português (Brasil)' };
449+
picker.querySelector('.locale-current').textContent = labels[locale] || labels.en;
433450
list.querySelectorAll('li').forEach(function(li) {
434451
var liLocale = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
435452
if (liLocale === locale) { li.classList.add('active'); li.setAttribute('aria-selected','true'); }
@@ -445,11 +462,10 @@ <h2 class="section-title">General Prerequisites</h2>
445462
e.stopPropagation();
446463
var target = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
447464
if (target === locale) { close(); return; }
448-
var path = location.pathname;
449-
if (locale !== 'en') path = path.replace(new RegExp('^/' + locale), '');
450-
if (target !== 'en') path = '/' + target + path;
465+
var base = locale === 'en' ? new URL('./', location.href) : new URL('../', location.href);
466+
var path = target === 'en' ? './' : target + '/';
451467
localStorage.setItem('preferred-locale', target);
452-
window.location.href = path;
468+
window.location.href = new URL(path, base).href;
453469
});
454470
});
455471
})();

pt_BR/index.html

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
</head>
4646
<body>
4747
<div style="position:fixed;top:1rem;right:1rem;z-index:1000;display:flex;gap:0.5rem;align-items:center;">
48-
<div class="locale-picker" id="localePicker">
49-
<button type="button" class="locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Selecionar idioma">🌐</button>
50-
<ul role="listbox" aria-label="Idioma">
51-
<li role="option" data-locale="en" aria-selected="false">🇬🇧 English</li>
52-
<li role="option" data-locale="es" aria-selected="false">🇪🇸 Español</li>
53-
<li role="option" data-locale="pt-BR" aria-selected="true" class="active">🇧🇷 Português (Brasil)</li>
54-
</ul>
55-
</div>
5648
<button class="theme-toggle" onclick="toggleTheme()">☀️ Light</button>
5749
</div>
5850

@@ -352,6 +344,20 @@ <h2 class="section-title">Pré-requisitos Gerais</h2>
352344
</div>
353345
<p class="footer-credit">Feito com 💜 pelo time do GitHub Copilot</p>
354346
<p class="footer-credit" style="margin-top: 1rem;">Organizadores do GitHub Copilot Dev Days, visite <a href="https://github.com/github/GitHub-Copilot-Dev-Days/" target="_blank" style="color: var(--neon-cyan);">github.com/github/GitHub-Copilot-Dev-Days</a> para mais informações.</p>
347+
<div class="footer-locale-picker">
348+
<div class="locale-picker" id="localePicker">
349+
<button type="button" class="locale-toggle footer-locale-toggle" aria-haspopup="listbox" aria-expanded="false" aria-label="Selecionar idioma">
350+
<svg class="locale-globe" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.36 4.18c.26.43.55.83.86 1.21.25-.3.55-.7.86-1.21a9.64 9.64 0 0 0 1.36-4.18Zm4.44-1.5a9.64 9.64 0 0 0-1.36-4.18A9.93 9.93 0 0 0 8 1.86a9.93 9.93 0 0 0-.86 1.21A9.64 9.64 0 0 0 5.78 7.25Zm-5.94 1.5H1.54a6.51 6.51 0 0 0 4.67 5.5c-.12-.18-.24-.37-.35-.55-.72-1.19-1.44-2.88-1.58-4.95Zm-2.74-1.5h2.74c.14-2.07.86-3.76 1.58-4.95.12-.2.23-.38.35-.55a6.51 6.51 0 0 0-4.67 5.5Zm10.18 1.5c-.14 2.07-.86 3.76-1.58 4.95-.12.2-.23.38-.35.55a6.51 6.51 0 0 0 4.67-5.5Zm2.74-1.5a6.51 6.51 0 0 0-4.67-5.5c.12.18.24.37.35.55.72 1.19 1.44 2.88 1.58 4.95Z"/></svg>
351+
<span class="locale-current">Português (Brasil)</span>
352+
<svg class="locale-chevron" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.78 5.22a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 1 1 1.06-1.06L8 8.94l3.72-3.72a.75.75 0 0 1 1.06 0Z"/></svg>
353+
</button>
354+
<ul role="listbox" aria-label="Idioma">
355+
<li role="option" data-locale="en" aria-selected="false">🇬🇧 English</li>
356+
<li role="option" data-locale="es" aria-selected="false">🇪🇸 Español</li>
357+
<li role="option" data-locale="pt-BR" aria-selected="true" class="active">🇧🇷 Português (Brasil)</li>
358+
</ul>
359+
</div>
360+
</div>
355361
</div>
356362
</footer>
357363
<script>
@@ -372,12 +378,14 @@ <h2 class="section-title">Pré-requisitos Gerais</h2>
372378
</script>
373379
<script>
374380
(function () {
375-
var match = location.pathname.match(/^\/(pt_BR|es)\//);
381+
var match = location.pathname.match(/\/(pt_BR|es)(?:\/|$)/);
376382
var locale = match ? match[1] : 'en';
377383
var picker = document.getElementById('localePicker');
378384
if (!picker) return;
379385
var toggleBtn = picker.querySelector('.locale-toggle');
380386
var list = picker.querySelector('ul');
387+
var labels = { en: 'English', es: 'Español', pt_BR: 'Português (Brasil)' };
388+
picker.querySelector('.locale-current').textContent = labels[locale] || labels.en;
381389
list.querySelectorAll('li').forEach(function(li) {
382390
var liLocale = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
383391
if (liLocale === locale) { li.classList.add('active'); li.setAttribute('aria-selected','true'); }
@@ -393,11 +401,10 @@ <h2 class="section-title">Pré-requisitos Gerais</h2>
393401
e.stopPropagation();
394402
var target = li.dataset.locale === 'pt-BR' ? 'pt_BR' : li.dataset.locale;
395403
if (target === locale) { close(); return; }
396-
var path = location.pathname;
397-
if (locale !== 'en') path = path.replace(new RegExp('^/' + locale), '');
398-
if (target !== 'en') path = '/' + target + path;
404+
var base = locale === 'en' ? new URL('./', location.href) : new URL('../', location.href);
405+
var path = target === 'en' ? './' : target + '/';
399406
localStorage.setItem('preferred-locale', target);
400-
window.location.href = path;
407+
window.location.href = new URL(path, base).href;
401408
});
402409
});
403410
})();

0 commit comments

Comments
 (0)