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
If you haven't already, install the Squarespace Local Development Server. Then...
Clone this repository:
git clone firstname.lastname@example.org:Squarespace/base-template-npm.git
Install npm packages:
... Make some changes.
npm run deploy
Base Template depends on the following Squarespace modules for development:
- @squarespace/toolbelt - utilities for building and deploying a template.
- webpack - The JS bundler we're using.
Base Template also depends on the following modules at runtime:
npm start will prompt you to install the Squarespace Local Development Server if you haven't already.
Full npm script reference
npm run build
npm run watch
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"
/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
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.