Skip to content

Squarespace/base-template-npm

Repository files navigation

Base Template (npm Version)

This is the Squarespace Base Template, a minimal Squarespace template using Node Package Manager for local development, module installation and deployment.

Installation and use

Prerequisite:

If you haven't already, install the Squarespace Local Development Server. Then...

Clone this repository:

git clone git@github.com:Squarespace/base-template-npm.git

Install npm packages:

npm install

Start working:

npm start

... Make some changes.

Finally, deploy:

npm run deploy

Dependencies

Base Template depends on the following Squarespace modules for development:

Base Template also depends on the following modules at runtime:

Note: npm start will prompt you to install the Squarespace Local Development Server if you haven't already.

Full npm script reference

npm run build

Cleans the build folder, copies squarespace files (jsont, less, assets folder content) into the build folder, runs webpack to build the template javascript.

npm run watch

Runs build, then watches the source folder for changes to squarespace files and javascript, automatically updating the built template for each change.

npm start [-- options]

Runs watch, and simultaneously launches sqs-server. By default this runs on localhost:9000. If you want to use another port use the command:

npm start -- -p PORT

npm run deploy [-- options]

Deploys your built template to production using git. If not already configured, initializes a git repo for deployment in your build folder. Note this is separate from your source repository, and will only contain the production built template.

By default your deployment will be commited with just a timestamp message. If you want to provide a custom message use the command:

npm run deploy -- -m "your message"

Project Structure

/base-template-npm
|--- assets/
|--- blocks/
|--- build/             <-- generated by the build script, ignored by this repo
|--- collections/
|--- node_modules/      <-- generated by npm install, ignored by this repo
|--- pages/
|--- scripts/
|--- styles/
|--- site.region
|--- template.conf
|--- package.json        <-- defines build commands, template module dependencies
|--- webpack.config.json <-- webpack build settings

Copyright and License

Copyright 2016 Squarespace, INC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published