Added file inclusion macro. It's ALIVE!
parent
e7614d828e
commit
93d4bb41d1
56
build.js
56
build.js
|
@ -1,7 +1,55 @@
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
// const path = require('path');
|
||||||
|
const readline = require('readline')
|
||||||
|
|
||||||
//todo: read through files and fill in components before copying
|
const files = ["src/index.html",
|
||||||
fs.cp('./src/','./build', { recursive: true }, (err) => {
|
"src/projects/2016-XXXX.html"];
|
||||||
if (err) throw err;
|
|
||||||
console.log('Build was successful!');
|
files.forEach( file => {
|
||||||
|
// console.log(file + "...");
|
||||||
|
// console.log(file.split('/').slice(1).join('/') + "\n"); //remove /src
|
||||||
|
|
||||||
|
var file_buffer = "";
|
||||||
|
|
||||||
|
const rl = readline.createInterface({
|
||||||
|
input: fs.createReadStream(file),
|
||||||
|
output: process.stdout,
|
||||||
|
terminal: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const re = new RegExp('{% include \'*(.*)\' %}');
|
||||||
|
|
||||||
|
rl.on('line', line => {
|
||||||
|
const match = line.match(re);
|
||||||
|
if (match) {
|
||||||
|
file_buffer += fs.readFileSync(match[1], 'utf8');
|
||||||
|
} else {
|
||||||
|
file_buffer += line + "\n";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rl.on('close', () => {
|
||||||
|
//fs.mkdirSync('build/' + file.split('/').slice(1,-1).join('/')); // create dirs
|
||||||
|
ensureDirectoryExists('build/' + file.split('/').slice(1).join('/'));
|
||||||
|
fs.writeFileSync('build/' + file.split('/').slice(1).join('/'), file_buffer, 'utf8');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// fs.cp('./src/projects','./build/projects', { recursive: true }, (err) => {
|
||||||
|
// if (err) throw err;
|
||||||
|
// });
|
||||||
|
|
||||||
|
fs.cp('./src/styles','./build/styles', { recursive: true }, (err) => {
|
||||||
|
if (err) throw err;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function ensureDirectoryExists(filePath) {
|
||||||
|
var dirname = filePath.split('/').slice(0,-1).join('/');
|
||||||
|
if (fs.existsSync(dirname)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ensureDirectoryExists(dirname);
|
||||||
|
fs.mkdirSync(dirname);
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<div class="footer">
|
<footer>
|
||||||
<p>©2021 Jordan Hanrahan</p>
|
<p>©2023 Jordan Hanrahan</p>
|
||||||
</div>
|
</footer>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="/styles.css" />
|
<link rel="stylesheet" href="/styles/normalize.css" />
|
||||||
<title>Jordan Hanrahan - Portfolio</title>
|
<link rel="stylesheet" href="/styles/main.css" />
|
||||||
|
<title>Jordan Hanrahan - Portfolio</title>
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
|
|
|
@ -1,28 +1,5 @@
|
||||||
<!DOCTYPE html>
|
{% include 'src/components/head.html' %}
|
||||||
<html lang="en">
|
{% include 'src/components/header.html' %}
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="stylesheet" href="/styles/normalize.css" />
|
|
||||||
<link rel="stylesheet" href="/styles/main.css" />
|
|
||||||
<title>Jordan Hanrahan - Portfolio</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<div class="masthead">
|
|
||||||
<a href="/">
|
|
||||||
<div class="logo">
|
|
||||||
<h1>Jordan Hanrahan</h1>
|
|
||||||
<h2>Art Direction · Graphic Design · Motion Graphics</h2>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li><a href="/about.html">about</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<!-- the build script should generate links from items in project folder here. -->
|
<!-- the build script should generate links from items in project folder here. -->
|
||||||
<main>
|
<main>
|
||||||
<div class="projects">
|
<div class="projects">
|
||||||
|
@ -32,7 +9,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
{% include 'src/components/footer.html' %}
|
||||||
<p>©2023 Jordan Hanrahan</p>
|
|
||||||
</footer>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,44 +1,11 @@
|
||||||
<!--
|
<!--
|
||||||
---
|
---
|
||||||
date: 2021-02-01
|
|
||||||
thumbnail: "/uploads/cbc_xxxxportfoliocover_210202_v01.png"
|
thumbnail: "/uploads/cbc_xxxxportfoliocover_210202_v01.png"
|
||||||
title: XX XX
|
title: XX XX
|
||||||
categories:
|
|
||||||
- Graphic Design
|
|
||||||
- Art Direction
|
|
||||||
project_bg_color: ''
|
|
||||||
project_fg_color: ''
|
|
||||||
published: true
|
|
||||||
showcase: true
|
|
||||||
project_year: 2020
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
{% include 'src/components/head.html' %}
|
||||||
<html lang="en">
|
{% include 'src/components/header.html' %}
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="stylesheet" href="/styles/normalize.css" />
|
|
||||||
<link rel="stylesheet" href="/styles/main.css" />
|
|
||||||
<title>Jordan Hanrahan - Portfolio</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<div class="masthead">
|
|
||||||
<a href="/">
|
|
||||||
<div class="logo">
|
|
||||||
<h1>Jordan Hanrahan</h1>
|
|
||||||
<h2>Art Direction · Graphic Design · Motion Graphics</h2>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li><a href="/about.html">about</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<main>
|
<main>
|
||||||
<h1>XX XX</h1>
|
<h1>XX XX</h1>
|
||||||
<h2>Until it's recent closure, **XX XX** was one of South-East Asia's premiere venues for dance music, bringing local DJs and producers to the fore, while hosting international acts such as **Kevin Saunderson** <small>(KMS, Detroit)</small>, **FJAAK** <small>(50Weapons, Berlin)</small>, **Answer Code Request** <small>(Berghain/Ostgut Ton, Berlin)</small>, Jamie XX, **Chris Cruse** <small>(Spotlight, LA)</small>, **ND_Baumecker** <small>(Ostgut Ton, Berlin)</small>, **Sofie** <small>(Stones Throw/Boiler Room, LA)</small>, **Milton Bradley** <small>(Do Not Resist The Beat/Alien Rain, Berlin)</small> and many more.</h2>
|
<h2>Until it's recent closure, **XX XX** was one of South-East Asia's premiere venues for dance music, bringing local DJs and producers to the fore, while hosting international acts such as **Kevin Saunderson** <small>(KMS, Detroit)</small>, **FJAAK** <small>(50Weapons, Berlin)</small>, **Answer Code Request** <small>(Berghain/Ostgut Ton, Berlin)</small>, Jamie XX, **Chris Cruse** <small>(Spotlight, LA)</small>, **ND_Baumecker** <small>(Ostgut Ton, Berlin)</small>, **Sofie** <small>(Stones Throw/Boiler Room, LA)</small>, **Milton Bradley** <small>(Do Not Resist The Beat/Alien Rain, Berlin)</small> and many more.</h2>
|
||||||
|
@ -129,9 +96,5 @@
|
||||||
<img src="/uploads/cbc_xxxx/cbc_venuephotos_xxxx_181213_08.jpg" />
|
<img src="/uploads/cbc_xxxx/cbc_venuephotos_xxxx_181213_08.jpg" />
|
||||||
<img src="/uploads/cbc_xxxx/cbc_venuephotos_xxxx_181213_07.jpg" />
|
<img src="/uploads/cbc_xxxx/cbc_venuephotos_xxxx_181213_07.jpg" />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
{% include 'src/components/footer.html' %}
|
||||||
<p>©2023 Jordan Hanrahan</p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
Loading…
Reference in New Issue