-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from thoth-tech/main
Improved Tutorial Guides index page
- Loading branch information
Showing
5 changed files
with
114 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs'); // Import the file system module to interact with the file system | ||
const path = require('path'); // Import the path module to handle and transform file paths | ||
|
||
// Define the path to the directory containing the guide groups | ||
const guidesDir = './src/content/docs/guides'; | ||
// Define the path where the output JSON file will be saved | ||
const outputFile = './src/components/guides-groups.json'; | ||
|
||
// Read the contents of the guides directory | ||
const groupNames = fs.readdirSync(guidesDir, { withFileTypes: true }) | ||
// Filter out only the directories from the list of files and directories | ||
.filter(dirent => dirent.isDirectory()) | ||
// Map the directory names to lowercase to standardise them | ||
.map(dirent => dirent.name); | ||
|
||
// Write the list of group names to the output JSON file | ||
fs.writeFileSync(outputFile, JSON.stringify(groupNames, null, 2)); | ||
// Log a message to the console indicating that the JSON file has been created | ||
console.log('Group names have been written to', outputFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
"Animations", | ||
"Audio", | ||
"Camera", | ||
"Graphics", | ||
"Input", | ||
"Interface", | ||
"JSON", | ||
"Networking", | ||
"Raspberry-GPIO", | ||
"Resource-Bundles", | ||
"Using-SplashKit", | ||
"Utilities" | ||
] |