-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from aziontech/feat/templates/cosmic
feat(templates): Add Comic CMS based templates
- Loading branch information
Showing
151 changed files
with
16,920 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PUBLIC_COSMIC_BUCKET_SLUG= | ||
PUBLIC_COSMIC_READ_KEY= |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ['plugin:astro/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
sourceType: 'module', | ||
ecmaVersion: 'latest' | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.astro'], | ||
parser: 'astro-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
extraFileExtensions: ['.astro', '.tsx', '.ts', '.jsx', '.js'] | ||
}, | ||
rules: { | ||
// override/add rules settings here, such as: | ||
// "astro/no-set-html-directive": "error" | ||
} | ||
} | ||
] | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
templates/astro/cosmic-simple-astro-blog/.github/workflows/main.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Main Edge Deploy | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
deploy: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install NPM dependencies | ||
run: npm i | ||
|
||
- name: Install Azion CLI | ||
run: | | ||
curl -o azionlinux https://downloads.azion.com/linux/x86_64/azion | ||
sudo mv azionlinux /usr/bin/azion | ||
sudo chmod u+x /usr/bin/azion | ||
- name: Azion Action Deploy | ||
run: | | ||
azion -t ${{ secrets.AZION_PERSONAL_TOKEN }} | ||
azion deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# build output | ||
dist/ | ||
.output/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store | ||
|
||
# azion | ||
.edge | ||
.vulcan | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Expose Astro dependencies for `pnpm` users | ||
shamefully-hoist=true |
4 changes: 4 additions & 0 deletions
4
templates/astro/cosmic-simple-astro-blog/.vscode/extensions.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["astro-build.astro-vscode"], | ||
"unwantedRecommendations": [] | ||
} |
11 changes: 11 additions & 0 deletions
11
templates/astro/cosmic-simple-astro-blog/.vscode/launch.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "./node_modules/.bin/astro dev", | ||
"name": "Development server", | ||
"request": "launch", | ||
"type": "node-terminal" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Simple Astro Blog built with Astro and Cosmic | ||
|
||
To build this app, we’re going to use the following technologies: | ||
|
||
- [Astro](https://astro.build/) - A React framework for production that makes it easy to spin up a full-stack application. | ||
- [Cosmic](https://www.cosmicjs.com/) - A Headless CMS enables the independence of the data (content) layer and gives us the ability to quickly manage template content. | ||
- [Tailwind CSS](https://tailwindcss.com/) - A performant utility-first CSS framework that can be composed directly in your markup. | ||
|
||
### Links | ||
|
||
- [Install the template](https://www.cosmicjs.com/marketplace/templates/simple-astro-blog) | ||
- [View the live demo](https://simple-astro-blog.vercel.app/) | ||
|
||
## Screenshots | ||
|
||
![Home Page](https://imgix.cosmicjs.com/e0b61790-32db-11ed-8a37-f1952c73e588-astro-cms-screenshot-4.png?w=1200&auto=format) | ||
|
||
![Blog Page](https://cdn.cosmicjs.com/cbd90ee0-32db-11ed-8a37-f1952c73e588-astro-cms-screenshot-3.png) | ||
|
||
## Getting started | ||
|
||
### Environment Variables | ||
|
||
You'll need to create an .env file in the root of the project. Log in to Cosmic and from Bucket Settings > API Access take the following values: | ||
|
||
``` | ||
//.env | ||
PUBLIC_COSMIC_BUCKET_SLUG=your_cosmic_slug | ||
PUBLIC_COSMIC_READ_KEY=your_cosmic_read_key | ||
``` | ||
|
||
Install the dependencies with | ||
|
||
``` | ||
pnpm install | ||
# or | ||
yarn install | ||
# or | ||
npm install | ||
``` | ||
|
||
Then run the development server: | ||
|
||
``` | ||
pnpm run dev | ||
# or | ||
yarn dev | ||
# or | ||
npm run dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000/) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `src/pages/index.astro`. The page auto-updates as you edit the file. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'astro/config' | ||
import react from '@astrojs/react' | ||
import tailwind from '@astrojs/tailwind' | ||
import robotsTxt from 'astro-robots-txt' | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [tailwind(), react(), robotsTxt()], | ||
site: 'https://simple-astro-blog.vercel.app' | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
build: { | ||
preset: { | ||
name: 'astro' | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="astro/client" /> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Cosmic - Simple Astro Blog", | ||
"message": "An Astro blog template powered by Cosmic", | ||
"preset": "astro", | ||
"mode": "deliver", | ||
"path": "/cosmic-simple-astro-blog" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@example/basics", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro", | ||
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"" | ||
}, | ||
"dependencies": { | ||
"@astrojs/react": "^3.0.0", | ||
"@astrojs/tailwind": "^5.0.0", | ||
"@astrojs/ts-plugin": "^1.0.4", | ||
"@cosmicjs/sdk": "^1.0.5", | ||
"astro": "^3.0.8", | ||
"date-fns": "^2.29.2", | ||
"react-markdown": "^8.0.3", | ||
"sharp": "^0.32.1", | ||
"tailwindcss": "^3.3.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.7.15", | ||
"@typescript-eslint/parser": "^5.59.2", | ||
"astro-robots-txt": "^0.3.8", | ||
"eslint": "^8.39.0", | ||
"eslint-plugin-astro": "^0.26.1", | ||
"eslint-plugin-jsx-a11y": "^6.7.1", | ||
"prettier": "^2.8.8", | ||
"prettier-config-standard": "^5.0.0", | ||
"prettier-plugin-astro": "^0.8.0", | ||
"prettier-plugin-tailwindcss": "^0.2.8", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
Oops, something went wrong.