Skip to content

Commit fce6e02

Browse files
Travis1282twsl
andauthored
feat: New header GitHub stars (#3040)
* Enable SQLite on Azure App Services (#1720) Add connectection_created hook for WAL * update header with working search * new release ribbon * new footer * footer transition * sidebar fixes * footer on docs with transition * docsearch styled and type entered focus * git hub stars component * update ribbon * add active state to nav on page load * update header/footer links * fetch github stars * remove auth from star fetch Co-authored-by: twsl <[email protected]>
1 parent 5c107b0 commit fce6e02

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

docs/themes/htx/layout/partials/github_stars.ejs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
<style>
77
.GitHubStars {
8-
padding: 0 2em;
98
display: flex;
109
gap: 0.25em;
1110
align-items: center;
@@ -31,17 +30,16 @@
3130
</style>
3231

3332
<script>
34-
window.addEventListener('load', async () => {
35-
let starCount = 10688
36-
// const response = await fetch("https://api.github.com/repos/heartexlabs/label-studio", {
37-
// headers: {
38-
// Authorization: `token ${import.meta.env.GITHUB_TOKEN}`
39-
// }
40-
// })
41-
// const data = response.json();
42-
// starCount = data.stargazers_count
43-
44-
const countElement = document.querySelector('.GitHubStarsText')
45-
countElement.innerText = starCount.toLocaleString('en-US');
33+
window.addEventListener('load', async () => {
34+
try {
35+
const response = await fetch("https://api.github.com/repos/heartexlabs/label-studio", {
36+
});
37+
const data = await response.json();
38+
starCount = data.stargazers_count;
39+
const countElement = document.querySelector('.GitHubStarsText');
40+
countElement.innerText = starCount.toLocaleString('en-US');
41+
} catch (err) {
42+
console.log(err);
43+
}
4644
});
4745
</script>

docs/themes/htx/source/css/header-footer.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,13 @@ body{
284284
}
285285
.mainHeader:where(.astro-7IFFX3A3){
286286
background-color:var(--color-white);
287+
padding:1.5em 0;
287288
position:relative;
288289
z-index:2
289290
}
290291
.Header:where(.astro-7IFFX3A3){
291292
display:flex;
293+
border:1px solid var(--color-gray-900);
292294
position:relative;
293295
min-height:52px;
294296
align-items:center
@@ -430,12 +432,13 @@ body{
430432
margin-left:initial;
431433
align-items:flex-start;
432434
position:absolute;
433-
top:52px;
435+
top:50px;
434436
left:-1px;
435437
z-index:2;
436438
width:calc(100% + 2px);
437439
background-color:var(--color-white);
438440
border:1px var(--color-gray-900) solid;
441+
border-top-color:var(--color-white);
439442
padding:.5em 1em 1em;
440443
display:none
441444
}

docs/themes/htx/source/css/page.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
position: static
303303
.sidebar
304304
position: fixed
305-
z-index: 100
305+
z-index: 0
306306

307307
@media (max-width: 991px)
308308
.sidebar

0 commit comments

Comments
 (0)