Update Linux command cheat sheet formatting and enhance lab layout

- Changed command examples in the Linux cheat sheet to use code formatting for better readability.
- Updated the lab metadata section to hide when embedded, improving the layout.
- Renamed "Table of Contents" to "Contents" for consistency in the lab layout.
This commit is contained in:
Z. Cliffe Schreuders
2025-09-30 10:46:29 +01:00
parent 966a7e2d81
commit 71ab288360
2 changed files with 15 additions and 10 deletions

View File

@@ -99,14 +99,14 @@ Heres a brief cheat sheet of some common Linux/Unix commands:
| Command | Simplified description | Example usage |
| :---- | :---- | :---- |
| pwd | Check your current location in the file system | pwd |
| ls | Lists all the files in your current working directory, similar to “dir” on windows (-la shows details) | ls \-la |
| cp | Copies files (-r to recursively copy directory contents) | cp file1 copy\_of\_file1 |
| mv | Moves (or renames) a file or directory | mv file1 file2 |
| cat | Prints the contents of a file to the console | cat file1 |
| echo | Prints a message to the screen | echo hello, world\!” |
| mkdir | Makes a directory | mkdir newdirectory |
| cd | Change working directory, to “move us into a different directory” | cd newdirectory |
| `pwd` | Check your current location in the file system | `pwd` |
| `ls` | Lists all the files in your current working directory, similar to “dir” on windows (-la shows details) | `ls -la` |
| `cp` | Copies files (-r to recursively copy directory contents) | `cp file1 copy_of_file1` |
| `mv` | Moves (or renames) a file or directory | `mv file1 file2` |
| `cat` | Prints the contents of a file to the console | `cat file1` |
| `echo` | Prints a message to the screen | `echo "hello, world!"` |
| `mkdir` | Makes a directory | `mkdir newdirectory` |
| `cd` | Change working directory, to “move us into a different directory” | `cd newdirectory` |
> Tip: If you ever get lost within the file structure, you can type "cd" on its own (no directory name afterwards) and you'll return to your home folder. To go up just one level within the file system, type "cd .." ("cd", followed by a space then two full-stops.)

View File

@@ -22,7 +22,7 @@ layout: default
{% endif %}
</div>
<div class="lab-metadata">
<div class="lab-metadata hidden-when-embedded">
{% if page.author %}
<div class="metadata-item">
<strong>{% if page.author.first %}Authors:{% else %}Author:{% endif %}</strong>
@@ -83,7 +83,7 @@ layout: default
<div class="lab-content-body">
<div id="toc-container" class="toc-container">
<h2>Table of Contents</h2>
<h2>Contents</h2>
<ul id="toc-list"></ul>
</div>
{{ content }}
@@ -487,6 +487,11 @@ document.addEventListener('DOMContentLoaded', function() {
// Generate TOC items
headings.forEach((heading, index) => {
// Skip "Contents" heading
if (heading.textContent.trim() === 'Contents') {
return;
}
// Create ID if it doesn't exist
if (!heading.id) {
heading.id = heading.textContent