Skip to content

Commit

Permalink
bug fixes and update to json-schema v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Esposito committed Apr 28, 2022
1 parent 192d211 commit f39d65d
Show file tree
Hide file tree
Showing 28 changed files with 435 additions and 420 deletions.
16 changes: 8 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
3 changes: 3 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[user]
name = Francesco Esposito
email = fraesps@gmail.com
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
bower_components/
node_modules/
public/
npm-debug.log
resume.html
resume.pdf
resume.json
index.html
.DS_Store
bower_components/
node_modules/
public/
npm-debug.log
resume.html
resume.pdf
resume.json
index.html
.DS_Store
12 changes: 6 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules/
npm-debug.log
resume.html
resume.pdf
resume.json
.DS_Store
node_modules/
npm-debug.log
resume.html
resume.pdf
resume.json
.DS_Store
31 changes: 8 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,32 @@ Clone the repository
git clone https://github.com/francescoes/jsonresume-theme-stackoverflow.git
```

And simply run:
Create a 'resume.json' file in the current folder and follow the [json resume schema](https://jsonresume.org/schema/)

```
resume serve
```

You should now see this message:
Simply run:

```
Preview: http://localhost:4000
Press ctrl-c to stop
resume serve --theme .
```

To build your own resume, create a 'resume.json' file in the current folder and follow the [json resume schema](https://jsonresume.org/schema/)

### Social Profiles Icons

**Profiles supported with brand colors:**

github, stack overflow, linkedin, dribbble, twitter, facebook, pinterest, instagram, soundcloud, wordpress, youtube, flickr, google plus, tumblr, foursquare.
Please note that all the [Font awesome brands icons](https://fontawesome.com/search?s=brands) are supported. Although only the ones listed below have a color code associated with it in my CSS file:

To have a social icon close the social link profile (or username) it is enough to set a `network` the name of the Social Network (es: 'Stack Overflow').
github, stack-overflow, linkedin, dribbble, twitter, facebook, pinterest, instagram, soundcloud, wordpress, youtube, flickr, google plus, tumblr, foursquare.

To have a social icon close the social link profile (or username) it is enough to set a `network` the name of the Social Network (es: 'Stack Overflow'). I am replacing spaces with dashes (`-`) and transforming all the network name to all lowercase to match the Font awesome naming convention for brands icons.

#### Support to extra fields

With stackoverflow theme it is possible to add:

- `keywords` to each 'work', 'publication' and 'volunteer' item
- `summary` to each 'interests' and 'education' item
- `location` to each 'work', 'education' and 'volunteer' item
- `birth` to 'basics'

example of the extra `location` object:
- `birth` to 'basics' (might be commonly used in Europe)

```
"location": {
"city": "Zürich",
"countryCode": "CH",
"region": "Switzerland"
}
```
example of the extra `birth` object:

```
Expand Down
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const HELPERS = join(__dirname, 'theme/hbs-helpers');

const { birthDate } = require(join(HELPERS, 'birth-date.js'));
const { dateHelpers } = require(join(HELPERS, 'date-helpers.js'));
const { isObject } = require(join(HELPERS, 'is-object.js'));
const { paragraphSplit } = require(join(HELPERS, 'paragraph-split.js'));
const { toLowerCase } = require(join(HELPERS, 'to-lower-case.js'));
const { spaceToDash } = require(join(HELPERS, 'space-to-dash.js'));
Expand All @@ -17,7 +16,6 @@ Handlebars.registerHelper('birthDate', birthDate);
Handlebars.registerHelper('MY', MY);
Handlebars.registerHelper('Y', Y);
Handlebars.registerHelper('DMY', DMY);
Handlebars.registerHelper('isObject', isObject);
Handlebars.registerHelper('paragraphSplit', paragraphSplit);
Handlebars.registerHelper('toLowerCase', toLowerCase);
Handlebars.registerHelper('spaceToDash', spaceToDash);
Expand Down
85 changes: 83 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "jsonresume-theme-stackoverflow-FA5",
"name": "jsonresume-theme-stackoverflow",
"version": "1.4.0",
"description": "Stack Overflow theme for JSON Resume",
"author": "Francesco Esposito <http://fran.cesco.io>",
"author": "Francesco Esposito",
"repository": {
"type": "git",
"url": "https://github.com/francescoes/jsonresume-theme-stackoverflow"
Expand Down
1 change: 1 addition & 0 deletions resume.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{{> volunteer }}
{{> education }}
{{> awards }}
{{> certificates }}
{{> publications }}
{{> languages }}
{{> interests }}
Expand Down
33 changes: 0 additions & 33 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ html {
letter-spacing: 0;
line-height: 1.46153846;
text-align: left;
-webkit-text-size-adjust: 100%;
}

p {
Expand Down Expand Up @@ -565,10 +564,6 @@ section .location {
border-left: 5px solid #ff6d1f;
}

.toggle-item {
display: none;
}

.section > section > section {
margin-bottom: 0.5rem;
}
Expand Down Expand Up @@ -623,34 +618,6 @@ section .location {
.section > section:not(.main-summary) {
margin-left: 1.67rem;
}
.toggle-item {
transform: translate(-9999px);
}
.toggle-item + label {
display: block;
}
.toggle-item:checked + label:after {
content: "\f0d7";
}
.toggle-item + label:after {
float: left;
cursor: pointer;
margin-left: -20px;
color: #aaa;
font-size: 16px;
font-weight: 900;
font-family: "Font Awesome 5 Free";
content: "\f0da";
}
.toggle-item ~ .item {
height: 0;
opacity: 0;
}
.toggle-item:checked ~ .item {
height: auto;
opacity: 1;
transition: all 0.5s linear;
}
.company::before,
.institution::before,
.organization::before,
Expand Down
48 changes: 24 additions & 24 deletions theme/hbs-helpers/birth-date.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
const moment = require('moment');
const { SafeString } = require('handlebars');

const birthDate = (birth) => {
const out = [];
if (birth && Object.keys(birth).length) {
if (birth.place) {
out.push(`<div> Born in ${birth.place}`);
}
if (birth.place && birth.state) {
out.push(`, ${birth.state}`);
}
const year = birth.date ? moment(birth.date.toString(), ['YYYY-MM-DD']).format('YYYY') : '';
if (year && birth.place && birth.state) {
out.push(` in ${year}</div>`);
} else if (year && (!birth.place || birth.state)) {
out.push(`<div> Born in ${year}</div>`);
}
}

return new SafeString(out.join(''));
};

module.exports = { birthDate };
const moment = require('moment');
const { SafeString } = require('handlebars');

const birthDate = (birth) => {
const out = [];
if (birth && Object.keys(birth).length) {
if (birth.place) {
out.push(`<div> Born in ${birth.place}`);
}
if (birth.place && birth.state) {
out.push(`, ${birth.state}`);
}
const year = birth.date ? moment(birth.date.toString(), ['YYYY-MM-DD']).format('YYYY') : '';
if (year && birth.place && birth.state) {
out.push(` in ${year}</div>`);
} else if (year && (!birth.place || birth.state)) {
out.push(`<div> Born in ${year}</div>`);
}
}

return new SafeString(out.join(''));
};

module.exports = { birthDate };
18 changes: 9 additions & 9 deletions theme/hbs-helpers/date-helpers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const moment = require('moment');

const dateHelpers = {
MY: date => moment(date.toString(), ['YYYY-MM-DD']).format('MMM YYYY'),
Y: date => moment(date.toString(), ['YYYY-MM-DD']).format('YYYY'),
DMY: date => moment(date.toString(), ['YYYY-MM-DD']).format('D MMM YYYY')
};

module.exports = { dateHelpers };
const moment = require('moment');

const dateHelpers = {
MY: date => moment(date.toString(), ['YYYY-MM-DD']).format('MMM YYYY'),
Y: date => moment(date.toString(), ['YYYY-MM-DD']).format('YYYY'),
DMY: date => moment(date.toString(), ['YYYY-MM-DD']).format('D MMM YYYY')
};

module.exports = { dateHelpers };
9 changes: 0 additions & 9 deletions theme/hbs-helpers/is-object.js

This file was deleted.

20 changes: 10 additions & 10 deletions theme/hbs-helpers/paragraph-split.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { SafeString } = require('handlebars');

const paragraphSplit = (text) => {
const expr = /\r\n|\r|\n/g;
const lines = Array.isArray(text) ? text.join('').split(expr) : text.split(expr);
const output = lines.filter(line => line).reduce((a, b) => `${a}<p>${b}</p>`, '');
return new SafeString(output);
};

module.exports = { paragraphSplit };
const { SafeString } = require('handlebars');

const paragraphSplit = (text) => {
const expr = /\r\n|\r|\n/g;
const lines = Array.isArray(text) ? text.join('').split(expr) : text.split(expr);
const output = lines.filter(line => line).reduce((a, b) => `${a}<p>${b}</p>`, '');
return new SafeString(output);
};

module.exports = { paragraphSplit };
6 changes: 3 additions & 3 deletions theme/hbs-helpers/space-to-dash.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
spaceToDash: str => str.replace(/\s/g, '-').toLowerCase()
};
module.exports = {
spaceToDash: str => str.replace(/\s/g, '-').toLowerCase()
};
Loading

0 comments on commit f39d65d

Please sign in to comment.