Skip to content

Commit a9d8ae6

Browse files
committed
update
1 parent d3ad583 commit a9d8ae6

File tree

6 files changed

+638
-1277
lines changed

6 files changed

+638
-1277
lines changed

layouts/blog/single.html

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,6 @@ <h5 class="card-title">{{ .Title }}</h5>
207207
<!-- Sidebar Column -->
208208
<div class="col-lg-4 sidebar-container">
209209
<div class="sticky-top" style="top: 80px;">
210-
<!-- Table of Contents -->
211-
<div id="tableOfContents" class="toc-container mb-5">
212-
<h4 class="toc-title">
213-
<i class="material-icons align-middle me-2">format_list_bulleted</i>
214-
Contents
215-
</h4>
216-
<div id="tocList" class="toc-list"></div>
217-
</div>
218-
219210
<!-- Share Article -->
220211
<div class="share-container mb-5">
221212
<h4 class="share-title mb-3">
@@ -322,50 +313,6 @@ <h4 class="categories-title mb-3">
322313
padding: 0 1rem;
323314
}
324315

325-
/* Table of Contents */
326-
.toc-container {
327-
background-color: var(--light-bg);
328-
border-radius: 0.5rem;
329-
padding: 1.25rem;
330-
position: sticky;
331-
top: 80px;
332-
}
333-
334-
.toc-title {
335-
font-size: 1.25rem;
336-
font-weight: 600;
337-
color: var(--dark-text);
338-
display: flex;
339-
align-items: center;
340-
margin-bottom: 1rem;
341-
}
342-
343-
.toc-list ul {
344-
list-style: none;
345-
padding: 0;
346-
margin: 0;
347-
}
348-
349-
.toc-list li {
350-
margin-bottom: 0.5rem;
351-
}
352-
353-
.toc-list a {
354-
display: block;
355-
padding: 0.5rem;
356-
color: var(--secondary-color);
357-
text-decoration: none;
358-
border-radius: 0.25rem;
359-
transition: all 0.2s ease;
360-
font-size: 0.9rem;
361-
}
362-
363-
.toc-list a:hover, .toc-list a.active {
364-
background-color: rgba(59, 130, 246, 0.1);
365-
color: var(--primary-color);
366-
transform: translateX(5px);
367-
}
368-
369316
/* Share Sidebar */
370317
.share-container, .popular-container, .categories-container {
371318
background-color: var(--light-bg);
@@ -682,6 +629,7 @@ <h4 class="categories-title mb-3">
682629
overflow: hidden;
683630
text-overflow: ellipsis;
684631
display: -webkit-box;
632+
line-clamp: 2;
685633
-webkit-line-clamp: 2;
686634
-webkit-box-orient: vertical;
687635
}
@@ -794,63 +742,6 @@ <h4 class="categories-title mb-3">
794742
progressBar.style.width = '0%';
795743
}
796744
});
797-
798-
// Generate Table of Contents
799-
const tocList = document.getElementById('tocList');
800-
const headings = content.querySelectorAll('h2, h3');
801-
802-
if (headings.length > 0) {
803-
const ul = document.createElement('ul');
804-
805-
headings.forEach((heading, index) => {
806-
const id = `heading-${index}`;
807-
heading.id = id;
808-
809-
const li = document.createElement('li');
810-
const a = document.createElement('a');
811-
a.href = `#${id}`;
812-
a.textContent = heading.textContent;
813-
814-
if (heading.tagName === 'H3') {
815-
a.style.paddingLeft = '1.5rem';
816-
a.style.fontSize = '0.85rem';
817-
}
818-
819-
a.addEventListener('click', function(e) {
820-
e.preventDefault();
821-
window.scrollTo({
822-
top: heading.offsetTop - 60,
823-
behavior: 'smooth'
824-
});
825-
});
826-
827-
li.appendChild(a);
828-
ul.appendChild(li);
829-
});
830-
831-
tocList.appendChild(ul);
832-
833-
// Highlight active TOC item on scroll
834-
const tocLinks = tocList.querySelectorAll('a');
835-
836-
window.addEventListener('scroll', function() {
837-
let currentId = '';
838-
headings.forEach((heading) => {
839-
if (window.scrollY >= heading.offsetTop - 100) {
840-
currentId = heading.id;
841-
}
842-
});
843-
844-
tocLinks.forEach((link) => {
845-
link.classList.remove('active');
846-
if (link.getAttribute('href').substring(1) === currentId) {
847-
link.classList.add('active');
848-
}
849-
});
850-
});
851-
} else {
852-
document.getElementById('tableOfContents').style.display = 'none';
853-
}
854745
});
855746
</script>
856747
{{ end }}

public/blog/arkade-open-source-marketplace-for-kubernetes/index.html

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -825,15 +825,6 @@ <h5 class="author-name mb-2">Sangam Biradar</h5>
825825
<div class="col-lg-4 sidebar-container">
826826
<div class="sticky-top" style="top: 80px;">
827827

828-
<div id="tableOfContents" class="toc-container mb-5">
829-
<h4 class="toc-title">
830-
<i class="material-icons align-middle me-2">format_list_bulleted</i>
831-
Contents
832-
</h4>
833-
<div id="tocList" class="toc-list"></div>
834-
</div>
835-
836-
837828
<div class="share-container mb-5">
838829
<h4 class="share-title mb-3">
839830
<i class="material-icons align-middle me-2">share</i>
@@ -992,50 +983,6 @@ <h4 class="categories-title mb-3">
992983
}
993984

994985

995-
.toc-container {
996-
background-color: var(--light-bg);
997-
border-radius: 0.5rem;
998-
padding: 1.25rem;
999-
position: sticky;
1000-
top: 80px;
1001-
}
1002-
1003-
.toc-title {
1004-
font-size: 1.25rem;
1005-
font-weight: 600;
1006-
color: var(--dark-text);
1007-
display: flex;
1008-
align-items: center;
1009-
margin-bottom: 1rem;
1010-
}
1011-
1012-
.toc-list ul {
1013-
list-style: none;
1014-
padding: 0;
1015-
margin: 0;
1016-
}
1017-
1018-
.toc-list li {
1019-
margin-bottom: 0.5rem;
1020-
}
1021-
1022-
.toc-list a {
1023-
display: block;
1024-
padding: 0.5rem;
1025-
color: var(--secondary-color);
1026-
text-decoration: none;
1027-
border-radius: 0.25rem;
1028-
transition: all 0.2s ease;
1029-
font-size: 0.9rem;
1030-
}
1031-
1032-
.toc-list a:hover, .toc-list a.active {
1033-
background-color: rgba(59, 130, 246, 0.1);
1034-
color: var(--primary-color);
1035-
transform: translateX(5px);
1036-
}
1037-
1038-
1039986
.share-container, .popular-container, .categories-container {
1040987
background-color: var(--light-bg);
1041988
border-radius: 0.5rem;
@@ -1351,6 +1298,7 @@ <h4 class="categories-title mb-3">
13511298
overflow: hidden;
13521299
text-overflow: ellipsis;
13531300
display: -webkit-box;
1301+
line-clamp: 2;
13541302
-webkit-line-clamp: 2;
13551303
-webkit-box-orient: vertical;
13561304
}
@@ -1463,63 +1411,6 @@ <h4 class="categories-title mb-3">
14631411
progressBar.style.width = '0%';
14641412
}
14651413
});
1466-
1467-
1468-
const tocList = document.getElementById('tocList');
1469-
const headings = content.querySelectorAll('h2, h3');
1470-
1471-
if (headings.length > 0) {
1472-
const ul = document.createElement('ul');
1473-
1474-
headings.forEach((heading, index) => {
1475-
const id = `heading-${index}`;
1476-
heading.id = id;
1477-
1478-
const li = document.createElement('li');
1479-
const a = document.createElement('a');
1480-
a.href = `#${id}`;
1481-
a.textContent = heading.textContent;
1482-
1483-
if (heading.tagName === 'H3') {
1484-
a.style.paddingLeft = '1.5rem';
1485-
a.style.fontSize = '0.85rem';
1486-
}
1487-
1488-
a.addEventListener('click', function(e) {
1489-
e.preventDefault();
1490-
window.scrollTo({
1491-
top: heading.offsetTop - 60,
1492-
behavior: 'smooth'
1493-
});
1494-
});
1495-
1496-
li.appendChild(a);
1497-
ul.appendChild(li);
1498-
});
1499-
1500-
tocList.appendChild(ul);
1501-
1502-
1503-
const tocLinks = tocList.querySelectorAll('a');
1504-
1505-
window.addEventListener('scroll', function() {
1506-
let currentId = '';
1507-
headings.forEach((heading) => {
1508-
if (window.scrollY >= heading.offsetTop - 100) {
1509-
currentId = heading.id;
1510-
}
1511-
});
1512-
1513-
tocLinks.forEach((link) => {
1514-
link.classList.remove('active');
1515-
if (link.getAttribute('href').substring(1) === currentId) {
1516-
link.classList.add('active');
1517-
}
1518-
});
1519-
});
1520-
} else {
1521-
document.getElementById('tableOfContents').style.display = 'none';
1522-
}
15231414
});
15241415
</script>
15251416

0 commit comments

Comments
 (0)