This is the Squarespace Base Template, a minimal Squarespace template using Node Package Manager for local development, module installation and deployment.
Prerequisite:
If you haven't already, install the Squarespace Local Development Server. Then...
Clone this repository:
git clone [email protected]:Squarespace/base-template-npm.git
Install npm packages:
npm install
Start working:
npm start
... Make some changes.
Finally, deploy:
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:
- @squarespace/core - core Squarespace javascript functionality
Note: npm start
will prompt you to install the Squarespace Local Development Server if you haven't already.
Cleans the build folder, copies squarespace files (jsont, less, assets folder content) into the build folder, runs webpack to build the template javascript.
Runs build, then watches the source folder for changes to squarespace files and javascript, automatically updating the built template for each change.
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
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 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.