mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
bugfixes: added await for fileWrites (was hanging), added path import, url escape issue (#58)
* added await for fileWrites (was hanging), added path import * fixed html escaping issue with background image. +consistency * changed default background to smaller params. only 90kb
This commit is contained in:
parent
de728e75bd
commit
17cd85327b
4 changed files with 9 additions and 16 deletions
|
@ -2,9 +2,9 @@
|
||||||
--bg-color: rgb(10, 10, 10);
|
--bg-color: rgb(10, 10, 10);
|
||||||
--text-color: #fff;
|
--text-color: #fff;
|
||||||
--blog-gray-color: rgb(180, 180, 180);
|
--blog-gray-color: rgb(180, 180, 180);
|
||||||
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.6), rgb(10, 10, 10, 1)), url("{{background}}");
|
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.6), rgb(10, 10, 10, 1)), url("{{{background}}}");
|
||||||
--background-background: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0.6)),
|
--background-background: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0.6)),
|
||||||
url("{{background}}") center center fixed;
|
url("{{{background}}}") center center fixed;
|
||||||
--height: 50vh;
|
--height: 50vh;
|
||||||
}
|
}
|
||||||
#display h1 {
|
#display h1 {
|
||||||
|
@ -26,6 +26,6 @@
|
||||||
@media (max-width: 800px) {
|
@media (max-width: 800px) {
|
||||||
:root {
|
:root {
|
||||||
--background-image: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0)),
|
--background-image: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0)),
|
||||||
url("{{background}}") !important;
|
url("{{{background}}}") !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
--bg-color: #fff;
|
--bg-color: #fff;
|
||||||
--text-color: rgb(10, 10, 10);
|
--text-color: rgb(10, 10, 10);
|
||||||
--blog-gray-color: rgb(80, 80, 80);
|
--blog-gray-color: rgb(80, 80, 80);
|
||||||
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.4), rgb(10, 10, 10, 0.4)), url("{{background}}");
|
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.4), rgb(10, 10, 10, 0.4)), url("{{{background}}}");
|
||||||
--background-background: #fff;
|
--background-background: #fff;
|
||||||
}
|
}
|
||||||
|
|
13
build.js
13
build.js
|
@ -20,7 +20,7 @@ const config = path.join(outDir, 'config.json');
|
||||||
*/
|
*/
|
||||||
async function populateCSS({
|
async function populateCSS({
|
||||||
theme = 'light',
|
theme = 'light',
|
||||||
background = 'https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450',
|
background = 'https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=500&h=1000&q=80&fit=crop',
|
||||||
} = {}) {
|
} = {}) {
|
||||||
/* Get the theme the user requests. Defaults to 'light' */
|
/* Get the theme the user requests. Defaults to 'light' */
|
||||||
theme = `${theme}.css`;
|
theme = `${theme}.css`;
|
||||||
|
@ -73,16 +73,9 @@ async function populateConfig(sort, order, includeFork) {
|
||||||
|
|
||||||
async function buildCommand(username, program) {
|
async function buildCommand(username, program) {
|
||||||
await populateCSS(program);
|
await populateCSS(program);
|
||||||
|
|
||||||
let sort = program.sort ? program.sort : 'created';
|
let sort = program.sort ? program.sort : 'created';
|
||||||
let order = "asc";
|
let order = program.order ? program.order : "asc";
|
||||||
let includeFork = false;
|
let includeFork = program.fork ? true : false;
|
||||||
if(program.order){
|
|
||||||
order = ('%s', program.order);
|
|
||||||
}
|
|
||||||
if(program.fork){
|
|
||||||
includeFork = true;
|
|
||||||
}
|
|
||||||
await populateConfig(sort, order, includeFork);
|
await populateConfig(sort, order, includeFork);
|
||||||
updateHTML(('%s', username), sort, order, includeFork);
|
updateHTML(('%s', username), sort, order, includeFork);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,11 +121,11 @@ module.exports.updateHTML = (username, sort, order, includeFork) => {
|
||||||
data[0].username = user.login;
|
data[0].username = user.login;
|
||||||
data[0].name = user.name;
|
data[0].name = user.name;
|
||||||
data[0].userimg = user.avatar_url;
|
data[0].userimg = user.avatar_url;
|
||||||
fs.writeFile(`${outDir}/config.json`, JSON.stringify(data, null, ' '), function (err) {
|
await fs.writeFile(`${outDir}/config.json`, JSON.stringify(data, null, ' '), function (err) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
console.log("Config file updated.");
|
console.log("Config file updated.");
|
||||||
});
|
});
|
||||||
fs.writeFile(`${outDir}/index.html`, '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
await fs.writeFile(`${outDir}/index.html`, '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
console.log(`Build Complete, Files can be Found @ ${outDir}`);
|
console.log(`Build Complete, Files can be Found @ ${outDir}`);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue