mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
Formatted some files
This commit is contained in:
parent
c247ead4f4
commit
85835e6167
7 changed files with 224 additions and 252 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.html",
|
"files": ["*.html", "*.ejs"],
|
||||||
"options": {
|
"options": {
|
||||||
"parser": "html",
|
"parser": "html",
|
||||||
"htmlWhitespaceSensitivity": "ignore"
|
"htmlWhitespaceSensitivity": "ignore"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.6.1/workbox-sw.js');
|
importScripts(
|
||||||
|
"https://storage.googleapis.com/workbox-cdn/releases/3.6.1/workbox-sw.js"
|
||||||
|
);
|
||||||
|
|
||||||
if (workbox) {
|
if (workbox) {
|
||||||
workbox.setConfig({
|
workbox.setConfig({
|
||||||
|
@ -11,22 +13,20 @@
|
||||||
new workbox.expiration.Plugin({
|
new workbox.expiration.Plugin({
|
||||||
maxEntries: 128,
|
maxEntries: 128,
|
||||||
maxAgeSeconds: 7 * 24 * 60 * 60, // 1 week
|
maxAgeSeconds: 7 * 24 * 60 * 60, // 1 week
|
||||||
purgeOnQuotaError: true, // Opt-in to automatic cleanup
|
purgeOnQuotaError: true // Opt-in to automatic cleanup
|
||||||
}),
|
}),
|
||||||
new workbox.cacheableResponse.Plugin({
|
new workbox.cacheableResponse.Plugin({
|
||||||
statuses: [0, 200] // for opague requests
|
statuses: [0, 200] // for opague requests
|
||||||
}),
|
})
|
||||||
],
|
]
|
||||||
});
|
});
|
||||||
workbox.routing.setDefaultHandler(
|
workbox.routing.setDefaultHandler(args => {
|
||||||
(args) => {
|
if (args.event.request.method === "GET") {
|
||||||
if (args.event.request.method === 'GET') {
|
|
||||||
return defaultStrategy.handle(args); // use default strategy
|
return defaultStrategy.handle(args); // use default strategy
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
new RegExp(/.*\.(?:js|css)/g),
|
new RegExp(/.*\.(?:js|css)/g),
|
||||||
|
|
|
@ -5,29 +5,13 @@ const program = require("commander");
|
||||||
|
|
||||||
process.env.OUT_DIR = process.env.OUT_DIR || process.cwd();
|
process.env.OUT_DIR = process.env.OUT_DIR || process.cwd();
|
||||||
|
|
||||||
const
|
const { buildCommand } = require("../build");
|
||||||
{
|
const { updateCommand } = require("../update");
|
||||||
buildCommand
|
const { uiCommand } = require("../ui");
|
||||||
} = require("../build");
|
const { runCommand } = require("../run");
|
||||||
const
|
const { version } = require("../package.json");
|
||||||
{
|
|
||||||
updateCommand
|
|
||||||
} = require("../update");
|
|
||||||
const
|
|
||||||
{
|
|
||||||
uiCommand
|
|
||||||
} = require("../ui");
|
|
||||||
const
|
|
||||||
{
|
|
||||||
runCommand
|
|
||||||
} = require("../run");
|
|
||||||
const
|
|
||||||
{
|
|
||||||
version
|
|
||||||
} = require("../package.json");
|
|
||||||
|
|
||||||
function collect(val, memo)
|
function collect(val, memo) {
|
||||||
{
|
|
||||||
memo.push(val);
|
memo.push(val);
|
||||||
return memo;
|
return memo;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +45,7 @@ program
|
||||||
.option("-p, --port [port]", "provide a port for localhost, default is 3000")
|
.option("-p, --port [port]", "provide a port for localhost, default is 3000")
|
||||||
.action(runCommand);
|
.action(runCommand);
|
||||||
|
|
||||||
program.on("command:*", () =>
|
program.on("command:*", () => {
|
||||||
{
|
|
||||||
console.log("Unknown Command: " + program.args.join(" "));
|
console.log("Unknown Command: " + program.args.join(" "));
|
||||||
program.help();
|
program.help();
|
||||||
});
|
});
|
||||||
|
|
16
update.js
16
update.js
|
@ -1,18 +1,10 @@
|
||||||
const
|
const { getConfig } = require("./utils");
|
||||||
{
|
const { updateHTML } = require("./populate");
|
||||||
getConfig
|
|
||||||
} = require("./utils");
|
|
||||||
const
|
|
||||||
{
|
|
||||||
updateHTML
|
|
||||||
} = require("./populate");
|
|
||||||
|
|
||||||
async function updateCommand()
|
async function updateCommand() {
|
||||||
{
|
|
||||||
const data = await getConfig();
|
const data = await getConfig();
|
||||||
var username = data[0].username;
|
var username = data[0].username;
|
||||||
if (username == null)
|
if (username == null) {
|
||||||
{
|
|
||||||
console.log(
|
console.log(
|
||||||
"username not found in config.json, please run build command before using update"
|
"username not found in config.json, please run build command before using update"
|
||||||
);
|
);
|
||||||
|
|
13
utils.js
13
utils.js
|
@ -11,14 +11,10 @@ const defaultConfigPath = path.resolve(`${__dirname}/default/config.json`);
|
||||||
* Tries to read file from out dir,
|
* Tries to read file from out dir,
|
||||||
* if not present returns default file contents
|
* if not present returns default file contents
|
||||||
*/
|
*/
|
||||||
async function getFileWithDefaults(file, defaultFile)
|
async function getFileWithDefaults(file, defaultFile) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
await fs.accessAsync(file, fs.constants.F_OK);
|
await fs.accessAsync(file, fs.constants.F_OK);
|
||||||
}
|
} catch (err) {
|
||||||
catch (err)
|
|
||||||
{
|
|
||||||
const defaultData = await fs.readFileAsync(defaultFile);
|
const defaultData = await fs.readFileAsync(defaultFile);
|
||||||
return JSON.parse(defaultData);
|
return JSON.parse(defaultData);
|
||||||
}
|
}
|
||||||
|
@ -26,8 +22,7 @@ async function getFileWithDefaults(file, defaultFile)
|
||||||
return JSON.parse(data);
|
return JSON.parse(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getConfig()
|
async function getConfig() {
|
||||||
{
|
|
||||||
return getFileWithDefaults(configPath, defaultConfigPath);
|
return getFileWithDefaults(configPath, defaultConfigPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
194
views/index.ejs
194
views/index.ejs
|
@ -1,172 +1,174 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport"
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
content="width=device-width, initial-scale=1.0" />
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||||
<meta http-equiv="X-UA-Compatible"
|
|
||||||
content="ie=edge" />
|
|
||||||
<title>Gitfolio UI</title>
|
<title>Gitfolio UI</title>
|
||||||
<link rel="stylesheet"
|
<link
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css" />
|
rel="stylesheet"
|
||||||
<link rel="stylesheet"
|
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
|
href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
|
||||||
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
|
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
|
||||||
crossorigin="anonymous" />
|
crossorigin="anonymous"
|
||||||
<link rel="stylesheet"
|
/>
|
||||||
type="text/css"
|
<link rel="stylesheet" type="text/css" href="./css/index.css" />
|
||||||
href="./css/index.css" />
|
<link
|
||||||
<link rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/css/zeva.min.css" />
|
href="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/css/zeva.min.css"
|
||||||
|
/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="body-light">
|
<body class="body-light">
|
||||||
<header>
|
<header>
|
||||||
<b>gitfolio</b>
|
<b>gitfolio</b>
|
||||||
<a href="/update"
|
<a href="/update" style="float: right">Update</a>
|
||||||
style="float: right">Update</a>
|
<a href="/" style="float: right">Home</a>
|
||||||
<a href="/"
|
|
||||||
style="float: right">Home</a>
|
|
||||||
</header>
|
</header>
|
||||||
<form method="post"
|
<form method="post" action="build">
|
||||||
action="build">
|
|
||||||
<h3>Build or Edit Portfolio</h3>
|
<h3>Build or Edit Portfolio</h3>
|
||||||
<input type="text"
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="username"
|
placeholder="username"
|
||||||
id="username"
|
id="username"
|
||||||
name="username"
|
name="username"
|
||||||
required /><br />
|
required
|
||||||
<input type="text"
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="background"
|
placeholder="background"
|
||||||
name="background"
|
name="background"
|
||||||
id="background" />
|
id="background"
|
||||||
|
/>
|
||||||
<h3>Sort By :</h3>
|
<h3>Sort By :</h3>
|
||||||
<label class="label">Star
|
<label class="label">
|
||||||
<input type="radio"
|
Star
|
||||||
name="sort"
|
<input type="radio" name="sort" value="star" />
|
||||||
value="star" />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="label">Created
|
<label class="label">
|
||||||
<input type="radio"
|
Created
|
||||||
name="sort"
|
<input type="radio" name="sort" value="created" checked />
|
||||||
value="created"
|
|
||||||
checked />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="label">Updated
|
<label class="label">
|
||||||
<input type="radio"
|
Updated
|
||||||
name="sort"
|
<input type="radio" name="sort" value="updated" />
|
||||||
value="updated" />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="label">Pushed
|
<label class="label">
|
||||||
<input type="radio"
|
Pushed
|
||||||
name="sort"
|
<input type="radio" name="sort" value="pushed" />
|
||||||
value="pushed" />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="label">Full Name
|
<label class="label">
|
||||||
<input type="radio"
|
Full Name
|
||||||
name="sort"
|
<input type="radio" name="sort" value="full_name" />
|
||||||
value="full_name" />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<h3>Order By :</h3>
|
<h3>Order By :</h3>
|
||||||
<label class="label">Asc
|
<label class="label">
|
||||||
<input type="radio"
|
Asc
|
||||||
name="order"
|
<input type="radio" name="order" value="asc" checked />
|
||||||
value="asc"
|
|
||||||
checked />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">Desc
|
<label class="label">
|
||||||
<input type="radio"
|
Desc
|
||||||
name="order"
|
<input type="radio" name="order" value="desc" />
|
||||||
value="desc" />
|
|
||||||
<span class="radio"></span>
|
<span class="radio"></span>
|
||||||
</label>
|
</label>
|
||||||
<br /><br />
|
<br />
|
||||||
<label class="label">Use Dark Theme
|
<br />
|
||||||
<input type="checkbox"
|
<label class="label">
|
||||||
id="theme"
|
Use Dark Theme
|
||||||
name="theme" />
|
<input type="checkbox" id="theme" name="theme" />
|
||||||
<span class="checkbox"></span>
|
<span class="checkbox"></span>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">Include Forks
|
<label class="label">
|
||||||
<input type="checkbox"
|
Include Forks
|
||||||
id="fork"
|
<input type="checkbox" id="fork" name="fork" value="true" />
|
||||||
name="fork"
|
|
||||||
value="true" />
|
|
||||||
<span class="checkbox"></span>
|
<span class="checkbox"></span>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">Include Socials
|
<label class="label">
|
||||||
<input type="checkbox"
|
Include Socials
|
||||||
id="socials"
|
<input type="checkbox" id="socials" name="socials" />
|
||||||
name="socials" />
|
|
||||||
<span class="checkbox"></span>
|
<span class="checkbox"></span>
|
||||||
</label>
|
</label>
|
||||||
<div style="display: none"
|
<div style="display: none" id="input_for_socials">
|
||||||
id="input_for_socials">
|
<input
|
||||||
<input type="text"
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="codepen username"
|
placeholder="codepen username"
|
||||||
id="codepen"
|
id="codepen"
|
||||||
name="codepen" /><br />
|
name="codepen"
|
||||||
<input type="text"
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="dev username"
|
placeholder="dev username"
|
||||||
id="dev"
|
id="dev"
|
||||||
name="dev" /><br />
|
name="dev"
|
||||||
<input type="text"
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="dribbble username"
|
placeholder="dribbble username"
|
||||||
id="dribbble"
|
id="dribbble"
|
||||||
name="dribbble" /><br />
|
name="dribbble"
|
||||||
<input type="text"
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="email address"
|
placeholder="email address"
|
||||||
id="email"
|
id="email"
|
||||||
name="email" /><br />
|
name="email"
|
||||||
<input type="text"
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="instagram username"
|
placeholder="instagram username"
|
||||||
id="instagram"
|
id="instagram"
|
||||||
name="instagram" />
|
name="instagram"
|
||||||
<input type="text"
|
/>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="input h-weight-bold"
|
class="input h-weight-bold"
|
||||||
placeholder="twitter username"
|
placeholder="twitter username"
|
||||||
id="twitter"
|
id="twitter"
|
||||||
name="twitter" />
|
name="twitter"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<br /><br />
|
<br />
|
||||||
<button type="submit"
|
<br />
|
||||||
class="button"
|
<button type="submit" class="button" id="build">Build</button>
|
||||||
id="build">Build</button>
|
|
||||||
</form>
|
</form>
|
||||||
<script type="text/javascript"
|
<script
|
||||||
src="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/js/index.min.js"></script>
|
type="text/javascript"
|
||||||
|
src="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/js/index.min.js"
|
||||||
|
></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.querySelector("#socials").addEventListener("change", event =>
|
document.querySelector("#socials").addEventListener("change", event => {
|
||||||
{
|
if (event.target.checked) {
|
||||||
if (event.target.checked)
|
|
||||||
{
|
|
||||||
document.querySelector("#input_for_socials").style.display = "block";
|
document.querySelector("#input_for_socials").style.display = "block";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
document.querySelector("#input_for_socials").style.display = "none";
|
document.querySelector("#input_for_socials").style.display = "none";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue