Branch: master
Find file History
timothyis Add Gridsome example (#205)
* Add gridsome example

* Update README.md

Co-Authored-By: timothyis <1695613+timothyis@users.noreply.github.com>
Latest commit e501e5a Dec 21, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src Add Gridsome example (#205) Dec 21, 2018
.gitignore Add Gridsome example (#205) Dec 21, 2018
.nowignore Add Gridsome example (#205) Dec 21, 2018
README.md Add Gridsome example (#205) Dec 21, 2018
gridsome.config.js Add Gridsome example (#205) Dec 21, 2018
now.json Add Gridsome example (#205) Dec 21, 2018
package.json Add Gridsome example (#205) Dec 21, 2018
yarn.lock Add Gridsome example (#205) Dec 21, 2018

README.md

Gridsome

Gridsome is a Vue-powered static site generator for building websites for any CMS or data source. It uses a local unified GraphQL data layer for all data, and can generate thousands of pages in seconds. Gridsome is heavily inspired by Gatsby (A React.js alternative).

Step 1: Getting Started with Gridsome

Setup with Gridsome by using the CLI package from the npm registry:

npx @gridsome/cli create my-gridsome-project

The above command will have setup a gridsome project, ready to go. This includes scripts in the package.json file such as develop which will start a local development server.

yarn develop

To learn more about developing with Gridsome, view their documentation: https://gridsome.org/docs

Step 2: Preparing to Deploy

To deploy to Now, you need to tell Now how to build our Gridsome project. You can do this by first creating a now.json file:

{
  "version": 2,
  "builds": [
    { "src": "package.json", "use": "@now/static-build" }
  ]
}

The above configures the project to:

  • Build on Now 2.0

  • When deploying, use the @now/static-build builder to build our app

    However, the @now/static-build builder requires that you pass it instructions on how to build the project. We can do this by creating a now-build script in the package.json file:

{
  ...
  "scripts": {
    ...
    "now-build": "yarn build"
  }
}

And with that, your deployment setup is complete and the Gridsome project is ready to deploy live.

Step 3: Deploying to Now

The final step is to run the following in your terminal, from the root of your Gridsome project:

now

Resources