Skip to content

Commit 0e87c43

Browse files
authored
Merge pull request #91 from mudassir0909/move-to-pug
Migrate to pugjs
2 parents d7e62d4 + e2c502a commit 0e87c43

20 files changed

+50
-48
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/*
22
resume.json
33
build/*
44
*.DS_Store
5+
public/

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var fs = require('fs');
2-
var jade = require('jade');
2+
var pug = require('pug');
33
var _ = require('underscore');
44
var utils = require('jsonresume-themeutils');
55
var moment = require('moment');
@@ -169,7 +169,7 @@ function render(resume) {
169169
reference_info.reference = convertMarkdown(reference_info.reference);
170170
});
171171

172-
return jade.renderFile(__dirname + '/index.jade', {
172+
return pug.renderFile(__dirname + '/index.pug', {
173173
resume: resume,
174174
floating_nav_items: getFloatingNavItems(resume),
175175
css: css,

index.jade index.pug

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ html(lang="en")
55
meta(http-equiv="X-UA-Compatible", content="IE=edge")
66
meta(name="viewport", content="width=device-width, initial-scale=1")
77
title= resume.basics.name
8-
include jade/stylesheets
8+
include pug/stylesheets.pug
99

1010
body(itemscope, itemtype="http://schema.org/Person")
1111
.container-fluid
1212
.row.main.clearfix
13-
include jade/floating-nav
14-
include jade/profile-card
15-
include jade/background-card
13+
include pug/floating-nav.pug
14+
include pug/profile-card.pug
15+
include pug/background-card.pug
1616

17-
include jade/scripts
17+
include pug/scripts.pug

jade/background-card.jade

-15
This file was deleted.

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonresume-theme-elegant",
3-
"version": "1.6.10",
3+
"version": "1.7.11",
44
"description": "Elegant theme for jsonresume",
55
"main": "index.js",
66
"scripts": {
@@ -24,22 +24,22 @@
2424
"dependencies": {
2525
"gravatar": "^1.0.6",
2626
"handlebars": "^2.0.0-alpha.4",
27-
"jade": "^1.11.0",
2827
"jsonresume-themeutils": "^1.3.2",
2928
"markdown-it": "^6.0.1",
3029
"markdown-it-abbr": "^1.0.3",
3130
"moment": "^2.8.1",
32-
"resume-schema": "0.0.15",
31+
"pug": "^2.0.0-beta6",
32+
"resume-schema": "0.0.16",
3333
"tarball-extract": "0.0.3",
3434
"underscore": "^1.6.0"
3535
},
3636
"devDependencies": {
3737
"grunt": "^0.4.5",
38-
"grunt-contrib-less": "^0.11.4",
39-
"grunt-contrib-watch": "^0.6.1",
40-
"grunt-exec": "^0.4.6",
41-
"grunt-contrib-copy": "0.4.x",
38+
"less": "^1.7.5",
4239
"grunt-contrib-clean": "0.5.x",
43-
"less": "^1.7.5"
40+
"grunt-contrib-copy": "0.4.x",
41+
"grunt-contrib-less": "^1.4.0",
42+
"grunt-contrib-watch": "^0.6.1",
43+
"grunt-exec": "^0.4.6"
4444
}
4545
}

pug/background-card.pug

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
section.col-md-9.card-wrapper.pull-right
2+
.card.background-card
3+
h4.text-uppercase Background
4+
hr
5+
6+
.background-details
7+
include background/about.pug
8+
include background/work-experience.pug
9+
include background/skills.pug
10+
include background/education.pug
11+
include background/awards.pug
12+
include background/volunteer-work.pug
13+
include background/publications.pug
14+
include background/interests.pug
15+
include background/references.pug
File renamed without changes.

jade/background/awards.jade pug/background/awards.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unless _.isEmpty(resume.awards)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each award in resume.awards
12+
each award in resume.awards
1313
li.card.card-nested
1414
.content
1515
p.clear-margin(itemprop="award")

jade/background/education.jade pug/background/education.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unless _.isEmpty(resume.education)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each education_info in resume.education
12+
each education_info in resume.education
1313
li.card.card-nested
1414
.content
1515
p.clear-margin.relative
@@ -31,5 +31,5 @@ unless _.isEmpty(resume.education)
3131

3232
unless _.isEmpty(education_info.courses)
3333
.space-top.labels
34-
- each course in education_info.courses
34+
each course in education_info.courses
3535
span.label.label-keyword= course

jade/background/interests.jade pug/background/interests.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ unless _.isEmpty(resume.interests)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each interest in resume.interests
12+
each interest in resume.interests
1313
li.card.card-nested
1414
p
1515
strong= interest.name
1616

1717
unless _.isEmpty(interest.keywords)
1818
.space-top.labels
19-
- each keyword in interest.keywords
19+
each keyword in interest.keywords
2020
span.label.label-keyword= keyword

jade/background/publications.jade pug/background/publications.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ unless _.isEmpty(resume.publications)
1010

1111
.content
1212
ul.list-unstyled.clear-margin
13-
- each publication in resume.publications
13+
each publication in resume.publications
1414
li.card.card-nested
1515
.content
1616
p.clear-margin

jade/background/references.jade pug/background/references.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unless _.isEmpty(resume.references)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each reference_info in resume.references
12+
each reference_info in resume.references
1313
li.card.card-nested
1414
if reference_info.website
1515
a(href=reference_info.website, target="_blank")= reference_info.name

jade/background/skills.jade pug/background/skills.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unless _.isEmpty(resume.skills)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each skill in resume.skills
12+
each skill in resume.skills
1313
li.card.card-nested.card-skills
1414
if skill.display_progress_bar
1515
.skill-level(data-toggle="tooltip", title=skill.level, data-placement="left")
@@ -20,5 +20,5 @@ unless _.isEmpty(resume.skills)
2020

2121
unless _.isEmpty(skill.keywords)
2222
.space-top.labels
23-
- each keyword in skill.keywords
23+
each keyword in skill.keywords
2424
span.label.label-keyword= keyword

jade/background/volunteer-work.jade pug/background/volunteer-work.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unless _.isEmpty(resume.volunteer)
99

1010
.content
1111
ul.list-unstyled.clear-margin
12-
- each volunteer_info in resume.volunteer
12+
each volunteer_info in resume.volunteer
1313
li.card.card-nested
1414
.content
1515
p.clear-margin.relative
@@ -34,5 +34,5 @@ unless _.isEmpty(resume.volunteer)
3434

3535
unless _.isEmpty(volunteer_info.highlights)
3636
ul
37-
- each highlight in volunteer_info.highlights
37+
each highlight in volunteer_info.highlights
3838
li.mop-wrapper!= highlight

jade/background/work-experience.jade pug/background/work-experience.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ unless _.isEmpty(resume.work)
88
h4.title.text-uppercase Work Experience
99

1010
ul.list-unstyled.clear-margin
11-
- each experience in resume.work
11+
each experience in resume.work
1212
li.card.card-nested.clearfix
1313
.content
1414
p.clear-margin.relative
@@ -39,5 +39,5 @@ unless _.isEmpty(resume.work)
3939

4040
unless _.isEmpty(experience.highlights)
4141
ul
42-
- each highlight in experience.highlights
42+
each highlight in experience.highlights
4343
li.mop-wrapper!= highlight

jade/floating-nav.jade pug/floating-nav.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ a(href="#").js-floating-nav-trigger.floating-nav-trigger
1010

1111
nav.floating-nav.js-floating-nav
1212
ul.list-unstyled
13-
- each nav_item in floating_nav_items
13+
each nav_item in floating_nav_items
1414
+make_nav_link(nav_item)

jade/profile-card.jade pug/profile-card.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mixin profile_card_detail(icon, info, itemprop, icon_title)
99
|#{info}
1010

1111
mixin render_links(profiles)
12-
- each profile in profiles
12+
each profile in profiles
1313
a.fs-2x.social-link(
1414
href=profile.url,
1515
target="_blank",

jade/scripts.jade pug/scripts.pug

File renamed without changes.
File renamed without changes.

serve.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
//
88

99
var http = require("http");
10-
var resume = require("resume-schema").resumeJson;
10+
var fs = require("fs");
11+
var resume = JSON.parse(fs.readFileSync('node_modules/resume-schema/resume.json', 'utf8'));
1112
var theme = require("./index.js");
1213
var path = require("path");
13-
var fs = require("fs");
1414

1515
var port = 8888;
1616
http.createServer(function(req, res) {
17-
var picture = resume.basics.picture.replace(/^\//, "");
17+
var picture = resume.basics.picture && resume.basics.picture.replace(/^\//, "");
18+
1819
if (picture && req.url.replace(/^\//, "") === picture.replace(/^.\//, "")) {
1920
var format = path.extname(picture);
2021
try {

0 commit comments

Comments
 (0)