From 1471c6be2cc9f40090a688adec71424d6b639103 Mon Sep 17 00:00:00 2001 From: Kyle Huggins Date: Sun, 28 Jan 2024 21:13:05 -0600 Subject: [PATCH] Update documentation to restore GitHub Pages functionality (#387) --- .github/workflows/gh-pages.yml | 43 +++++++++++++++++++++++++ CONTRIBUTING.md | 3 +- _config.yml | 24 ++++++++++++++ docs/_config.yml | 2 -- docs/_layouts/default.html | 57 ---------------------------------- docs/assets/css/style.scss | 9 ------ docs/template.md | 2 +- 7 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/gh-pages.yml create mode 100644 _config.yml delete mode 100644 docs/_config.yml delete mode 100644 docs/_layouts/default.html delete mode 100644 docs/assets/css/style.scss diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..eab55d6 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,43 @@ +name: Deploy to GitHub Pages + +on: + release: + types: + - "published" + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Fix anchor tag in README + run: ex -s -c '%s/docs\/getting-started\.md/docs\/getting-started/|x' README.md + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + 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/CONTRIBUTING.md b/CONTRIBUTING.md index 703e824..58676e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,7 @@ Several GitHub action workflows are executed when pull requests are merged or re * `.github/workflows/build.yml` checks that the project can be built and the tests still pass. * `.github/workflows/codeql.yml` runs static analysis to vet code quality. +* `.github/workflows/gh-pages.yml` deploy the documentation files to GitHub Pages. * `.github/workflows/release.yml` submits a new version to Homebrew when a Git version tag is created. * `.github/workflows/triage.yml` automatically tags old issues and PRs as staled. @@ -58,4 +59,4 @@ Binaries can be created automatically using `make dist-linux` and `make dist-mac Unfortunately, `make dist-macos` must be run manually on both an Apple Silicon and Intel chips. The Linux builds are created using Docker and [these custom images](https://github.com/zk-org/zk-xcompile). -This process is convoluted because `zk` requires CGO with `mattn/go-sqlite3`, which prevents using Go's native cross-compilation. Transitioning to a CGO-free SQLite driver such as [cznic/sqlite](https://gitlab.com/cznic/sqlite) could simplify the distribution process significantly. \ No newline at end of file +This process is convoluted because `zk` requires CGO with `mattn/go-sqlite3`, which prevents using Go's native cross-compilation. Transitioning to a CGO-free SQLite driver such as [cznic/sqlite](https://gitlab.com/cznic/sqlite) could simplify the distribution process significantly. diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..82be88b --- /dev/null +++ b/_config.yml @@ -0,0 +1,24 @@ +title: "zk" +permalink: /:title +defaults: + - scope: + path: "README.md" + values: + title: "zk" + - scope: + path: "" # all + values: + render_with_liquid: false +exclude: + - ".github/" + - ".gitignore" + - "CHANGELOG.md" + - "CONTRIBUTING.md" + - "LICENSE" + - "Makefile" + - "go.mod" + - "go.sum" + - "internal/" + - "main.go" + - "tests/" + diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index 48637e8..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1,2 +0,0 @@ -permalink: /:title -theme: jekyll-theme-modernist \ No newline at end of file diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html deleted file mode 100644 index f024e77..0000000 --- a/docs/_layouts/default.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - -{% seo %} - - - - - - - - -
-
-

{{ site.title | default: site.github.repository_name }}

- {% if site.description or site.github.project_tagline %} -

{{ site.description | default: site.github.project_tagline }}

- {% endif %} -

View the Project on GitHub {{ github_name }}

- -
-
- - {{ content }} - -
-
- - - - {% if site.google_analytics %} - - {% endif %} - - diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss deleted file mode 100644 index 9a115ef..0000000 --- a/docs/assets/css/style.scss +++ /dev/null @@ -1,9 +0,0 @@ ---- ---- - -@import "{{ site.theme }}"; - -code, pre { - font-size: inherit; -} - diff --git a/docs/template.md b/docs/template.md index 3a21028..08c4a7f 100644 --- a/docs/template.md +++ b/docs/template.md @@ -36,7 +36,7 @@ The `{{concat s1 s2}}` helper concatenates two strings together. For example `{{ * The `{{substring s index length}}` helper extracts a portion of the given string. For example: * `{{substring 'A full quote' 2 4}}` outputs `full` - * `{{substring 'A full quote' -5 5}` outputs `quote` + * `{{substring 'A full quote' -5 5}}` outputs `quote` ### Date helpers