Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ github_user:
help: "What is the name of the GitHub user or organisation where the repository will be or is stored?"
default: "{{ 'seedcase-project' if is_seedcase_project else '' }}"

hosting_provider:
type: str
help: "What hosting provider will you use for the documentation website?"
choices:
- netlify
- gh-pages

homepage:
type: str
help: "What is the homepage of your project?"
Expand Down
10 changes: 6 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@_checks: check-spelling check-commits
# Test Seedcase and non-Seedcase projects
@_tests: (test "true") (test "false")
@_tests: (test "true" "netlify") (test "false" "netlify") (test "true" "gh-pages") (test "false" "gh-pages")
@_builds: build-contributors build-website build-readme

# Run all build-related recipes in the justfile
Expand Down Expand Up @@ -47,10 +47,10 @@ check-commits:
check-spelling:
uvx typos

# Test and check that a Python package can be created from the template
test is_seedcase_project:
# Test that a Python package can be created from the template, with parameters for: `is_seedcase_project` (true or false) and `hosting_provider` (either "gh-pages" or "netlify")
test is_seedcase_project="true" hosting_provider="netlify":
#!/usr/bin/env bash
test_name="test-python-package"
test_name="test-package-{{ hosting_provider }}"
test_dir="$(pwd)/_temp/{{ is_seedcase_project }}/$test_name"
template_dir="$(pwd)"
commit=$(git rev-parse HEAD)
Expand All @@ -61,6 +61,7 @@ test is_seedcase_project:
--defaults \
--trust \
--data is_seedcase_project={{ is_seedcase_project }} \
--data hosting_provider={{ hosting_provider }} \
--data github_user="first-last" \
--data author_given_name="First" \
--data author_family_name="Last" \
Expand Down Expand Up @@ -95,6 +96,7 @@ test is_seedcase_project:
--trust \
--overwrite \
--data is_seedcase_project={{ is_seedcase_project }} \
--data hosting_provider={{ hosting_provider }} \
--data github_user="first-last" \
--data author_given_name="First" \
--data author_family_name="Last" \
Expand Down
17 changes: 0 additions & 17 deletions template/.github/workflows/build-website.yml

This file was deleted.

26 changes: 26 additions & 0 deletions template/.github/workflows/build-website.yml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build website

on:
push:
branches:
- main

# Limit token permissions for security
permissions: read-all

jobs:
build-website:
uses: seedcase-project/.github/.github/workflows/reusable-build-docs-with-python.yml@main
{%- if hosting_provider == 'gh-pages' %}
with:
hosting-provider: gh-pages
permissions:
contents: write
pages: write
{%- endif %}
secrets:
{% if hosting_provider == 'gh-pages' -%}
github-token: {{ '${{ secrets.GITHUB_TOKEN }}' }}
{%- elif hosting_provider == 'netlify' -%}
netlify-token: {{ '${{ secrets.NETLIFY_AUTH_TOKEN }}' }}
{%- endif %}
5 changes: 0 additions & 5 deletions template/_publish.yml

This file was deleted.

5 changes: 5 additions & 0 deletions template/_quarto.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ project:
website:
# TODO: Fill in the title of the website.
title: ""
{% if hosting_provider == "gh-pages" -%}
site-url: "https://{{ github_user }}.github.io/{{ github_repo }}/"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the latest var names added in #152

{%- elif hosting_provider == "netlify" -%}
# TODO: Set the Netlify custom domain URL
site-url: "{{ homepage }}"
{%- endif %}
repo-url: "https://github.com/{{ github_repo_spec }}"
page-navigation: true
navbar:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- source: project
netlify:
# TODO: Include correct ID and URL
- id: ""
url: "https://{{ github_user }}-{{ github_repo }}.netlify.app"
Loading