generated from bethropolis/gena
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f3e350b
Showing
33 changed files
with
7,893 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,79 @@ | ||
|
||
name: Deploy Astro site to Pages | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
env: | ||
BUILD_PATH: "." | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Detect package manager | ||
id: detect-package-manager | ||
run: | | ||
if [ -f "${{ github.workspace }}/yarn.lock" ]; then | ||
echo "manager=yarn" >> $GITHUB_OUTPUT | ||
echo "command=install" >> $GITHUB_OUTPUT | ||
echo "runner=yarn" >> $GITHUB_OUTPUT | ||
exit 0 | ||
elif [ -f "${{ github.workspace }}/package.json" ]; then | ||
echo "manager=npm" >> $GITHUB_OUTPUT | ||
echo "command=ci" >> $GITHUB_OUTPUT | ||
echo "runner=npx --no-install" >> $GITHUB_OUTPUT | ||
exit 0 | ||
else | ||
echo "Unable to determine package manager" | ||
exit 1 | ||
fi | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: ${{ steps.detect-package-manager.outputs.manager }} | ||
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v3 | ||
- name: Install dependencies | ||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | ||
working-directory: ${{ env.BUILD_PATH }} | ||
- name: Build with Astro | ||
run: | | ||
${{ steps.detect-package-manager.outputs.runner }} astro build \ | ||
--site "${{ steps.pages.outputs.origin }}" \ | ||
--base "${{ steps.pages.outputs.base_path }}" | ||
working-directory: ${{ env.BUILD_PATH }} | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ${{ env.BUILD_PATH }}/dist | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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,21 @@ | ||
# build output | ||
dist/ | ||
|
||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store |
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": [] | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Bethuel | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,91 @@ | ||
![Alt text](public/cover.svg) | ||
|
||
# Gena | ||
[![Deploy Astro site to Pages](https://github.com/bethropolis/gena/actions/workflows/astro.yml/badge.svg)](https://github.com/bethropolis/gena/actions/workflows/astro.yml) | ||
|
||
An astro template for writing docs fast using markdown. | ||
|
||
# Installation | ||
|
||
### cloning repository | ||
you'll have to first clone the repository. | ||
|
||
``` | ||
git clone https://github.com/bethropolis/gena.git | ||
``` | ||
<br/> | ||
|
||
### installing | ||
you'll then install all the projects dependancies.<br/> | ||
you can use npm, yarn pnpm e.t.c | ||
|
||
``` | ||
npm install | ||
``` | ||
<br/> | ||
|
||
### developing | ||
you'll have to run the development server for easy development. | ||
|
||
``` | ||
npm run dev | ||
``` | ||
|
||
### configuring the sidebar | ||
|
||
the left sidebar is configuration is on the `src/content.ts` file. <br/> | ||
edit the file in order to change the content of the sidebar. | ||
|
||
```ts | ||
// src/content.ts | ||
export const sidebarStructure = [ | ||
{ | ||
label: "Getting Started", | ||
children: [ | ||
{ | ||
label: "introduction", | ||
path: "./docs/introduction", | ||
}, | ||
{ | ||
label: "installation", | ||
path: "./docs/installation", | ||
}, | ||
], | ||
} | ||
]; | ||
``` | ||
<br/> | ||
configuring the right sidebar happens in the markdown/mdx file in the `content` folder. | ||
|
||
example `content/docs/introduction.mdx`. | ||
|
||
|
||
```m | ||
--- | ||
title: "Introduction" | ||
outline: ["getting-started", "installation"] | ||
--- | ||
rest of the markdown... | ||
``` | ||
<br/> | ||
|
||
### adding content | ||
|
||
To add more content to the template, just add more `markdown\mdx` files to the `content/docs` directory.<br/> | ||
The routing is done automatically by | ||
Astro, [read about router here](https://docs.astro.build/core-concepts/routing/). | ||
<br/> | ||
|
||
|
||
### deployment and build | ||
static files are generated hence your docs can be deployed anywhere you want, [read more here](https://docs.astro.build/guides/deploy/). | ||
|
||
to build run: | ||
``` | ||
npm run build | ||
``` | ||
<br/> | ||
|
||
## License | ||
MIT license (do what you want) |
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,12 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import tailwind from "@astrojs/tailwind"; | ||
import sitemap from "@astrojs/sitemap"; | ||
|
||
import mdx from "@astrojs/mdx"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: "https://bethropolis.github.io", | ||
base: '/gena', | ||
integrations: [tailwind(), sitemap(), mdx()] | ||
}); |
Oops, something went wrong.