Getting Started - StrawbethyMilkshake/OpenLinkway GitHub Wiki

Getting Started

Deployment

Deployment with GitHub and Cloudflare Pages (Recommended)

The easiest way to deploy OpenLinkway and keep it up to date is via GitHub and Cloudflare. We have an update mechanism via GitHub Actions, which you can use to keep your site up to date with the latest releases from OpenLinkway. To do this you should follow these steps.

GitHub

  1. In your GitHub account create a new empty repository, do not initialise with a readme. This can be a private repository, however, please note any files included in this repository will be available on your deployed website so do not store any sensitive information in here! I recommend calling your repository either your subdomain or {subdomain}.{domain}.{tld} for easy reference. For example, OpenLinkwayDemo or openlinkwaydemo.strawbethy.com. Image of the GitHub create repository page with the repository name being OpenLinkwayDemo, the repository has no description, the option to add a README file is not selected, add .gitignore is set to none, as is choose a license.
  2. Once you have created your repository, at the bottom of the newly created repository, in the ...or import code from another repository section select the Import code button Image of the "...or import code from another repository section" of the newly created GitHub repository.
  3. Using the import tool, set Your old repository's clone URL to https://github.com/StrawbethyMilkshake/OpenLinkway.git and click Begin import. Image of the GitHub import repository tool, the "Your old repository's clone URL" option is set to "https://github.com/StrawbethyMilkshake/OpenLinkway.git"
  4. Once you have imported the repository, you should see the list of imported files, you may delete the README.md file, you must retain the LICENSE.md file. How you go about this will be discussed in the Configuration section of the document. Image of the files in the imported repository
  5. In the Settings tab of your GitHub repo, navigate to Actions > General in the sidebar and ensure Allow all actions and reusable workflows is selected and click save. Image of the Actions Permissions section of the GitHub Actions settings interface, the selected option is Allow all actions and reusable workflows
  6. In GitHub open the .github/workflows folder and open main.yml, replace the entire contents of main.yml with the below, you should change the on > schedule > - cron value to a time that suits you, you can use a service like Crontab Guru to help configure your schedule. Once done, commit the changes to the main branch.
name: Update OpenLinkway

on:
  schedule:
   - cron: '25 17 * * *'
  push:
    branches: 
      - main

jobs:
  create_release:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      
      - name: Set up Git
        run: |
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Actions"
          
      - name: Get Upstream
        run: |
          curl -s https://api.github.com/repos/StrawbethyMilkshake/OpenLinkway/releases/latest\
          |grep "OpenLinkway.tar.gz"\
          | cut -d : -f 2,3\
          | cut -d , -f 2\
          | tr -d \"\
          | wget -qi -
          tar -xzf OpenLinkway.tar.gz

      - name: Delete Tar
        run: rm OpenLinkway.tar.gz
          
      - name: Check for updates
        id: updateCheck
        run: |
          if [ -n $(git status --porcelain) ](/StrawbethyMilkshake/OpenLinkway/wiki/--n-$(git-status---porcelain)-); then
              echo "There are modified or untracked files."
              git add .
              git commit -m "OpenLinkway Updates"
              echo "updates=true" >> $GITHUB_OUTPUT
          else
              echo "There are no modified or untracked files."
              echo "updates=false" >> $GITHUB_OUTPUT
          fi
          
      - name: Push changes
        if: ${{ steps.updateCheck.outputs.updates == 'true' }}
        uses: ad-m/github-push-action@master
        with:
          force: true
          branch: preview-OpenLinkway-Updates
          
  1. Once done, the workflow should execute which will check for updates from OpenLinkway. How to update will be discussed in the Updating section of the document but at a high level it creates a branch called preview-OpenLinkway-Updates. Image of a completed workflow run named "Update OpenLinkway" in the GitHub Actions page. The workflow run was successful.
  2. In the Settings tab of your GitHub repo, navigate to Email Notifications section, enter your email address in the Address field and click Setup Notifications. Image of the Email Notifications section of the GitHub settings interface, the address field is partly obscured but ends with @strawbethy.com and the Approved Header field is empty

Cloudflare

WIP
This section will largely just explain how to set up Cloudflare pages, you should configure the build command as rm -r .github

Configuration

The OpenLinkway app provides configuration options through the following files:

  • config/links.json: This file allows you to define the links displayed in the app. You can customise properties such as URL, text, hover text, colors, and more.
  • config/page.json: This file allows you to configure the overall appearance and metadata of the app. You can set properties like logo, background image, favicon, title, description, and language.
  • config/bars.json: This file allows you to configure the header and footer bars of the app. You can define their colours and items.