From 47bba9cd7fb2fd09cae618e06fa4d7772c4d0531 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 2 Jun 2025 16:13:48 -0400 Subject: [PATCH 1/3] Add example workflows for pip and uv --- .gitignore | 2 +- .../ExampleGitHubAction.yml | 29 +++++++++++++++++++ .../ExampleGitHubActionUV.yml | 29 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubAction.yml create mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml diff --git a/.gitignore b/.gitignore index 68bc17f..ab96b1f 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/* diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml b/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml new file mode 100644 index 0000000..a4100d0 --- /dev/null +++ b/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml @@ -0,0 +1,29 @@ +name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR +# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. +# This workflow assumes you are using pip to install requirements and that the requirements are in a requirements.txt file + +on: # Define the triggers that will cause the workflow to run + push: + workflow_dispatch: + repository_dispatch: + +jobs: + # Build job + build: + runs-on: ubuntu-latest # This is the VM type that will run it. + steps: # The actions that define the workflow + - uses: actions/checkout@v4 # Check out the repo + - name: Install Python + uses: actions/setup-python@v5 # Install Python + with: + python-version: "3.13" # Define the version of Python that is needed + - name: Install dependencies + run: | # Tasks to run. First update pip, then install all the requirements. + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Build the site + run: render-engine build # Render your site. + - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. + with: + name: website + path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml b/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml new file mode 100644 index 0000000..743bf0e --- /dev/null +++ b/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml @@ -0,0 +1,29 @@ +name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR +# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. +# This workflow is for the case where you are using uv. + +on: # Define the triggers that will cause the workflow to run + push: + workflow_dispatch: + repository_dispatch: + +jobs: + # Build job + build: + runs-on: ubuntu-latest # This is the VM type that will run it. + steps: # The actions that define the workflow + - uses: actions/checkout@v4 # Check out the repo + - name: Install Python + uses: actions/setup-python@v5 # Install Python + with: + python-version: "3.13" # Define the version of Python that is needed + - name: Install dependencies + run: | # Tasks to run. First update pip, then install uv. + python -m pip install --upgrade pip + pip install uv + - name: Build the site + run: uv run render-engine build # Render your site. Calling uv run will handle all the necessary requirements. + - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. + with: + name: website + path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. From 8dbcf1406df288342f7c9feb1fdc1535a56a8f46 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 2 Jun 2025 16:19:18 -0400 Subject: [PATCH 2/3] Revert "Add example workflows for pip and uv" This reverts commit 47bba9cd7fb2fd09cae618e06fa4d7772c4d0531. --- .gitignore | 2 +- .../ExampleGitHubAction.yml | 29 ------------------- .../ExampleGitHubActionUV.yml | 29 ------------------- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubAction.yml delete mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml diff --git a/.gitignore b/.gitignore index ab96b1f..68bc17f 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -.idea/* +#.idea/ diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml b/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml deleted file mode 100644 index a4100d0..0000000 --- a/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR -# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. -# This workflow assumes you are using pip to install requirements and that the requirements are in a requirements.txt file - -on: # Define the triggers that will cause the workflow to run - push: - workflow_dispatch: - repository_dispatch: - -jobs: - # Build job - build: - runs-on: ubuntu-latest # This is the VM type that will run it. - steps: # The actions that define the workflow - - uses: actions/checkout@v4 # Check out the repo - - name: Install Python - uses: actions/setup-python@v5 # Install Python - with: - python-version: "3.13" # Define the version of Python that is needed - - name: Install dependencies - run: | # Tasks to run. First update pip, then install all the requirements. - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Build the site - run: render-engine build # Render your site. - - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. - with: - name: website - path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml b/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml deleted file mode 100644 index 743bf0e..0000000 --- a/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR -# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. -# This workflow is for the case where you are using uv. - -on: # Define the triggers that will cause the workflow to run - push: - workflow_dispatch: - repository_dispatch: - -jobs: - # Build job - build: - runs-on: ubuntu-latest # This is the VM type that will run it. - steps: # The actions that define the workflow - - uses: actions/checkout@v4 # Check out the repo - - name: Install Python - uses: actions/setup-python@v5 # Install Python - with: - python-version: "3.13" # Define the version of Python that is needed - - name: Install dependencies - run: | # Tasks to run. First update pip, then install uv. - python -m pip install --upgrade pip - pip install uv - - name: Build the site - run: uv run render-engine build # Render your site. Calling uv run will handle all the necessary requirements. - - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. - with: - name: website - path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. From 8dd5a2300d3334467200852c993d02d627c3b62e Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 2 Jun 2025 16:43:54 -0400 Subject: [PATCH 3/3] Add README.md and pyproject.toml --- {{cookiecutter.project_slug}}/README.md | 42 ++++++++++++++++++++ {{cookiecutter.project_slug}}/pyproject.toml | 8 ++++ 2 files changed, 50 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/README.md create mode 100644 {{cookiecutter.project_slug}}/pyproject.toml diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md new file mode 100644 index 0000000..7c97d1e --- /dev/null +++ b/{{cookiecutter.project_slug}}/README.md @@ -0,0 +1,42 @@ +# Congratulations on setting up {{cookiecutter.SITE_TITLE}}! + +This is your site to figure out what you want to do with it. This file exists to give you a +little bit of direction in your next steps. + +## Check the configuration + +We've set up a default `pyproject.toml` for you with the default configuration for +- site +- module +- collection (if you chose to include a blog and/or a collection) + +but this might not be the right configuration for you so you might want to double-check. Especially +if you went into `app.py` and changed any names around. + +## GitHuB Workflows +We gave you a pair of example GitHub workflows: +- ExampleGitHubAction.yml - this example workflow is what you should use if you are managing the \ +requirements with `requirements.txt` and using `pip`. Just copy the file over to `.github/workflows` \ +and it will run automagically any time you push a change up. +- ExampleGitHubActionUV.yml - this example workflow is what you should use if you are managing the \ +requirements with `uv`. Just copy the file over to `.github/workflows` and it will run automagically \ +any time you push a change up. + +## Seeing what you have +Run `render-engine serve` and a local copy of your site will be available to see at +`http://localhost:8000`. Don't worry about remembering that or copying it from here - the console +will give you the link. If you add `--reload` to the command, it will rerender the site any time +there is a change to the `content` directory or one of the files in it. If you use the `--clean` +option it will remove any previous output directory before it renders the site. + +## Adding content +Go a head and use the CLI to add a new page to one of your collections +```shell +render-engine new-entry [options] +``` +This will create the content file and open the editor for you. Once you're done, check out what it +looks like with `render-engine serve`. + +## Need more help? +Check out the [documentation](https://render-engine.readthedocs.io/en/latest/) for more details on +what `render-engine` is capable of doing and how to use it. diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml new file mode 100644 index 0000000..ea9a486 --- /dev/null +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -0,0 +1,8 @@ +[render-engine.cli] +site = "app" +module = "app" +{% if not cookiecutter.skip_blog %} +collection = "blog" +{% elif not cookiecutter.skip_collection %} +collection = "pages" +{% endif %}