npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wethegit/sweet-potato-cooker

v1.5.2

Published

Opinionated and minimal static website generator

Downloads

262

Readme

sweet-potato-cooker 👩‍🍳

An opinionated static site generator that uses Pug as a template engine with yaml files for localization and Sass for styles.

sweet-potato-cooker is part of the sweet-potato suite of tools. For information on how to structure the project check the sweet-potato docs.

Usage

Initiate a new project with npm and install.

npm init
npm install --save-dev @wethegit/sweet-potato-cooker

Create a pages/ folder and an index.pug file.

mkdir pages
touch pages/index.pug

You are all set!

🍽 Development

Serves it and watches for changes on the project:

npx sweet-potato-cooker start

👷‍♀️ Production

This builds your project into a directory named build/ that you can deploy to your edge of choice.

npx sweet-potato-cooker build

Note: for a quicker setup it's recommended to add these scripts to package.json.

"scripts": {
  "start": "sweet-potato-cooker start",
  "build": "sweet-potato-cooker build"
}

See all commands & options

npx sweet-potato-cooker --help

Config

Create a sweet-potato.config.js in the root of the project same level as package.json and export a config object.

module.exports = {
  // Options
  buildDirectory: "dist/",
};

buildDirectory

Type: string
Default: build
Specify the directory to which build the files to.

sourceDirectory

Type: string
Default: .
Specify the source directory.

locales

Type: object
Localization configuration.

locales.directoryName

Default: locales
Name of the directory where the localization .yaml files live.

locales.defaultName

Default: default
Name of the default locale and locale file.
🚨 Important to note that the default locale won't be placed inside a sub directory. For example, a fr.yaml locale output will be /fr/index.html whereas a default.yaml output will be /index.html.

sassOptions

Type: function
Default: null
A function that will receive the file and environment as parameters and must return an object with valid node-sass options.
Example:

{
  sassOptions: (isDev, file) => { return { // all options here } }
}

sitemap

Type: string || boolean
Default: false
If set, will generate a sitemap.xml during the production build.
If a string is provided, will use it as the base url.
If true, will use the PUBLIC_URL value from the .env file.

breakpoints

Type: object
Default: false

An object with key/value pair where the key is the name of the breakoint and the value is a valid media query.
These will be passed to pug, scss and js files.

Example

{
  breakpoints: {
    'medium-up': '(min-width: 768px)',
    'large-up': '(min-width: 1024px)',
    'medium-only': '(min-width: 768px) and (max-width: 1023px)'
  }
}

ignoreOnWatch

Type: array
Default: false

Defines files/paths to be ignored during local development.
By default the following are ignored:

  • "node_modules"
  • ".git"
  • "build"
  • ".vscode"
  • "package.json"
  • "package-lock.json"
  • "yarn-lock.json"

Example

{
  ignoreOnWatch: ["Dockerfile", "server/"];
}