Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
magick93 authored Aug 3, 2023
0 parents commit f3e350b
Show file tree
Hide file tree
Showing 33 changed files with 7,893 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/astro.yml
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
21 changes: 21 additions & 0 deletions .gitignore
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
4 changes: 4 additions & 0 deletions .vscode/extensions.json
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 .vscode/launch.json
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"
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
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.
91 changes: 91 additions & 0 deletions README.md
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)
12 changes: 12 additions & 0 deletions astro.config.mjs
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()]
});
Loading

0 comments on commit f3e350b

Please sign in to comment.