| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- import {
- compileSass,
- copy,
- generateFavicons,
- generateRouteAssets,
- generateSitemap,
- imageToWebP,
- optimiseSvg,
- renderTemplate,
- renderIndex,
- renderMarkdownToMeta,
- renderMarkdownWithTemplate,
- generateTaxonomy,
- } from "./actions/index.js"
- export const tasks = [
- [
- {
- key: "images",
- name: "Images",
- action: imageToWebP,
- jobConfig: {
- inputFiles: [{ pattern: "images/content/*.jpg" }],
- stripPaths: ["images/content/"],
- outputDir: "images/",
- outputFileExtension: ".webp",
- },
- actionConfig: {
- imageSizes: [
- "640w",
- "768w",
- "1024w",
- "1366w",
- "1600w",
- "1920w",
- "2560w",
- ],
- quality: 80,
- },
- },
- {
- key: "styles",
- name: "Styles",
- action: compileSass,
- jobConfig: {
- inputFiles: [{ pattern: "styles/**/*.scss", ignore: "**/_*.scss" }],
- stripPaths: ["styles/"],
- outputDir: "static/styles/",
- outputFileExtension: ".css",
- },
- actionConfig: {},
- },
- {
- key: "icons",
- name: "Icons",
- action: optimiseSvg,
- jobConfig: {
- inputFiles: [{ pattern: "images/icons/*.svg" }],
- stripPaths: ["images/"],
- outputDir: "static/",
- outputFileExtension: ".svg",
- },
- actionConfig: {},
- },
- {
- key: "static-files",
- name: "Static Files",
- action: copy,
- jobConfig: {
- inputFiles: [{ pattern: "static/*" }],
- stripPaths: ["static/"],
- },
- actionConfig: {},
- },
- {
- key: "favicons",
- name: "Favicons",
- action: generateFavicons,
- jobConfig: {
- inputFiles: [{ pattern: "images/favicon/*" }],
- stripPaths: ["images/favicon/"],
- outputDir: "static/meta/",
- },
- actionConfig: {},
- },
- {
- key: "routes",
- name: "Routes",
- action: generateRouteAssets,
- jobConfig: {
- inputFiles: [{ pattern: "gpx/**/*.gpx" }],
- stripPaths: ["gpx/"],
- outputDir: "routes/",
- outputFileExtension: ".gpx",
- },
- actionConfig: {
- imageSizes: [
- "640w",
- "768w",
- "1024w",
- "1366w",
- "1600w",
- "1920w",
- "2560w",
- ],
- quality: 80,
- },
- },
- ],
- {
- key: "blog-markdown",
- name: "Blog Markdown",
- action: renderMarkdownToMeta,
- jobConfig: {
- inputFiles: [{ pattern: "markdown/blog/*.md" }],
- stripPaths: ["markdown/"],
- outputFileExtension: ".html",
- },
- actionConfig: {},
- },
- {
- key: "markdown",
- name: "Markdown",
- action: renderMarkdownToMeta,
- jobConfig: {
- inputFiles: [{ pattern: "markdown/*.md" }],
- stripPaths: ["markdown/"],
- outputFileExtension: ".html",
- },
- actionConfig: {},
- },
- [
- {
- key: "author-taxonomy",
- name: "Author Taxonomy",
- action: generateTaxonomy,
- jobConfig: {
- stateSelectors: ["resources.blog-markdown"],
- expand: false,
- skipCache: true,
- },
- actionConfig: {
- indexOn: "author",
- orderBy: "date",
- properties: [
- "title", "href", "date", "modified", "author", "tags", "description",
- ],
- sortAscending: false,
- },
- },
- {
- key: "tag-taxonomy",
- name: "Tag Taxonomy",
- action: generateTaxonomy,
- jobConfig: {
- stateSelectors: ["resources.blog-markdown"],
- expand: false,
- skipCache: true,
- },
- actionConfig: {
- indexOn: "tags",
- orderBy: "date",
- properties: [
- "title", "href", "date", "modified", "author", "tags", "description",
- ],
- sortAscending: false,
- },
- },
- {
- key: "blog-latest",
- name: "Blog Latest",
- action: generateTaxonomy,
- jobConfig: {
- stateSelectors: ["resources.blog-markdown"],
- expand: false,
- skipCache: true,
- },
- actionConfig: {
- orderBy: "date",
- properties: [
- "title", "href", "date", "modified", "author", "tags", "description",
- ],
- sortAscending: false,
- },
- },
- {
- key: "includes",
- name: "Includes",
- action: renderTemplate,
- jobConfig: {
- inputFiles: [{ pattern: "includes/*.hbs" }],
- stripPaths: ["includes/"],
- outputFileExtension: ".html",
- },
- actionConfig: {},
- },
- ],
- [
- {
- key: "render-pages",
- name: "Render Pages",
- action: renderMarkdownWithTemplate,
- jobConfig: {
- inputFiles: [{ pattern: "markdown/*.md" }],
- stripPaths: ["markdown/"],
- outputFileExtension: ".html",
- },
- actionConfig: {
- templateDirs: ["templates/", "~/.rhedyn/templates/"],
- partialDirs: ["partials/", "~/.rhedyn/partials/"],
- defaultTemplate: "page",
- },
- },
- {
- key: "render-blog-pages",
- name: "Render Blog Pages",
- action: renderMarkdownWithTemplate,
- jobConfig: {
- inputFiles: [{ pattern: "markdown/blog/*.md" }],
- stripPaths: ["markdown/"],
- outputFileExtension: ".html",
- },
- actionConfig: {
- templateDirs: ["templates/", "~/.rhedyn/templates/"],
- partialDirs: ["partials/", "~/.rhedyn/partials/"],
- defaultTemplate: "article",
- },
- },
- {
- key: "render-author-indexes",
- name: "Render Author Indexes",
- action: renderIndex,
- jobConfig: {
- stateSelectors: ["resources.author-taxonomy.detail"],
- outputFileExtension: ".html",
- outputDir: "blog/by-author/",
- buildFilePath: true,
- itemsPerPage: 10,
- },
- actionConfig: {
- writeOut: true,
- templateDirs: ["templates/", "~/.rhedyn/templates/"],
- partialDirs: ["partials/", "~/.rhedyn/partials/"],
- },
- },
- {
- key: "render-tag-indexes",
- name: "Render Tag Indexes",
- action: renderIndex,
- jobConfig: {
- stateSelectors: ["resources.tag-taxonomy.detail"],
- outputFileExtension: ".html",
- outputDir: "blog/by-tag/",
- buildFilePath: true,
- itemsPerPage: 10,
- },
- actionConfig: {
- writeOut: true,
- templateDirs: ["templates/", "~/.rhedyn/templates/"],
- partialDirs: ["partials/", "~/.rhedyn/partials/"],
- },
- },
- {
- key: "render-blog-home",
- name: "Render Blog Home",
- action: renderIndex,
- jobConfig: {
- stateSelectors: ["resources.blog-latest.detail"],
- outputFileExtension: ".html",
- outputDir: "blog/",
- expand: false,
- outputFileName: "index",
- buildFilePath: true,
- itemsPerPage: 10,
- },
- actionConfig: {
- writeOut: true,
- templateDirs: ["templates/", "~/.rhedyn/templates/"],
- partialDirs: ["partials/", "~/.rhedyn/partials/"],
- title: "Blog",
- },
- },
- ],
- {
- key: "sitemap",
- name: "Sitemap",
- action: generateSitemap,
- jobConfig: {
- stateSelectors: [
- "resources.render-pages",
- "resources.render-blog-pages",
- "resources.render-author-indexes",
- "resources.render-tag-indexes",
- "resources.render-blog-home",
- ],
- expand: false,
- skipCache: true,
- },
- actionConfig: {
- outputFileName: "sitemap.xml",
- },
- },
- ]
- export const opts = {
- outDir: "dist/",
- runDir: process.cwd(),
- cacheDir: ".cache",
- include: {
- styles: [{ pattern: "~/.rhedyn/styles/*.scss" }],
- },
- clean: true,
- ignoreExisting: false,
- logLevel: "info",
- includeStateValues: true,
- itemsPerPage: 25,
- markdown: {
- allowHtml: false,
- },
- site: {
- name: "Website generated by Rhedyn",
- shortName: "Rhedyn test site",
- description: "A website generated from files using Rhedyn",
- author: "Craig Fletcher",
- url: "https://www.leakypixel.net",
- language: "en-GB",
- backgroundColor: "#22242c",
- themeColor: "#f00",
- },
- }
- const defaults = {
- opts,
- tasks,
- }
- export default defaults
|