Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@elucidata/tilt

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elucidata/tilt

Static website toolkit with Metalsmith underpinnings

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Tilt

Static website toolkit with Metalsmith underpinnings

npm install --save-dev @elucidata/tilt

Example Configuration

build.js

import { dirname } from 'path';
import { Tilt } from '@elucidata/tilt'
import * as layouts from './theme/layouts.js'

const info = {
  site: {
    title: "A Test Blog",
    author: "Me",
    description: "A simple example of a simple blog. Simple.",
    url: 'http://localhost',
  },
  build: {
    cwd: dirname(new URL(import.meta.url).pathname),
    source: './content',
    destination: './www',
    clean: true,
  }
}

const site = Tilt.configure((site) => { site
  .setBuildInfo(info.build)
  .setSiteInfo(info.site)
  .enableLayouts(layouts)
  .enableGenerators()
  .enableAliases()
  .enableCleanUrls()
  .enableTaxonomy()
  .applyDefaultMetadata({
    "posts/**": {
      layout: "Post",
    },
  })
  .enableCollections({
    "posts/**": {},
  })
  .enableDrafts({
    mode: process.env.NODE_ENV === "production" ? 'purge' : 'mark',
    collections: ["posts"]
  })
  .enableContentRegistry({
    css: `theme/css/shared.css`,
    js: `theme/js/shared.js`
  })
  .copyStaticFiles({
    './assets': './',
    './theme/assets': './theme',
  })
})


console.time("Site built");
console.log("Building...")

site.build((err) => {
  if (err) throw err
  console.timeEnd("Site built");
})

Keywords

Static

FAQs

Package last updated on 08 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts