From 87c694eec35866ef0a194cc11aa6d9926ae4836f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 1 Jan 2023 20:27:18 +0000 Subject: [PATCH] build: initial configuration of Tailwind CSS --- fractal/.gitignore | 1 + fractal/assets/tailwind.config.js | 2 +- fractal/fractal.config.js | 6 +++++- fractal/src/components/_preview.njk | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 fractal/src/components/_preview.njk diff --git a/fractal/.gitignore b/fractal/.gitignore index 2ccbe465..ad09d979 100644 --- a/fractal/.gitignore +++ b/fractal/.gitignore @@ -1 +1,2 @@ /node_modules/ +/public/build/ diff --git a/fractal/assets/tailwind.config.js b/fractal/assets/tailwind.config.js index 32e3abde..482ccd15 100644 --- a/fractal/assets/tailwind.config.js +++ b/fractal/assets/tailwind.config.js @@ -1,6 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: [], + content: ["./src/**/*.njk"], theme: { extend: {}, }, diff --git a/fractal/fractal.config.js b/fractal/fractal.config.js index dcb13f62..a0fd4b82 100644 --- a/fractal/fractal.config.js +++ b/fractal/fractal.config.js @@ -1,7 +1,8 @@ 'use strict'; const fractal = module.exports = require('@frctl/fractal').create(); -const mandelbrot = require("@frctl/mandelbrot") +const mandelbrot = require("@frctl/mandelbrot"); +const path = require("path"); fractal.set('project.title', 'oliverdavies.uk'); @@ -9,8 +10,11 @@ fractal.components.set('path', __dirname + '/src/components'); fractal.components.engine(require('@frctl/nunjucks')); fractal.components.set('ext', '.njk'); + fractal.docs.set('path', __dirname + '/src/docs'); +fractal.web.set('static.path', path.join(__dirname, 'public')); + fractal.web.theme( mandelbrot({ information: [ diff --git a/fractal/src/components/_preview.njk b/fractal/src/components/_preview.njk new file mode 100644 index 00000000..4784054b --- /dev/null +++ b/fractal/src/components/_preview.njk @@ -0,0 +1,17 @@ + + + + + + + + {{ _target.title }} · {{ _config.project.title }} + + + + + + {{ yield | safe }} + + +