Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
point five past light speed

Joel Varty joelvarty

🚀
point five past light speed
View GitHub Profile
View gist:da61f43a986881e5ffdf2e3f39726b1c
<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service behaviorConfiguration="agilityWebsiteServiceBehavior" name="Agility.Web.AgilityWebsiteService">
        <endpoint binding="wsHttpBinding" bindingConfiguration="agilityWebsiteServiceBinding" contract="Agility.Web.IAgilityWebsiteService" />
        <endpoint binding="wsHttpBinding" bindingConfiguration="agilityWebsiteServiceBindingSSL" contract="Agility.Web.IAgilityWebsiteService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
@joelvarty
joelvarty / TwoColumnTemplate.jsx
Last active Aug 19, 2019
Agility Tutorial for creating a react page template
View TwoColumnTemplate.jsx
import React, { Component } from 'react';
import { ContentZone } from '../agility-react'
class TwoColumnTemplate extends Component {
render() {
return (
<div className="two-column-template">
<div className="main-column">
<ContentZone name='MainContentZone' {...this.props} />
@joelvarty
joelvarty / OneColumnTemplate.js
Created Sep 5, 2019
React Page Template Component Example
View OneColumnTemplate.js
import React, { Component } from 'react';
import { ContentZone } from '../agility-react'
class OneColumnTemplate extends Component {
render() {
return (
<div className="one-column-template">
<ContentZone name='MainContentZone' {...this.props} />
</div>
@joelvarty
joelvarty / pagerouter1.js
Last active Sep 6, 2019
React Page Router
View pagerouter1.js
async routePage() {
const api = this.props.agility.client;
try {
//get the sitemap route table
let sitemap = await this.getSitemap(api);
//get the path from the browser
const path = document.location.pathname.toLowerCase();
let pageInSitemap = sitemap[path];
@joelvarty
joelvarty / flatsitemap.json
Last active Sep 6, 2019
Agility CMS Sitemap Examples
View flatsitemap.json
{
"/home": {
"title": "Home",
"name": "home",
"pageID": 2
},
"/posts": {
"title": "Posts",
"name": "posts",
"pageID": 3
@joelvarty
joelvarty / AgilityConfig.js
Last active Sep 6, 2019
Agility Tutorial for react Page Templates (2)
View AgilityConfig.js
//Our Agility Modules
import RichTextArea from './modules/RichTextArea'
import Jumbotron from './modules/Jumbotron'
//Our Agility PageTemplates
import OneColumnTemplate from './pageTemplates/OneColumnTemplate'
export default {
guid: '...', //Set your guid here
fetchAPIKey: '...', //Set your fetch apikey here
@joelvarty
joelvarty / JumboTron.js
Created Sep 6, 2019
Agility Tutorial Module
View JumboTron.js
import React, { Component } from 'react';
import './Jumbotron.css'
class Jumbotron extends Component {
render() {
return (
<section className="jumbotron">
<h1>{this.props.item.fields.title}</h1>
<h2>{this.props.item.fields.subTitle}</h2>
@joelvarty
joelvarty / App.js
Created Sep 6, 2019
React Routing Tutorial
View App.js
import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom'
import './App.css';
//The Agility Router
import { PageRouter } from './agility-react'
//Shared Components
import GlobalHeader from './GlobalHeader'
@joelvarty
joelvarty / Stackpath Edge Worker Example 1
Last active Mar 10, 2020
Stackpath Edge Worker Example 1
View Stackpath Edge Worker Example 1
// script entry point
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request));
});
/**
* Fetch and return the request body
* @param {Request} request
*/
async function handleRequest(request) {