Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
bugfixes: added await for fileWrites (was hanging), added path import…
Browse files Browse the repository at this point in the history
…, 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
  • Loading branch information
bcliden authored and imfunniee committed May 26, 2019
1 parent de728e7 commit 17cd853
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
6 changes: 3 additions & 3 deletions assets/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
--bg-color: rgb(10, 10, 10);
--text-color: #fff;
--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)),
url("{{background}}") center center fixed;
url("{{{background}}}") center center fixed;
--height: 50vh;
}
#display h1 {
Expand All @@ -26,6 +26,6 @@
@media (max-width: 800px) {
:root {
--background-image: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0)),
url("{{background}}") !important;
url("{{{background}}}") !important;
}
}
2 changes: 1 addition & 1 deletion assets/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--bg-color: #fff;
--text-color: rgb(10, 10, 10);
--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;
}
13 changes: 3 additions & 10 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = path.join(outDir, 'config.json');
*/
async function populateCSS({
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' */
theme = `${theme}.css`;
Expand Down Expand Up @@ -73,16 +73,9 @@ async function populateConfig(sort, order, includeFork) {

async function buildCommand(username, program) {
await populateCSS(program);

let sort = program.sort ? program.sort : 'created';
let order = "asc";
let includeFork = false;
if(program.order){
order = ('%s', program.order);
}
if(program.fork){
includeFork = true;
}
let order = program.order ? program.order : "asc";
let includeFork = program.fork ? true : false;
await populateConfig(sort, order, includeFork);
updateHTML(('%s', username), sort, order, includeFork);
}
Expand Down
4 changes: 2 additions & 2 deletions populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ module.exports.updateHTML = (username, sort, order, includeFork) => {
data[0].username = user.login;
data[0].name = user.name;
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;
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;
console.log(`Build Complete, Files can be Found @ ${outDir}`);
});
Expand Down

0 comments on commit 17cd853

Please # to comment.