Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from GregSweats part1 #2

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"conventionalCommits.scopes": [
"vscode",
"schema-compliance",
"html",
"ux"
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "npm: dev",
"detail": "gulp",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ The theme is built using Gulp for compiling handlebars templates and Tailwind CS

To customize this theme or use this as a template to write your own you will need node.js and NPM installed on your system.

Clone this repository, install the dependencies with `npm install`, and for development run `npm run dev` and you will have the current theme served at localhost:6660. If you add your resume file `resume.json` on the root folder at the project, it will use your resume, otherwise it will be the sample resume provided.
1. Clone this repository
1. install the dependencies with `npm install`
1. `npm run dev`
1. View at `localhost:8888`
1. Theme fallsback to `resume-sample.json` when `resume.json` does not exist 😻 #smart.
1. Add your resume file `resume.json` to the project/theme's root folder
1. Put in the same location as `resume-sample.json`
1. ...or put it in your project root if using this theme as a package.

Any changes you make to any file in the `views` and `styles` folders will be reflected in the result (you still need to refresh the page).

Expand Down
57 changes: 46 additions & 11 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = {

RESUME_PATH: __dirname + '/resume.json',
FALLBACK_RESUME_PATH: __dirname + '/resume-sample.json',

// // //

helpers: {
uppercase: function (str) {
return str.toUpperCase();
Expand All @@ -40,27 +43,59 @@ module.exports = {
return args.slice(0, -1);
},
formatAddress: function (location) {
const { address, city, region, countryCode, postalCode } = location;
let text = '';
// const { address, city, region, countryCode, postalCode } = location;//

// console.debug('location', location);

var text = [];
/**
* I prefer to only list the city, region and country, but if you want to
* show the whole address just uncomment the lines for each address part.
*/
//if (address) text += `${address}, `;
if (city) text += city;
if (region) text += `, ${region}`;
if (countryCode) {
const found = lookup.byIso(countryCode);
if (found) {
text += `, ${found.country}`;
}
}
// if (postalCode) text += `, ${postalCode}`;
// with(location) {
// if (city) text.push(city);
// if (region) text.push(region);

// if (countryCode) {
// const found = lookup.byIso(countryCode);
// if (found) {
// text.push(found.country);
// }
// }
// // if (postalCode) text.push(postalCode);
// }

// text.push(location.city);
text.push(location.region);
text.push(lookup.byIso(location.countryCode).country);

/*
Buffer to String
- fastest way of concating strings
- no dealing with trailing commas
- or missing/blank values
*/
text = text.join(', ');

// console.debug('formatAddress', 'text', text)

return text;
},
formatDate: function (string) {
const date = new Date(`${string} 00:00:01`);
return formatDate(date, 'MMM yyyy');
},

/**
* Support optional `profiles.
* @param {any} icon
* @param {any} fallback
* @returns {any}
*/
iconOrValue: function(icon, fallback) {
// console.debug('iconOrValue', icon, fallback);
return typeof icon === 'string' && icon.length > 0 ? icon : fallback.toLowerCase();
}
}
};
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function watch() {
function server() {
return gulp.src(OUTPUT_DIR).pipe(
webserver({
port: 6660,
port: 8888,
open: true
})
);
Expand Down
Loading