diff --git a/README.md b/README.md index 4566741..12c2567 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# website +
+ +

janishutz.com

+
-The source code of my website \ No newline at end of file +This is the source code for my personal website. Check it out [here](https://janishutz.com). + +As any custom website is, this one is also written entirely in HTML, CSS and JavaScript and now doesn't even use any external libraries (apart from my own) + +# Building +cd to the site directory and run `node build.js` diff --git a/assets/home/conductorcalc.jpg b/assets/home/conductorcalc.jpg new file mode 100644 index 0000000..c15e7c2 Binary files /dev/null and b/assets/home/conductorcalc.jpg differ diff --git a/assets/home/foss.jpg b/assets/home/foss.jpg new file mode 100644 index 0000000..0bba90d Binary files /dev/null and b/assets/home/foss.jpg differ diff --git a/assets/home/foss.xcf b/assets/home/foss.xcf new file mode 100644 index 0000000..f1c5138 Binary files /dev/null and b/assets/home/foss.xcf differ diff --git a/assets/home/store.jpg b/assets/home/store.jpg new file mode 100644 index 0000000..c6ff360 Binary files /dev/null and b/assets/home/store.jpg differ diff --git a/assets/musicplayer/main.jpg b/assets/musicplayer/main.jpg new file mode 100644 index 0000000..497ce0c Binary files /dev/null and b/assets/musicplayer/main.jpg differ diff --git a/assets/projects/conductorcalc-title.jpg b/assets/projects/conductorcalc-title.jpg new file mode 100644 index 0000000..c15e7c2 Binary files /dev/null and b/assets/projects/conductorcalc-title.jpg differ diff --git a/assets/projects/musicplayer-title.jpg b/assets/projects/musicplayer-title.jpg new file mode 100644 index 0000000..828f303 Binary files /dev/null and b/assets/projects/musicplayer-title.jpg differ diff --git a/assets/projects/qrscanner-title.jpg b/assets/projects/qrscanner-title.jpg new file mode 100644 index 0000000..9c8394a Binary files /dev/null and b/assets/projects/qrscanner-title.jpg differ diff --git a/assets/projects/storagemanager-title.jpg b/assets/projects/storagemanager-title.jpg new file mode 100644 index 0000000..40d31f4 Binary files /dev/null and b/assets/projects/storagemanager-title.jpg differ diff --git a/build.js b/build.js new file mode 100644 index 0000000..1b3fa36 --- /dev/null +++ b/build.js @@ -0,0 +1,79 @@ +const fs = require( 'fs' ); +const navMenu = '' + fs.readFileSync( './src/nav.html' ); +const footer = '' + fs.readFileSync( './src/footer.html' ); + +/** + * Recursively find all HTML files in a directory + * @param {string} dir The directory to search. Either absolute or relative path + * @param {string} extension The file extension to look for + * @returns {string[]} returns a list of html files with their full path + */ +const treeWalker = ( dir, extension ) => { + const ls = fs.readdirSync( dir ); + const fileList = []; + for ( let file in ls ) { + if ( !ls[ file ].includes( '.' ) ) { + const newFiles = treeWalker( dir + '/' + ls[ file ], extension ); + for ( let file in newFiles ) { + fileList.push( newFiles[ file ] ); + } + } else if ( ls[ file ].includes( extension ) ) { + fileList.push( dir + '/' + ls[ file ] ); + } + } + + return fileList; +} + + +const addNavAndFooterToFile = ( file ) => { + const f = '' + fs.readFileSync( file ); + const navIndex = f.indexOf( '