Skip to content

Commit 3c51df7

Browse files
authored
Add header slack button (#122)
* Add a join slack button to the header with support for light and dark mode Signed-off-by: Pete Cheslock <[email protected]> * Stop auto opening a browser on launch Signed-off-by: Pete Cheslock <[email protected]> --------- Signed-off-by: Pete Cheslock <[email protected]>
1 parent 674e7ee commit 3c51df7

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ const config = {
172172
position: 'right',
173173
value: '<iframe src="https://ghbtns.com/github-btn.html?user=llm-d&repo=llm-d&type=star&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub Star" style="vertical-align: middle;"></iframe>',
174174
},
175+
{
176+
type: 'html',
177+
position: 'right',
178+
value: '<a href="/slack" class="navbar-slack-button"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>Slack</title><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"></path></svg>Join Slack</a>',
179+
},
175180
],
176181
},
177182

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
7-
"start": "docusaurus start",
7+
"start": "docusaurus start --no-open",
88
"build": "docusaurus build",
99
"swizzle": "docusaurus swizzle",
1010
"deploy": "docusaurus deploy",
1111
"clear": "docusaurus clear",
12-
"serve": "docusaurus serve",
12+
"serve": "docusaurus serve --no-open",
1313
"write-translations": "docusaurus write-translations",
1414
"write-heading-ids": "docusaurus write-heading-ids",
1515
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand"

src/css/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,34 @@ display: none !important;
113113
transform: scale(1.05);
114114
}
115115

116+
/* Navbar Slack button */
117+
.navbar-slack-button {
118+
display: inline-flex;
119+
align-items: center;
120+
gap: 6px;
121+
padding: 6px 12px;
122+
background-color: transparent;
123+
color: var(--ifm-navbar-link-color);
124+
text-decoration: none;
125+
border-radius: 6px;
126+
font-family: var(--ifm-font-family-base);
127+
font-size: 1rem;
128+
font-weight: var(--ifm-font-weight-semibold);
129+
vertical-align: middle;
130+
margin-left: 8px;
131+
transition: background-color 0.2s ease;
132+
}
133+
134+
.navbar-slack-button:hover {
135+
background-color: #f0f0f0;
136+
color: var(--ifm-navbar-link-hover-color);
137+
text-decoration: none;
138+
}
139+
140+
[data-theme="dark"] .navbar-slack-button:hover {
141+
background-color: #3a3a3a;
142+
}
143+
116144
.header {
117145
display: flex;
118146
align-content: center;

0 commit comments

Comments
 (0)