Files
HacktivityLabSheets/_layouts/lab.html
Z. Cliffe Schreuders 4788da7beb Enhance lab sheets with action item styling and installation guide
- Added a new Action Items Guide to provide styling classes for highlighting important sections in lab sheets.
- Introduced an INSTALL.md file detailing Jekyll installation and testing procedures.
- Implemented action item and warning item styles in the main stylesheet for better visual distinction.
- Updated lab content to utilize new action item classes for clarity and emphasis on critical instructions.
- Enhanced JavaScript functionality to process custom highlight syntax in lab content.
2025-09-16 00:42:46 +01:00

210 lines
4.8 KiB
HTML

---
layout: default
---
<!-- Theme Toggle Button -->
<div class="theme-toggle-container" style="position: fixed; top: 20px; right: 20px; z-index: 1000;">
<button id="theme-toggle" class="btn btn-sm" style="background-color: var(--primary-btnbg-color); color: white; border: none; border-radius: 20px; padding: 8px 16px;">
<i class="fas fa-moon" id="theme-icon"></i>
</button>
</div>
<article class="lab-content">
<header class="lab-header">
<h1>{{ page.title }}</h1>
{% if page.description %}
<p class="lab-description">{{ page.description }}</p>
{% endif %}
<div class="lab-metadata">
{% if page.difficulty %}
<div class="metadata-item">
<strong>Difficulty:</strong> {{ page.difficulty }}
</div>
{% endif %}
{% if page.duration %}
<div class="metadata-item">
<strong>Estimated Duration:</strong> {{ page.duration }}
</div>
{% endif %}
{% if page.prerequisites %}
<div class="metadata-item">
<strong>Prerequisites:</strong> {{ page.prerequisites }}
</div>
{% endif %}
{% if page.tags %}
<div class="metadata-item">
<strong>Tags:</strong>
{% for tag in page.tags %}
<span class="tag">{{ tag }}</span>
{% endfor %}
</div>
{% endif %}
</div>
</header>
<div class="lab-content-body">
{{ content }}
</div>
<footer class="lab-footer">
<a href="{{ '/' | relative_url }}" class="back-link">← Back to Lab Index</a>
</footer>
</article>
<style>
.lab-content {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
}
.lab-header {
border-bottom: 2px solid var(--panelborder-color);
padding-bottom: 1.5rem;
margin-bottom: 2rem;
}
.lab-header h1 {
margin-bottom: 0.5rem;
color: var(--fg-color);
font-weight: normal;
}
.lab-description {
font-size: 1.125rem;
color: var(--fg-color);
opacity: 0.8;
margin-bottom: 1rem;
}
.lab-metadata {
display: grid;
gap: 0.5rem;
background-color: var(--panelbg-color);
padding: 1rem;
border-radius: 6px;
border: 1px solid var(--panelborder-color);
}
.metadata-item {
font-size: 0.875rem;
color: var(--fg-color);
}
.metadata-item strong {
color: var(--fg-color);
font-weight: 600;
}
.tag {
background-color: var(--primary-btnbg-color);
color: white;
padding: 0.125rem 0.5rem;
border-radius: 12px;
font-size: 0.75rem;
border: 1px solid var(--primary-btnbg-color);
margin-left: 0.25rem;
}
.lab-content-body {
line-height: 1.6;
color: var(--fg-color);
}
.lab-content-body h2 {
border-bottom: 1px solid var(--panelborder-color);
padding-bottom: 0.3rem;
margin-top: 2rem;
margin-bottom: 1rem;
color: var(--fg-color);
}
.lab-content-body h3 {
margin-top: 1.5rem;
margin-bottom: 0.75rem;
color: var(--fg-color);
}
.lab-content-body code {
background-color: #ffeb3b;
padding: 0.125rem 0.25rem;
border-radius: 3px;
font-size: 0.875rem;
border: 1px solid var(--panelborder-color);
color: black;
}
.lab-content-body pre {
background-color: var(--highlight-color);
padding: 1rem;
border-radius: 6px;
overflow-x: auto;
border: 1px solid var(--panelborder-color);
color: white;
}
.lab-content-body pre code {
background-color: transparent;
padding: 0;
border: none;
color: white;
}
.lab-footer {
margin-top: 3rem;
padding-top: 1.5rem;
border-top: 1px solid var(--panelborder-color);
}
.back-link {
color: var(--link-color);
text-decoration: none;
font-weight: 500;
}
.back-link:hover {
text-decoration: underline;
color: var(--primary-btnhov-color);
}
</style>
<script>
// Theme toggle functionality
document.addEventListener('DOMContentLoaded', function() {
const themeToggle = document.getElementById('theme-toggle');
const themeIcon = document.getElementById('theme-icon');
const body = document.body;
// Check for saved theme preference or default to dark mode
const currentTheme = localStorage.getItem('theme') || 'dark';
body.setAttribute('data-theme', currentTheme);
updateThemeIcon(currentTheme);
themeToggle.addEventListener('click', function() {
const currentTheme = body.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
body.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
updateThemeIcon(newTheme);
});
function updateThemeIcon(theme) {
if (theme === 'dark') {
themeIcon.className = 'fas fa-sun';
} else {
themeIcon.className = 'fas fa-moon';
}
}
});
// Process ==highlight== syntax
document.addEventListener('DOMContentLoaded', function() {
const contentBody = document.querySelector('.lab-content-body');
if (contentBody) {
// Replace ==text== with <mark>text</mark>
contentBody.innerHTML = contentBody.innerHTML.replace(/==([^=]+)==/g, '<mark>$1</mark>');
}
});
</script>