This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
siteMetadata: { | |
title: "Agility CMS Gatsby Starter", | |
}, | |
plugins: [ | |
... | |
{ | |
//the name of the plugin | |
resolve: "@agility/gatsby-source-agilitycms", | |
//the options for our plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { graphql } from "gatsby" | |
import agilityUtils from './agility/utils' | |
import AgilityPageTemplate from './agility/components/AgilityPageTemplate' | |
//Some things we need for our layout | |
import LayoutTemplate from "./components/LayoutTemplate" | |
import PreviewBar from "./components/PreviewBar" | |
import GlobalHeader from './components/GlobalHeader' | |
import SEO from './components/SEO' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agility.Search.Conversion({ | |
url: 'https://www.agilitycms.com/products/agility-search' | |
}).success(function(resp){ | |
//success | |
}).error(function(err){ | |
//error | |
}).always(function(){ | |
//always | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agility.Search.GroupedQuery({ | |
query: 'agility', | |
languageCode: 'en-ca', //optional | |
top: 5, //optional | |
domain: 'agilitycms.com', //optional | |
groupCount: 3 //optional | |
}).success(function(resp){ | |
//success | |
}).error(function(err){ | |
//error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agility.Search.AutoComplete({ | |
query: 'agility', | |
languageCode: 'en-ca', //optional | |
domain: 'www.site.com', //optional | |
category: 'product', // optional | |
top: 100, //optional | |
fuzzy: true //optional | |
}).success(function(resp){ | |
//success | |
}).error(function(err){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agility.Search.Query({ | |
query: 'agility', | |
languageCode: 'en-ca', //optional | |
category: 'product', // optional | |
domain: 'agilitycms.com', //optional | |
top: 100, //optional | |
skip: 0 //optional | |
}) | |
.success(function(resp){ | |
//success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './ImageLink.css' | |
class ImageLink extends Component { | |
render() { | |
return ( | |
<section className="imagelink"> | |
<h3>{this.props.item.fields.title}</h3> | |
<a href={this.props.item.fields.linkURL.href} target={this.props.item.fields.linkURL.target}> | |
<div> | |
<img src={this.props.item.fields.image.url + '?w=300&h=300'} alt={this.props.item.fields.image.label} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/sitemap/flat/website | |
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac" | |
{ | |
"/home": { | |
"title": "Home", | |
"name": "home", | |
"pageID": 2, | |
"menuText": "New Home Text", | |
"visible": { | |
"menu": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/page/2 | |
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac" | |
{ | |
"pageID": 2, | |
"name": "home", | |
"path": null, | |
"title": "Home", | |
"menuText": "New Home Text", | |
"pageType": "static", | |
"templateName": "One Column Template", |
NewerOlder