1.5.2 ā€¢ Published 13 days ago

@wethegit/sweet-potato-cooker v1.5.2

Weekly downloads
183
License
-
Repository
github
Last release
13 days ago

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/"];
}
1.5.2

13 days ago

1.5.1

2 months ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.0.10

3 years ago

1.0.9

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.9.7-beta.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.9

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.0

4 years ago

0.9.1

4 years ago

0.8.4

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.7.6

4 years ago

0.7.5

4 years ago

0.7.7

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.5

4 years ago

0.6.3

4 years ago

0.6.4

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.2

4 years ago

0.3.3

4 years ago