Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: publish to github pages #111

Merged
merged 14 commits into from
Jul 10, 2024
55 changes: 55 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Hugo site to Pages
on:
push:
branches: ["main"]
paths-ignore:
- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md

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: Set Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install yarn
run: npm install -g yarn
- name: Install Node.js dependencies
run: yarn install
- name: Check
run: yarn run dprint check
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Hugo
run: |
yarn run hugo \
--minify \
--themesDir ../.. \
--baseURL "${{ steps.pages.outputs.base_url }}"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
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
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ on:
branches: [ "*" ]
paths-ignore:
- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g yarn
- run: yarn install
- run: yarn run hugo
Expand Down
12 changes: 6 additions & 6 deletions assets/scss/_fonts.scss
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@font-face {
font-family: Graphik;
font-weight: 300;
src: url("/fonts/Graphik/GraphikLight.otf") format("opentype");
src: url("../fonts/Graphik/GraphikLight.otf") format("opentype");
}

@font-face {
font-family: Graphik;
font-weight: 400;
src: url("/fonts/Graphik/GraphikRegular.otf") format("opentype");
src: url("../fonts/Graphik/GraphikRegular.otf") format("opentype");
}

@font-face {
font-family: Graphik;
font-weight: 500;
src: url("/fonts/Graphik/GraphikMedium.otf") format("opentype");
src: url("../fonts/Graphik/GraphikMedium.otf") format("opentype");
}

@font-face {
font-family: Graphik;
font-weight: 600;
src: url("/fonts/Graphik/GraphikSemibold.otf") format("opentype");
src: url("../fonts/Graphik/GraphikSemibold.otf") format("opentype");
}

@font-face {
font-family: Graphik;
font-weight: 700;
src: url("/fonts/Graphik/GraphikBold.otf") format("opentype");
src: url("../fonts/Graphik/GraphikBold.otf") format("opentype");
}

@font-face {
font-family: IBMPlexMono;
font-weight: 400;
src: url("/fonts/IBMPlexMono/IBMPlexMono-Regular.ttf") format("truetype");
src: url("../fonts/IBMPlexMono/IBMPlexMono-Regular.ttf") format("truetype");
}
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ version = "0.0"

# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
url_latest_version = "https://docs.score.dev/"
url_latest_version = ""

# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
github_repo = "https://github.com/score-spec/docs"
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>Not found</h1>
<p>
Oops! This page doesn't exist. Try going back to the
<a href="{{.Site.BaseURL}}">home page</a>.
<a href="{{ relURL "" }}">home page</a>.
</p>
</div>
{{- end }}
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html>
<head>
<!-- Add a custom home page here, or redirect right into the main docs (if you're first page is not /home, update the url below accordingly)-->
<meta http-equiv="REFRESH" content="0;url=/docs">
<meta http-equiv="REFRESH" content="0;url={{ relURL "docs" }}">
</head>
<body>
<p>This page has moved <a href="https://docs.score.dev/docs/">here</a>.
<p>This page has moved <a href="{{ relURL "docs" }}">here</a>.
</p>
</body>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link
rel="{{ .Rel }}"
type="{{ .MediaType.Type }}"
href="https://docs.score.dev/docs/"
href="{{ relURL "docs" }}"
/>
{{ end -}} {{ $outputFormat := partial "outputformat.html" . -}} {{ if and
hugo.IsProduction (ne $outputFormat "print") -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{{ $pre := .Pre -}}
{{ $post := .Post -}}
{{ $url := urls.Parse .URL -}}
{{ $baseurl := urls.Parse $.Site.Params.Baseurl -}}
{{ $baseurl := urls.Parse $.Site.BaseUrl -}}
<a {{/**/ -}}
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"
Expand Down
Loading