Files
917c8568fe New design (#42) (#45)
* Add new design

* Use yarn instead of npm

* Add 404 page style

* Update "See VAC Openings" CTA

* Change VAC to Vac

* Change specs link

* Keep post categories

* Change code formatting

* Update images

* Update media links

* Add media image default

* Update package.json

* Add twitter cards meta data

* Add media section back

* Remove images

* Comment script for form

* Change media urls to https

* Import font locally

* Add Anonymous font

* Change inner page layout

* Change pre code style

* Add font preloading

* Change post content styles

* Add alt attribute

* Change footer research links

* Update gitignore

* Add Fathom analytics

* Update links

* Change gif to video

* Add work cards links back

* Change footer spacing

* Change logo size

* Fix header

* Centered section join

* Make cards clickable

* Align left section join

* Remove graphic & video section about

* Return logo size

* Add post for Waku v1 vs Waku v2 bandwidth comparison (#43)

* Add post for Waku v1 vs Waku v2 bandwidth comparison

* Addressing PR comments

* Added future work. Minor changes to intro.

(cherry picked from commit 007696cfc9)

* Add <code> styles

* Add Hanno page

* Add opinion piece on ethics in surveillance tech (#44)

* Add opinion piece on ethics in surveillance tech

* Change published date. Added preface.

* wrong date - today is 3rd

(cherry picked from commit c64f5a889e)

* Add circe page

Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com>
Co-authored-by: thecirce <95408261+thecirce@users.noreply.github.com>

Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com>
Co-authored-by: thecirce <95408261+thecirce@users.noreply.github.com>
2021-12-14 12:03:25 +08:00

98 lines
2.3 KiB
JavaScript

import autoprefixer from "autoprefixer";
import browserSync from "browser-sync";
import spawn from "cross-spawn";
import cssnano from "cssnano";
import { dest, series, src, task, watch } from "gulp";
import postcss from "gulp-postcss";
import atimport from "postcss-import";
import imagemin from "gulp-imagemin";
import tailwindcss from "tailwindcss";
const SITE_ROOT = "./_site";
const POST_BUILD_STYLESHEET = `${SITE_ROOT}/assets/css/`;
const PRE_BUILD_STYLESHEET = "./assets/css/style.css";
const IMAGES = "./assets/img";
const IMAGES_MINIMIZED = `${SITE_ROOT}/assets/`;
const TAILWIND_CONFIG = "./tailwind.config.js";
// Fix for Windows compatibility
const jekyll = process.platform === "win32" ? "jekyll.bat" : "jekyll";
const isDevelopmentBuild = process.env.NODE_ENV === "development";
task("buildJekyll", () => {
browserSync.notify("Building Jekyll site...");
const args = ["exec", jekyll, "build"];
if (isDevelopmentBuild) {
args.push("--incremental");
}
return spawn("bundle", args, { stdio: "inherit" });
});
task("processStyles", () => {
browserSync.notify("Compiling styles...");
return src(PRE_BUILD_STYLESHEET)
.pipe(
postcss([
atimport(),
tailwindcss(TAILWIND_CONFIG),
...(isDevelopmentBuild ? [] : [autoprefixer(), cssnano()]),
])
)
.pipe(dest(POST_BUILD_STYLESHEET));
});
task("cname", () => {
return src('assets/CNAME').pipe(dest(SITE_ROOT));
});
task("images", () => {
return src(IMAGES)
.pipe(
imagemin([
imagemin.gifsicle({ interlaced: true }),
imagemin.optipng({ optimizationLevel: 3 }),
imagemin.svgo(),
])
)
.pipe(dest(IMAGES_MINIMIZED));
});
task("startServer", () => {
browserSync.init({
files: [SITE_ROOT + "/**"],
open: "local",
port: 4000,
server: {
baseDir: SITE_ROOT,
serveStaticOptions: {
extensions: ["html"],
},
},
});
watch(
[
"**/*.css",
"**/*.html",
"**/*.js",
"**/*.md",
"**/*.markdown",
"!_site/**/*",
"!node_modules/**/*",
],
{ interval: 500 },
buildSite
);
});
const buildSite = series("buildJekyll", "processStyles", "images", "cname");
exports.serve = series(buildSite, "startServer");
exports.default = series(buildSite);