Skip to content

Blog Starter for Azure Static Web Apps using CueBlox for data validation.

Notifications You must be signed in to change notification settings

cueblox/starter-azure-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CueBlox Blog on Azure Static Web Apps

A monorepo with content managed by CueBlox, served by an Azure Static Web Apps API, and a website that consumes it, also hosted on Azure Static Web Apps.

Website Demo

API/GraphQL Demo

GitHub Actions

.github/workflows/data.yml contains a workflow that will automatically create a pre-release named 'CueBlox' of your processed content every time you make a change to content in the /data/ folder.

This action uses pre-releases with a fixed name so that the download URL of your data is constant. For this sample repository it is https://github.com/cueblox/starter-azure-blog/releases/download/blox/data.json, yours will change based on your GitHub username and the name of your repository.

This action will run after you push a change to your content in the /data directory, so start by making some changes and pushing them to GitHub to trigger the action.

MONOREPO: Two Azure Static Web App Deployments

There are two separate web sites in this starter. There will be two separate deployments to Azure Static Web Apps.

CMS/API Deployment

Create an Azure Static Web Apps deployment of the /sites/cms folders. Choose /sites/cms/app for the App folder and /sites/cms/api for the API folder. An example GitHub workflow file looks like this:

app_location: "/sites/cms/app" # App source code path
api_location: "/sites/cms/api" # Api source code path
output_location: "" # Built app content directory

Website Deployment

Create an Azure Static Web Apps deployment of the /sites/blog folders. Choose /sites/blog for the App folder and no API folder. An example GitHub workflow file looks like this:

app_location: "/sites/blog" # App source code path
api_location: "" # Api source code path - optional
output_location: "out" # Built app content directory - Next.js default

Working with Content

Download CueBlox and use blox commands to work with the content. blox new and blox build will be the most commonly used commands. Commit and push your content to have it automatically deployed to the REST/GraphQL endpoint.

Schemata are in the /schemata folder. You can see which fields are available for each content model by investigating the definitions.

Blog Template

Blog template is from next.js examples, Copyright Vercel, Inc. Licensed under the MIT License.

Learn how

Learn how to Publish an Angular, React, Svelte, or Vue JavaScript app and API with Azure Static Web Apps

Prerequisites

Problems or Suggestions

Open an issue here

Resources

Azure Static Web Apps

Tools and References

Azure Static Web Apps VS Code Extension