Displaying recipes in RecipeMD format through the magic of Next.js.
You can set up your own instance on GitHub Pages. Just follow these steps:
-
Fork this repository
-
Set up a domain or subdomain for your recipes, and configure the DNS according to GitHub's instructions
-
Set up the configuration for your instance, by setting action variables for the repository.
-
CNAME: The domain/subdomain you configured in step to, e.g.recipes.example.com -
REPOSITORIES: The repository containing your recipes. This is a JSON array in the following format:[{"author":"<GitHub username>","repository":"<repository name>","branch":"<branch>"}]You an also add additional objects to the array to show recipes from multiple REPOSITORIES
-
-
Enable GitHub Pages in your repository's settings, and run the deploy workflow in the repositories actions.
You can create a workflow in your recipe repo that updates the content of recipe-web whenever something changes in your recipes. For that, we create an access token that allows your recipe repo to send a notification to you recipe-web instance, and then add a workflow to your recipes repo.
Note that this setup only works for reacting to changes from recipe repos you have write access to.
-
- Repository Access: Choose "Only select repositories" and select your recipe-web repo
- Permissions:
- "Metadata" (read)
- "Workflows" (read/write)
- "Contents" (read/write)
-
Add the new access token to your recipes repo. Name it
FRONTEND_TRIGGER_TOKEN. -
Create the workflow that sends the repository dispatch event in your recipes repo. The workflow is placed in
.github/workflows/and should contain the following:name: Trigger Frontend Deploy on: push: branches: - master jobs: dispatch: runs-on: ubuntu-latest steps: - name: Send repository_dispatch event to Frontend-Repo uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.FRONTEND_TRIGGER_TOKEN }} repository: username/recipe-web # Your recipe-web repo event-type: trigger-deploy
That's it! You can test the connection by manually triggering a run of the workflow in your recipes repo, and then check if a corresponding run is triggered in your recipe-web repo.
Flag Icons by Twitter.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.