Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -73,6 +73,13 @@ is_seedcase_project:
help: "Is this package part of the Seedcase Project?"
default: "{{ github_user == 'seedcase-project' }}"

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 @@ -62,6 +62,7 @@ test is_seedcase_project:
--trust \
--data package_github_repo="first-last/repo" \
--data is_seedcase_project={{ is_seedcase_project }} \
--data hosting_provider={{ hosting_provider }} \
--data author_given_name="First" \
--data author_family_name="Last" \
--data author_email="first.last@example.com" \
Expand Down Expand Up @@ -96,6 +97,7 @@ test is_seedcase_project:
--overwrite \
--data package_github_repo="first-last/repo" \
--data is_seedcase_project={{ is_seedcase_project }} \
--data hosting_provider={{ hosting_provider }} \
--data author_given_name="First" \
--data author_family_name="Last" \
--data author_email="first.last@example.com" \
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/{{ package_github_repo }}"
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