Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 2c1f5f8

Browse files
author
Marcin
committed
add gh stars button
1 parent 57b845e commit 2c1f5f8

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

docusaurus.config.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ const config: Config = {
2929
locales: ["en"],
3030
},
3131

32+
scripts: [
33+
{
34+
src: "/js/load-buttons.js",
35+
async: true,
36+
defer: true
37+
}
38+
],
39+
3240
presets: [
3341
[
3442
"classic",
@@ -63,7 +71,6 @@ const config: Config = {
6371
} satisfies Preset.Options,
6472
],
6573
],
66-
6774
themeConfig: {
6875
// Replace with your project's social card
6976
image: "img/docusaurus-social-card.jpg",
@@ -86,6 +93,16 @@ const config: Config = {
8693
label: "GitHub",
8794
position: "right",
8895
},
96+
{
97+
position: 'right',
98+
href: "https://github.com/MapGrab/map-grab-packages",
99+
label: "Stars",
100+
className: "github-button",
101+
"data-color-scheme": "no-preference: light; light: light; dark: dark;",
102+
"data-size": "large",
103+
"data-show-count": true,
104+
'aria-label': "Star buttons/github-buttons on GitHub"
105+
}
89106
],
90107
},
91108
footer: {

src/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@ pre code:has(.code-block-diff-add-line) {
7474

7575
pre code:has(.code-block-diff-remove-line) {
7676
padding-left: 40px!important;
77+
}
78+
79+
.navbar__items--right > span {
80+
margin: 6px 6px 0;
7781
}

static/js/load-buttons.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(() => {
2+
const init = () => {
3+
const src = "https://buttons.github.io/buttons.js";
4+
const s = document.createElement("script");
5+
s.setAttribute("src", src);
6+
document.body.appendChild(s);
7+
};
8+
9+
[500, 1000, 2000].forEach((time) => {
10+
setTimeout(() => {
11+
init();
12+
}, time);
13+
});
14+
15+
init();
16+
})();

0 commit comments

Comments
 (0)