Skip to content

Commit 7657c7b

Browse files
SliDeeNclaude
andcommitted
Site: add Discussion and Bug/idea buttons to the header
Header links to GitHub Discussions (new discussion) and Issues (new issue chooser). Icon + label on wide screens, icon only below 1240 px, and in the mobile menu on phones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent df027e5 commit 7657c7b

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎docs/assets/css/site.css‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ p { margin: 0 0 .9em; }
107107
.nav::-webkit-scrollbar { display: none; }
108108
.nav a {
109109
color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
110-
padding: 7px 10px; border-radius: 8px; white-space: nowrap;
110+
padding: 7px 8px; border-radius: 8px; white-space: nowrap;
111111
}
112112
.nav a:hover, .nav a.on { color: var(--ink); background: var(--bg-alt); }
113113
@media (min-width: 980px) { .nav { display: flex; } }
@@ -121,6 +121,20 @@ p { margin: 0 0 .9em; }
121121
}
122122
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
123123
.icon-btn svg { width: 18px; height: 18px; }
124+
/* Liens GitHub (discussion, bug / suggestion) : icône + texte sur grand écran, icône seule en
125+
dessous, et dans le menu ☰ sur téléphone où l'en-tête n'a plus la place. */
126+
.head-link {
127+
display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 9px;
128+
border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
129+
font: 600 13px var(--font); text-decoration: none; white-space: nowrap; flex: 0 0 auto;
130+
}
131+
.head-link:hover { color: var(--ink); border-color: var(--ink-3); }
132+
.head-link svg { width: 17px; height: 17px; flex: 0 0 auto; }
133+
@media (max-width: 1099px) { .nav a { padding: 7px 6px; } }
134+
@media (max-width: 1239px) { .head-link { width: 36px; padding: 0; justify-content: center; } .head-link-txt { display: none; } }
135+
@media (max-width: 559px) { .head-link { display: none; } }
136+
.mobile-nav .mn-ext { font-weight: 600; color: var(--ink); }
137+
@media (min-width: 560px) { .mobile-nav .mn-ext { display: none; } }
124138
.menu-btn { display: inline-grid; }
125139
@media (min-width: 980px) { .menu-btn { display: none; } }
126140
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 10px 16px 16px; }

‎docs/assets/js/site.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
const md = document.querySelector('meta[name="description"]');
3030
if (md && md.getAttribute('data-' + l)) md.setAttribute('content', md.getAttribute('data-' + l));
3131
document.querySelectorAll('[data-lang-btn]').forEach((b) => b.setAttribute('aria-pressed', b.getAttribute('data-lang-btn') === l ? 'true' : 'false'));
32-
document.querySelectorAll('[data-aria-fr]').forEach((n) => n.setAttribute('aria-label', n.getAttribute('data-aria-' + l)));
32+
document.querySelectorAll('[data-aria-fr]').forEach((n) => {
33+
n.setAttribute('aria-label', n.getAttribute('data-aria-' + l));
34+
if (n.hasAttribute('title')) n.title = n.getAttribute('data-aria-' + l); // infobulle dans la même langue
35+
});
3336
if (window.MG4Sim) window.MG4Sim.refresh();
3437
refreshWidgets();
3538
}

‎docs/index.html‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
<a href="#installation">Installation</a>
5757
</nav>
5858
<div class="head-tools">
59+
<a class="head-link" href="https://github.com/SliDeeN/MG4Control/discussions/new/choose" data-aria-fr="Ouvrir une discussion sur GitHub" data-aria-en="Start a discussion on GitHub" aria-label="Ouvrir une discussion sur GitHub" title="Ouvrir une discussion sur GitHub">
60+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a8.5 8.5 0 0 1-12.4 7.5L3 21l1.5-5.1A8.5 8.5 0 1 1 21 12z"/><path d="M8.5 11h7M8.5 14.5h4"/></svg>
61+
<span class="head-link-txt"><span data-l="fr">Discuter</span><span data-l="en">Discuss</span></span>
62+
</a>
63+
<a class="head-link" href="https://github.com/SliDeeN/MG4Control/issues/new/choose" data-aria-fr="Signaler un bug ou proposer une idée sur GitHub" data-aria-en="Report a bug or suggest an idea on GitHub" aria-label="Signaler un bug ou proposer une idée sur GitHub" title="Signaler un bug ou proposer une idée sur GitHub">
64+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="6" width="8" height="14" rx="4"/><path d="M12 10v10M8 11H4M8 16H4M16 11h4M16 16h4M9.5 3.5 11 6M14.5 3.5 13 6"/></svg>
65+
<span class="head-link-txt"><span data-l="fr">Bug ou suggestion</span><span data-l="en">Bug or idea</span></span>
66+
</a>
5967
<div class="seg" role="group" aria-label="Langue / Language">
6068
<button type="button" data-lang-btn="fr" aria-pressed="true">FR</button>
6169
<button type="button" data-lang-btn="en" aria-pressed="false">EN</button>
@@ -72,6 +80,8 @@
7280
</div>
7381
</div>
7482
<nav class="mobile-nav" aria-label="Sections">
83+
<a class="mn-ext" href="https://github.com/SliDeeN/MG4Control/discussions/new/choose">💬 <span data-l="fr">Ouvrir une discussion</span><span data-l="en">Start a discussion</span></a>
84+
<a class="mn-ext" href="https://github.com/SliDeeN/MG4Control/issues/new/choose">🐞 <span data-l="fr">Bug ou suggestion</span><span data-l="en">Bug or idea</span></a>
7585
<a href="#fonctionnalites"><span data-l="fr">Fonctionnalités</span><span data-l="en">Features</span></a>
7686
<a href="#fonctionnalites" data-new-link><span data-l="fr">Nouveautés 2.6.7</span><span data-l="en">What's new in 2.6.7</span></a>
7787
<a href="#api"><span data-l="fr">API externe</span><span data-l="en">External API</span></a>

0 commit comments

Comments
 (0)