-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add eleventy to automatically build web pages
- Loading branch information
Showing
47 changed files
with
3,014 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
module.exports = function(eleventyConfig) { | ||
eleventyConfig.setUseGitIgnore(false); | ||
|
||
// Copy any .svg or midi file to `_site`, via Glob pattern | ||
// Keeps the same directory structure | ||
eleventyConfig.addPassthroughCopy("songs/**/*.svg"); | ||
eleventyConfig.addPassthroughCopy("songs/**/*.midi"); | ||
eleventyConfig.addPassthroughCopy("songs/styles.css"); | ||
}; |
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 |
---|---|---|
|
@@ -9,3 +9,9 @@ | |
*.toc | ||
*.txt | ||
*.ini | ||
*.svg | ||
|
||
_site | ||
node_modules | ||
.idea | ||
/songs/**/*.md |
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,22 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.activeBackground": "#93e6fc", | ||
"activityBar.background": "#93e6fc", | ||
"activityBar.foreground": "#15202b", | ||
"activityBar.inactiveForeground": "#15202b99", | ||
"activityBarBadge.background": "#fa45d4", | ||
"activityBarBadge.foreground": "#15202b", | ||
"commandCenter.border": "#15202b99", | ||
"sash.hoverBorder": "#93e6fc", | ||
"statusBar.background": "#61dafb", | ||
"statusBar.foreground": "#15202b", | ||
"statusBarItem.hoverBackground": "#2fcefa", | ||
"statusBarItem.remoteBackground": "#61dafb", | ||
"statusBarItem.remoteForeground": "#15202b", | ||
"titleBar.activeBackground": "#61dafb", | ||
"titleBar.activeForeground": "#15202b", | ||
"titleBar.inactiveBackground": "#61dafb99", | ||
"titleBar.inactiveForeground": "#15202b99" | ||
}, | ||
"peacock.color": "#61dafb" | ||
} |
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,5 @@ | ||
cd songs | ||
|
||
for dir in */; do | ||
(cd $dir && lilypond --svg main.ly) | ||
done |
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,50 @@ | ||
const fs = require('fs'); | ||
const yaml = require('js-yaml'); | ||
const { globSync } = require('glob'); | ||
|
||
const songShortNames = fs.readdirSync('./songs', { | ||
withFileTypes: true | ||
}).reduce((totalArray, currentVal) => { | ||
// Ignore meta directories | ||
if(currentVal.name[0] == '_'){ | ||
return totalArray; | ||
} | ||
|
||
if(currentVal.isDirectory()){ | ||
totalArray.push(currentVal.name); | ||
return totalArray; | ||
} | ||
return totalArray; | ||
}, []); | ||
|
||
songShortNames.forEach((shortName) => { | ||
|
||
const yamlFile = globSync(`./songs/${shortName}/*.yaml`)[0]; | ||
if(!yamlFile){ | ||
return; | ||
} | ||
const metadata = yaml.load(fs.readFileSync(yamlFile)); | ||
|
||
|
||
const midiPaths = globSync(`./songs/${shortName}/*.midi`).reverse(); | ||
|
||
|
||
if(!midiPaths){ | ||
console.log(shortName, 'does not have any MIDI files'); | ||
} | ||
metadata.midiFiles = midiPaths.map((path) => { | ||
return path.substring(5); // Get path without '/songs' | ||
}); | ||
|
||
const svgPaths = globSync(`./songs/${shortName}/*.svg`).reverse(); | ||
if(!svgPaths) { | ||
console.log(shortName, 'does not have any SVG files'); | ||
} | ||
metadata.svgFiles = svgPaths.map((path) => { | ||
return path.substring(5); // Get path without '/songs' | ||
});; | ||
|
||
const meta = yaml.dump(metadata); | ||
console.log(meta); | ||
fs.writeFileSync(`./songs/${shortName}/index.md`, `---\n${meta}---`); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.