This guide will walk you through the steps to use this template. Even though this guide is made for beginners in using github, and setting up advanced swift playground apps, we'll still include links and references to further study advanced techniques.
- A GitHub account made on GitHub.com.
- Basic understanding in json files
- Log into your GitHub account and go to the main template page.
- Click the green
Use this templatebutton and chooseCreate a new repositoryfrom the dropdown menu.
- Give your new repository a name (and optionally, a description)
If you're a GitHub Free user you will have to use
NAME_OF_YOUR_ACCOUNT.github.ioas the name of your repository and set your repository to public in order to use GitHub Pages. If you're a student, you might be eligible to a free GitHub Pro subscription by enrolling in the GitHub Campus Program.
- Access your new repository and click on
Settings. ChoosePagesfrom the menu on the left side. Choosemasteras your source branch and pressSave. - Your GitHub Pages website will now be available at
https://NAME_OF_YOUR_ACCOUNT.github.io. If not, wait around 10 minutes and try to access the website again. If you're encountering further issues, check GitHub Pages Documentation.
You can safely delete the provided void folder
- Prepare your exported version of the swift playgrounds project by opening the project on swift playgrounds, then choosing
Three dots on top -> Advanced -> Export. In the fields write a custom project subtitles at your choice, then as your contents ID write the reverse DNS of your github pages deployment and a common project name. In my case, it'll beio.github.fra146.voidsince my project common name is void, and the website can be found atfra146.github.io. - Create a new folder for your project by pressing
Add filefrom the main page of your repository, thenCreate new file. OnName your file...typeCOMMON_PROJET_NAME/.(replace COMMON_PROJECT_NAME with the common project name you'll use during the deployment. Following my example in step one, I'd usevoid) and then, on the new field that appears,placeholder.txt. Scroll down and pressCommit new file
For advanced usage of Git, check the documentation.
- In your new folder, press
Add file, thenUpload file. Now upload a compressed (.zip) version of the exported playground, namedCOMMON_PROJECT_NAME.playgroundbook.zip. In my case, I'll usevoid.playgroundbook.zip
For each project, in its own folder, you can add a few images to enrich the download page.
- The thumbnail must be of exactly 902x678 pixels (File name example, thumb.png)
- The banner must be of exactly of 1080x400 pixels (File name example, banner.png)
- The preview images must be of exactly (File name example, prev1.png, prev2.png, prev3.png, ...)
Feed.json will contain information about each and every playground provided with the release. Check the provided feed.json to understand what to put in fields.
In feedIdentifier put the reverse DNS of the root of the github pages. In my example I'll use
io.github.fra146In each contentIdentifier put the reverse DNS of the location of the playground. This must start with the feedIdentifier. In my example I'll useio.github.fra146.void
Check on the right side of the root of the GitHub Repository for a Environments part. Press on github-pages, then View deployment
To add the playground subscription to your own playground app, go to Swift Playground, open the Other playground screen, scroll down and press Subscribe by URL. Here, you'll have to add the precise location to the feed.json. In my case, that'll be https://fra146.github.io/feed.json.

