Working on custom theme
This commit is contained in:
parent
a98d13f794
commit
b4e3460f8d
37
gulpfile.js
Normal file
37
gulpfile.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
const { src, dest, watch, series } = require('gulp')
|
||||||
|
const pug = require('gulp-pug')
|
||||||
|
const sass = require('gulp-sass')(require('sass'))
|
||||||
|
const bs = require('browser-sync').create()
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
function css () {
|
||||||
|
return src('./theme/styles.scss')
|
||||||
|
.pipe(sass())
|
||||||
|
.pipe(dest('./theme'))
|
||||||
|
}
|
||||||
|
|
||||||
|
function html () {
|
||||||
|
const resume = JSON.parse(fs.readFileSync('./resume.json', 'utf-8'))
|
||||||
|
|
||||||
|
return src('./theme/template.pug')
|
||||||
|
.pipe(pug({ data: { resume } }))
|
||||||
|
.pipe(dest('./public'))
|
||||||
|
}
|
||||||
|
|
||||||
|
function serve () {
|
||||||
|
bs.init({
|
||||||
|
server: {
|
||||||
|
baseDir: './public',
|
||||||
|
index: 'template.html'
|
||||||
|
},
|
||||||
|
ui: false,
|
||||||
|
open: false
|
||||||
|
})
|
||||||
|
|
||||||
|
watch('./theme/**/*.scss', series(css, html))
|
||||||
|
watch(['./theme/**/*.pug', './resume.json'], html)
|
||||||
|
bs.watch('./public/*.html').on('change', bs.reload)
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.css = css
|
||||||
|
exports.default = series(css, html, serve)
|
10
index.js
Normal file
10
index.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const pug = require('pug');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const render = (resume) => pug.renderFile(path.join(__dirname, 'theme', 'template.pug'),{
|
||||||
|
resume
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
render,
|
||||||
|
}
|
6248
package-lock.json
generated
6248
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -1,11 +1,22 @@
|
|||||||
{
|
{
|
||||||
|
"name": "resume",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "resume serve --theme elegant",
|
"dev": "resume serve --theme .",
|
||||||
"resume": "resume",
|
"resume": "resume",
|
||||||
"build": "mkdir -p out && resume export out/resume.pdf && resume export out/resume.html"
|
"build": "mkdir -p out && resume export out/resume.pdf && resume export out/resume.html"
|
||||||
},
|
},
|
||||||
|
"author": "Thomas Cole",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-pug": "^5.0.0",
|
||||||
|
"gulp-sass": "^5.1.0",
|
||||||
"jsonresume-theme-elegant": "^1.16.1",
|
"jsonresume-theme-elegant": "^1.16.1",
|
||||||
"resume-cli": "^3.0.8"
|
"pug": "^3.0.2",
|
||||||
|
"resume-cli": "^3.0.8",
|
||||||
|
"sass": "^1.60.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
0
theme/styles.css
Normal file
0
theme/styles.css
Normal file
1
theme/styles.scss
Normal file
1
theme/styles.scss
Normal file
@ -0,0 +1 @@
|
|||||||
|
@charset "UTF-8";
|
8
theme/template.pug
Normal file
8
theme/template.pug
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
doctype html
|
||||||
|
html(lang="en")
|
||||||
|
head
|
||||||
|
meta(charset="utf-8")
|
||||||
|
style
|
||||||
|
include styles.css
|
||||||
|
title=`Resume ${resume.basics.name}`
|
||||||
|
body
|
Loading…
Reference in New Issue
Block a user