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

Migrate to pugjs #91

Merged
merged 1 commit into from
Dec 22, 2016
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/*
resume.json
build/*
*.DS_Store
public/
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fs = require('fs');
var jade = require('jade');
var pug = require('pug');
var _ = require('underscore');
var utils = require('jsonresume-themeutils');
var moment = require('moment');
Expand Down Expand Up @@ -169,7 +169,7 @@ function render(resume) {
reference_info.reference = convertMarkdown(reference_info.reference);
});

return jade.renderFile(__dirname + '/index.jade', {
return pug.renderFile(__dirname + '/index.pug', {
resume: resume,
floating_nav_items: getFloatingNavItems(resume),
css: css,
Expand Down
10 changes: 5 additions & 5 deletions index.jade → index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ html(lang="en")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1")
title= resume.basics.name
include jade/stylesheets
include pug/stylesheets.pug

body(itemscope, itemtype="http://schema.org/Person")
.container-fluid
.row.main.clearfix
include jade/floating-nav
include jade/profile-card
include jade/background-card
include pug/floating-nav.pug
include pug/profile-card.pug
include pug/background-card.pug

include jade/scripts
include pug/scripts.pug
15 changes: 0 additions & 15 deletions jade/background-card.jade

This file was deleted.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonresume-theme-elegant",
"version": "1.6.10",
"version": "1.7.11",
"description": "Elegant theme for jsonresume",
"main": "index.js",
"scripts": {
Expand All @@ -24,22 +24,22 @@
"dependencies": {
"gravatar": "^1.0.6",
"handlebars": "^2.0.0-alpha.4",
"jade": "^1.11.0",
"jsonresume-themeutils": "^1.3.2",
"markdown-it": "^6.0.1",
"markdown-it-abbr": "^1.0.3",
"moment": "^2.8.1",
"resume-schema": "0.0.15",
"pug": "^2.0.0-beta6",
"resume-schema": "0.0.16",
"tarball-extract": "0.0.3",
"underscore": "^1.6.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-less": "^0.11.4",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6",
"grunt-contrib-copy": "0.4.x",
"less": "^1.7.5",
"grunt-contrib-clean": "0.5.x",
"less": "^1.7.5"
"grunt-contrib-copy": "0.4.x",
"grunt-contrib-less": "^1.4.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6"
}
}
15 changes: 15 additions & 0 deletions pug/background-card.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
section.col-md-9.card-wrapper.pull-right
.card.background-card
h4.text-uppercase Background
hr

.background-details
include background/about.pug
include background/work-experience.pug
include background/skills.pug
include background/education.pug
include background/awards.pug
include background/volunteer-work.pug
include background/publications.pug
include background/interests.pug
include background/references.pug
File renamed without changes.
2 changes: 1 addition & 1 deletion jade/background/awards.jade → pug/background/awards.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless _.isEmpty(resume.awards)

.content
ul.list-unstyled.clear-margin
- each award in resume.awards
each award in resume.awards
li.card.card-nested
.content
p.clear-margin(itemprop="award")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless _.isEmpty(resume.education)

.content
ul.list-unstyled.clear-margin
- each education_info in resume.education
each education_info in resume.education
li.card.card-nested
.content
p.clear-margin.relative
Expand All @@ -31,5 +31,5 @@ unless _.isEmpty(resume.education)

unless _.isEmpty(education_info.courses)
.space-top.labels
- each course in education_info.courses
each course in education_info.courses
span.label.label-keyword= course
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ unless _.isEmpty(resume.interests)

.content
ul.list-unstyled.clear-margin
- each interest in resume.interests
each interest in resume.interests
li.card.card-nested
p
strong= interest.name

unless _.isEmpty(interest.keywords)
.space-top.labels
- each keyword in interest.keywords
each keyword in interest.keywords
span.label.label-keyword= keyword
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unless _.isEmpty(resume.publications)

.content
ul.list-unstyled.clear-margin
- each publication in resume.publications
each publication in resume.publications
li.card.card-nested
.content
p.clear-margin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless _.isEmpty(resume.references)

.content
ul.list-unstyled.clear-margin
- each reference_info in resume.references
each reference_info in resume.references
li.card.card-nested
if reference_info.website
a(href=reference_info.website, target="_blank")= reference_info.name
Expand Down
4 changes: 2 additions & 2 deletions jade/background/skills.jade → pug/background/skills.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless _.isEmpty(resume.skills)

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

unless _.isEmpty(skill.keywords)
.space-top.labels
- each keyword in skill.keywords
each keyword in skill.keywords
span.label.label-keyword= keyword
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless _.isEmpty(resume.volunteer)

.content
ul.list-unstyled.clear-margin
- each volunteer_info in resume.volunteer
each volunteer_info in resume.volunteer
li.card.card-nested
.content
p.clear-margin.relative
Expand All @@ -34,5 +34,5 @@ unless _.isEmpty(resume.volunteer)

unless _.isEmpty(volunteer_info.highlights)
ul
- each highlight in volunteer_info.highlights
each highlight in volunteer_info.highlights
li.mop-wrapper!= highlight
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ unless _.isEmpty(resume.work)
h4.title.text-uppercase Work Experience

ul.list-unstyled.clear-margin
- each experience in resume.work
each experience in resume.work
li.card.card-nested.clearfix
.content
p.clear-margin.relative
Expand Down Expand Up @@ -39,5 +39,5 @@ unless _.isEmpty(resume.work)

unless _.isEmpty(experience.highlights)
ul
- each highlight in experience.highlights
each highlight in experience.highlights
li.mop-wrapper!= highlight
2 changes: 1 addition & 1 deletion jade/floating-nav.jade → pug/floating-nav.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ a(href="#").js-floating-nav-trigger.floating-nav-trigger

nav.floating-nav.js-floating-nav
ul.list-unstyled
- each nav_item in floating_nav_items
each nav_item in floating_nav_items
+make_nav_link(nav_item)
2 changes: 1 addition & 1 deletion jade/profile-card.jade → pug/profile-card.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mixin profile_card_detail(icon, info, itemprop, icon_title)
|#{info}

mixin render_links(profiles)
- each profile in profiles
each profile in profiles
a.fs-2x.social-link(
href=profile.url,
target="_blank",
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
//

var http = require("http");
var resume = require("resume-schema").resumeJson;
var fs = require("fs");
var resume = JSON.parse(fs.readFileSync('node_modules/resume-schema/resume.json', 'utf8'));
var theme = require("./index.js");
var path = require("path");
var fs = require("fs");

var port = 8888;
http.createServer(function(req, res) {
var picture = resume.basics.picture.replace(/^\//, "");
var picture = resume.basics.picture && resume.basics.picture.replace(/^\//, "");

if (picture && req.url.replace(/^\//, "") === picture.replace(/^.\//, "")) {
var format = path.extname(picture);
try {
Expand Down