add script to helmet

This commit is contained in:
Austin Green 2017-10-27 21:17:54 -04:00
parent 6897e6a97c
commit 515d3ab4ec
3 changed files with 12 additions and 3 deletions

View file

@ -18,6 +18,12 @@ $ cd [SITE_DIRECTORY_NAME]
$ gatsby build
$ gatsby serve
```
## Accessing the CMS
### Accessing the CMS
Follow the [Netlify CMS Quick Start Guide](https://www.netlifycms.org/docs/quick-start/#authentication) to set up authentication, and hosting.
## Take a Test Drive
Netlify CMS can run in any frontend web environment, but the quickest way to try it out is by running it on a pre-configured starter site with Netlify. Our example here is the Kaldi coffee company template. Use the button below to build and deploy your own copy of the repository:
<a href="https://app.netlify.com/start/deploy?repository=https://github.com/AustinGreen/gatsby-starter-netlify-cms/&amp;stack=cms"><img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify"></a>
After clicking that button, youll authenticate with GitHub and choose a repository name. Netlify will then automatically create a repository in your GitHub account with a copy of the files from the template. Next, it will build and deploy the new site on Netlify, bringing you to the site dashboard when the build is complete. Next, youll need to set up Netlifys Identity service to authorize users to log in to the CMS.

View file

@ -23,7 +23,6 @@ module.exports = class HTML extends React.Component {
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
{this.props.headComponents}
{css}
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js" />
</head>
<body {...this.props.bodyAttributes}>
{this.props.preBodyComponents}

View file

@ -1,10 +1,14 @@
import React from 'react';
import Link from 'gatsby-link';
import Helmet from 'react-helmet';
export default function Index({ data }) {
const { edges: posts } = data.allMarkdownRemark;
return (
<section className="section">
<Helmet>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js" />
</Helmet>
<div className="container">
{posts.filter(post => post.node.frontmatter.templateKey === 'blog-post').map(({ node: post }) => {
return (