Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ markup:
# noClasses is false — Hugo/Chroma only emits semantic CSS classes
# (.chroma .k, .s, .c, ...) and the actual colors come from the
# hand-written Flatcar light theme in
# themes/flatcar/assets/scss/_syntax.scss. A dark variant is
# parked in _syntax-dark.scss.parked for future dark-mode work.
# themes/flatcar/assets/scss/_syntax.scss, with the dark variant in
# _syntax-dark.scss (scoped under [data-bs-theme="dark"]).
style: github
guessSyntax: true
noClasses: false
Expand Down
7 changes: 7 additions & 0 deletions content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Blog
hero:
merge: true
description: ""
buttons: []
---
199 changes: 0 additions & 199 deletions static/js/common.js

This file was deleted.

20 changes: 15 additions & 5 deletions themes/flatcar/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function closeMenu(elem) {
// Dropdown navigation for mobile
document.querySelectorAll(".nav-item.dropdown .nav-link").forEach(function(item) {
item.addEventListener("click", function(e) {
// Skip theme dropdown - it has its own handling
if (this.classList.contains('theme-switcher__toggle')) {
e.preventDefault();
return;
}
e.preventDefault();
Comment thread
Copilot marked this conversation as resolved.
if(document.body.classList.contains('mobile-menu_open')) {
if(!this.classList.contains('nav-link_selected')) {
Expand Down Expand Up @@ -52,12 +57,13 @@ document.querySelectorAll(".nav-item.dropdown .nav-link").forEach(function(item)
}
});

// Close menu on link clicks
// Close menu on nav/dropdown click
[".nav-link", ".dropdown-item"].forEach(className =>
document.querySelectorAll(className).forEach(function(item) {
item.addEventListener("click", function(e) {
if (this.closest('.theme-switcher__menu')) return;
closeMenu(this);
});
})
})
);

Expand All @@ -68,7 +74,7 @@ function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i < ca.length; i++) {
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
Expand All @@ -83,7 +89,10 @@ function getCookie(cname) {
// Copy button for code blocks
document.querySelectorAll('.code-block .btn-copy').forEach(function(btn) {
btn.addEventListener('click', function() {
var code = btn.closest('.code-block').querySelector('code');
var block = btn.closest('.code-block');
// With line numbers, code is in the second td; otherwise just find <code>
var codeTd = block.querySelector('.lntd:last-child code');
var code = codeTd || block.querySelector('code');
if (!code) return;
navigator.clipboard.writeText(code.textContent).then(function() {
btn.innerHTML = '<i class="fa-solid fa-check"></i>';
Expand All @@ -94,6 +103,7 @@ document.querySelectorAll('.code-block .btn-copy').forEach(function(btn) {
});
});


// TOC scroll tracking - highlight active section in "On This Page"
(function() {
var toc = document.getElementById('TableOfContents');
Expand Down Expand Up @@ -192,4 +202,4 @@ document.querySelectorAll(".contact-cookies-consent-notice").forEach(
item.classList.remove("d-none");
}
}
);
);
Loading
Loading