Skip to content

Commit

Permalink
Merge pull request #4 from GDWR/main
Browse files Browse the repository at this point in the history
Update to use Astro + Tailwind & DaisyUI for site
  • Loading branch information
JaDogg authored Dec 21, 2023
2 parents 5f2cb29 + 262f8b2 commit 7349415
Show file tree
Hide file tree
Showing 149 changed files with 6,069 additions and 12,290 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to GitHub Pages

on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
25 changes: 20 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
.idea
.venv
__pycache__
# 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
*.pdf
*.zip
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"
}
]
}
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# Yaksha Lang Website & Docs Site

* Documentation directories are `yaksha_docs`, `yaksha_lib_docs`, `yaksha_proposals` and `yaksha_tutorials`

Require `css-minify` and `html-minifier` in path.

* STEP 01: Install node.js
* STEP 02:
```
npm install -g css-minify
npm install -g html-minifier
```

Uses Python to build the documentation.
* STEP 01: Create virtual environment
```
python -m venv .venv
```
* STEP 02: Activate virtual environment
* STEP 03: Install dependencies
```
pip install -r requirements.txt
```
* STEP 04: Run the build.py
```
python build.py
```
Build with [Astro](https://astro.build/) + [Tailwindcss](https://tailwindcss.com/) & [DaisyUi](https://daisyui.com/).

## Quick Start

0. [Install Yarn](https://classic.yarnpkg.com/lang/en/docs/install/) (will require NodeJs)
1. `yarn # Installs dependecies`
2. `yarn dev # Runs development server`


## Astro Brief

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `yarn install` | Installs dependencies |
| `yarn dev` | Starts local dev server at `localhost:4321` |
| `yarn build` | Build your production site to `./dist/` |
| `yarn preview` | Preview your build locally, before deploying |
| `yarn astro ...` | Run CLI commands like `astro add`, `astro check` |
| `yarn astro -- --help` | Get help using the Astro CLI |
28 changes: 28 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'astro/config';
import tailwind from "@astrojs/tailwind";

import mdx from "@astrojs/mdx";
import fetch from 'node-fetch';

// Downloads yaksha grammar from main repo, may change in the future?
const yakshaGrammarUrl = "https://raw.githubusercontent.com/YakshaLang/Yaksha/main/editor/vscode/syntaxes/yaksha.json";
var resp = await fetch(yakshaGrammarUrl, {method: "GET"});
let yakshaGrammar = await resp.json();


// https://astro.build/config
export default defineConfig({
site: 'https://yakshalang.github.io',
base: '/',
integrations: [tailwind(), mdx()],
markdown: {
shikiConfig: {
wrap: true,
langs: [{
name: 'yaksha',
scopeName: 'source.yaksha',
...yakshaGrammar
}, "c", "bash", "scheme", "python"]
}
}
});
24 changes: 0 additions & 24 deletions build.py

This file was deleted.

4 changes: 0 additions & 4 deletions build.sh

This file was deleted.

26 changes: 0 additions & 26 deletions build_artifacts.sh

This file was deleted.

3 changes: 0 additions & 3 deletions css/large-font.css

This file was deleted.

3 changes: 0 additions & 3 deletions css/medium-font.css

This file was deleted.

Loading

0 comments on commit 7349415

Please sign in to comment.