commit 7746d8606e6ee24e6e1b74419dd6b1f93d702934 Author: David Date: Fri Mar 29 22:10:50 2024 -0600 Initial commit diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5f67ab9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "image": "mcr.microsoft.com/devcontainers/go:1", + "features": { + "ghcr.io/devcontainers/features/hugo:1": { + "extended": true, + "version": "0.122.0" + }, + "ghcr.io/devcontainers/features/node:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "mhutchie.git-graph", + "esbenp.prettier-vscode", + "tamasfe.even-better-toml", + "budparr.language-hugo-vscode" + ] + } + }, + "forwardPorts": [1313] +} diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml new file mode 100644 index 0000000..ecff24f --- /dev/null +++ b/.github/workflows/pages.yaml @@ -0,0 +1,76 @@ +# Sample workflow for building and deploying a Hugo site to GitHub Pages +name: Deploy Hugo site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.121.2 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod + submodules: recursive + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Setup Hugo + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed5e96e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Hugo output +public/ +resources/ +.hugo_build.lock + +# Editor +.vscode/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..8bc7732 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,15 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - name: Install Hugo + before: brew install hugo + init: echo "Your version of Hugo is `hugo version`" && hugo mod tidy + command: hugo server -D -F --baseURL $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0 --disableFastRender + +ports: + - port: 1313 + onOpen: open-preview diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..9dd6345 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "mhutchie.git-graph", + "esbenp.prettier-vscode", + "tamasfe.even-better-toml", + "budparr.language-hugo-vscode" + ] +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..946f304 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Xin + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1ee95d --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +# Hextra Starter Template + +[![Deploy Hugo site to Pages](https://github.com/imfing/hextra-starter-template/actions/workflows/pages.yaml/badge.svg)](https://github.com/imfing/hextra-starter-template/actions/workflows/pages.yaml) +[![Netlify Status](https://api.netlify.com/api/v1/badges/6e83fd88-5ffe-4808-9689-c0f3b100bfe3/deploy-status)](https://app.netlify.com/sites/hextra-starter-template/deploys) +![Vercel Deployment Status](https://img.shields.io/github/deployments/imfing/hextra-starter-template/production?logo=vercel&logoColor=white&label=vercel&labelColor=black&link=https%3A%2F%2Fhextra-starter-template.vercel.app%2F) + + +🐣 Minimal template for getting started with [Hextra](https://github.com/imfing/hextra) + +![hextra-template](https://github.com/imfing/hextra-starter-template/assets/5097752/c403b9a9-a76c-47a6-8466-513d772ef0b7) + +[🌐 Demo ↗](https://imfing.github.io/hextra-starter-template/) + +## Quick Start + +Use this template to create your own repository: + + + +You can also quickly start developing using the following online development environment: + +- [GitHub Codespaces](https://github.com/codespaces) + + [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/imfing/hextra-starter-template) + + Create a new codespace and follow the [Local Development](#local-development) to launch the preview + +- [Gitpod](https://gitpod.io) + + [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/imfing/hextra-starter-template) + + +## Deployment + +### GitHub Pages + +A GitHub Actions workflow is provided in [`.github/workflows/pages.yaml`](./.github/workflows/pages.yaml) to [publish to GitHub Pages](https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/) for free. + +For details, see [Publishing with a custom GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow). + +Note: in the settings, make sure to set the Pages deployment source to **GitHub Actions**: + + + +[Run the workflow manually](https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow) if it's not triggered automatically. + +### Netlify + +[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/imfing/hextra-starter-template) + +### Vercel + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fimfing%2Fhextra-starter-template&env=HUGO_VERSION) + +Override the configuration: + + + +## Local Development + +Pre-requisites: [Hugo](https://gohugo.io/getting-started/installing/), [Go](https://golang.org/doc/install) and [Git](https://git-scm.com) + +```shell +# Clone the repo +git clone https://github.com/imfing/hextra-starter-template.git + +# Change directory +cd hextra-starter-template + +# Start the server +hugo mod tidy +hugo server --logLevel debug --disableFastRender -p 1313 +``` + +### Update theme + +```shell +hugo mod get -u +hugo mod tidy +``` + +See [Update modules](https://gohugo.io/hugo-modules/use-modules/#update-modules) for more details. + diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..47bbcc9 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,18 @@ +--- +title: Birth Software +toc: false +--- + +This is the page for Birth Software + +## Explore + +{{< cards >}} + {{< card link="nativity" title="Nativity" icon="book-open" >}} + {{< card link="birth" title="Birth" icon="book-open" >}} + {{< card link="about" title="About" icon="user" >}} +{{< /cards >}} + + + + diff --git a/content/about.md b/content/about.md new file mode 100644 index 0000000..deaa32a --- /dev/null +++ b/content/about.md @@ -0,0 +1,8 @@ +--- +title: Birth Software +type: about +--- + +Birth Software is a project which aims to produce good software, the kind of software we are lacking these days. + +If you like the project, please consider sponsoring the lead developer of the project: https://github.com/sponsors/davidgm94 diff --git a/content/birth/_index.md b/content/birth/_index.md new file mode 100644 index 0000000..f564473 --- /dev/null +++ b/content/birth/_index.md @@ -0,0 +1,5 @@ +--- +title: Birth +--- + +Birth gives its name to the project and it is the operating system which aims to bring robustness, safety, simplicity and speed to the world of software. It is currently on hold waiting for the compiler (Nativity) to be ready. diff --git a/content/nativity/_index.md b/content/nativity/_index.md new file mode 100644 index 0000000..7162ca6 --- /dev/null +++ b/content/nativity/_index.md @@ -0,0 +1,16 @@ +--- +title: Nativity +next: first-page +--- + +Nativity is the language and compiler for Birth Software. + +## Hello, World! + +```nat {filename="main.nat"} +const std = #import("std"); + +const main = fn () *!void { + std.print("Hello world\n"); +} +``` diff --git a/content/nativity/first-page.md b/content/nativity/first-page.md new file mode 100644 index 0000000..4af40a1 --- /dev/null +++ b/content/nativity/first-page.md @@ -0,0 +1,9 @@ +--- +title: Demo Page +type: docs +prev: / +next: docs/folder/ +--- + +A simple demo page. + diff --git a/content/nativity/folder/_index.md b/content/nativity/folder/_index.md new file mode 100644 index 0000000..5050ade --- /dev/null +++ b/content/nativity/folder/_index.md @@ -0,0 +1,10 @@ +--- +title: Folder +type: docs +prev: docs/first-page +next: docs/folder/leaf +sidebar: + open: true +--- + +Pages can be organized into folders. diff --git a/content/nativity/folder/leaf.md b/content/nativity/folder/leaf.md new file mode 100644 index 0000000..7c9ee2a --- /dev/null +++ b/content/nativity/folder/leaf.md @@ -0,0 +1,7 @@ +--- +title: Leaf Page +type: docs +prev: docs/folder/ +--- + +This page is under a folder. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..5a6a5c1 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/imfing/hextra-starter-template + +go 1.21 + +require github.com/imfing/hextra v0.7.3 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ad0bc42 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/imfing/hextra v0.7.3 h1:dVGA1NTcWe+FaUMdrawEypPfrrmulq5NoK0we3nC330= +github.com/imfing/hextra v0.7.3/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= diff --git a/hugo.yaml b/hugo.yaml new file mode 100644 index 0000000..72e6b4a --- /dev/null +++ b/hugo.yaml @@ -0,0 +1,61 @@ +# Hugo configuration file +title: Birth Software + +# import hextra as module +module: + imports: + - path: github.com/imfing/hextra + +markup: + # allow raw html + goldmark: + renderer: + unsafe: true + + # enable hextra syntax highlight + highlight: + noClasses: false + +menu: + main: + - name: Nativity + pageRef: /nativity + weight: 1 + - name: Birth + pageRef: /birth + weight: 2 + - name: About + pageRef: /about + weight: 3 + # - name: Contact ↗ + # url: "https://github.com/imfing" + # weight: 3 + - name: Search + weight: 4 + params: + type: search + - name: GitHub + weight: 5 + url: "https://github.com/birth-software" + params: + icon: github + # - name: Twitter + # weight: 5 + # url: "https://twitter.com/" + # params: + # icon: x-twitter + +params: + page: + width: full + navbar: + displayTitle: true + displayLogo: false + + footer: + displayCopyright: false + displayPoweredBy: false + + # editURL: + # enable: true + # base: "https://github.com/imfing/hextra-starter-template/edit/main/content" diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..60166d7 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,6 @@ +[build] +publish = "public" +command = "hugo --gc --minify -b ${DEPLOY_PRIME_URL}" + +[build.environment] +HUGO_VERSION = "0.121.1"