Skip to content

Commit e2986c4

Browse files
docs(gh-pages): migrate site to jekyll format
1 parent 0b966ad commit e2986c4

File tree

4 files changed

+89
-198
lines changed

4 files changed

+89
-198
lines changed

.github/workflows/update-db.yml

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ name: Update
33

44
on:
55
pull_request:
6-
branches: [master]
7-
types: [opened, synchronize, reopened]
6+
branches:
7+
- master
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
812
push:
9-
branches: [master]
13+
branches:
14+
- master
1015
schedule:
1116
- cron: '0 0 * * *' # every day at midnight
1217
workflow_dispatch:
@@ -23,24 +28,12 @@ jobs:
2328
- name: Checkout
2429
uses: actions/checkout@v4
2530

26-
- name: Checkout gh-pages
27-
uses: actions/checkout@v4
28-
with:
29-
ref: gh-pages
30-
path: gh-pages
31-
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
32-
fetch-depth: 0 # otherwise, will fail to push refs to dest repo
33-
3431
- name: Cache
3532
id: cache
3633
uses: actions/cache@v4
3734
with:
3835
path: cache
39-
key: none
40-
41-
- name: Get current date
42-
id: date
43-
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
36+
key: update-${{ github.sha }}
4437

4538
- name: Set up Python
4639
uses: actions/setup-python@v5
@@ -52,14 +45,6 @@ jobs:
5245
python -m pip install --upgrade pip
5346
python -m pip install -r requirements.txt
5447
55-
- name: Prepare gh-pages
56-
run: |
57-
# empty contents to ensure deleted igdb are removed
58-
rm -f -r ./gh-pages/*
59-
60-
# copy template back to pages
61-
cp -f -r ./gh-pages-template/* ./gh-pages/
62-
6348
- name: Update
6449
env:
6550
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }}
@@ -71,25 +56,30 @@ jobs:
7156
shell: bash
7257
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
7358
run: |
74-
7z a "./gh-pages.zip" "gh-pages"
59+
7z a "./build.zip" "gh-pages"
7560
76-
- name: Upload Artifacts
77-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
61+
- name: Upload artifact
7862
uses: actions/upload-artifact@v4
7963
with:
80-
name: gh-pages
81-
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
64+
name: update
8265
path: |
83-
${{ github.workspace }}/gh-pages.zip
66+
${{ github.workspace }}/build.zip
67+
gh-pages-template/
68+
if-no-files-found: error
69+
include-hidden-files: true
70+
retention-days: 1
8471

85-
- name: Deploy to gh-pages
86-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} # yamllint disable-line rule:line-length
87-
uses: actions-js/[email protected]
88-
with:
89-
github_token: ${{ secrets.GH_BOT_TOKEN }}
90-
author_email: ${{ secrets.GH_BOT_EMAIL }}
91-
author_name: ${{ secrets.GH_BOT_NAME }}
92-
directory: gh-pages
93-
branch: gh-pages
94-
force: false
95-
message: automatic-update-${{ steps.date.outputs.date }}
72+
call-jekyll-build:
73+
needs: update
74+
# todo: change to master
75+
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@feat/build/use-jekyll-and-restyle-website
76+
with:
77+
site_artifact: 'update'
78+
extract_archive: 'build.zip'
79+
target_branch: 'gh-pages'
80+
clean_gh_pages: true
81+
theme_ref: 'feat/build/use-jekyll-and-restyle-website' # todo: remove this line
82+
secrets:
83+
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
84+
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}
85+
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
File renamed without changes.

gh-pages-template/js/item_loader.js renamed to gh-pages-template/assets/js/item_loader.js

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
// setup defaults
22
let org_name = "LizardByte"
3-
let base_url = `https://db.${org_name.toLowerCase()}.dev`
4-
5-
// scripts to load
6-
let scripts = [
7-
'https://app.lizardbyte.dev/js/levenshtein_distance.js',
8-
'https://app.lizardbyte.dev/js/ranking_sorter.js'
9-
]
3+
let base_url = `https://app.${org_name.toLowerCase()}.dev/GameDB`
104

115
// get search options, we will append each platform to this list
126
let search_options = document.getElementById("search_type")
137

148
// get platforms container
15-
platforms_container = document.getElementById("platforms-container")
9+
let platforms_container = document.getElementById("platforms-container")
1610

1711

1812
$(document).ready(function(){
@@ -21,16 +15,6 @@ $(document).ready(function(){
2115
cache: false,
2216
})
2317

24-
let script_queue = scripts.map(function(script) {
25-
return $.getScript(script)
26-
})
27-
28-
$.when.apply(null, script_queue).done(function() {
29-
get_platform_enums()
30-
get_platform_xref()
31-
initialize()
32-
})
33-
3418
// get platform enums from json file
3519
let platform_enums
3620
let get_platform_enums = function() {
@@ -134,7 +118,6 @@ $(document).ready(function(){
134118
// Split the string at the end of the last full word
135119
const splitIndex = match[1].length;
136120
const firstPart = string.slice(0, splitIndex);
137-
// const secondPart = string.slice(splitIndex);
138121

139122
return [firstPart, string];
140123
}
@@ -209,7 +192,7 @@ $(document).ready(function(){
209192
banner.src = sorted[item]['platform_logo']['url'].replace("t_thumb", "t_cover_big")
210193
}
211194
catch (err) {
212-
banner.src = "images/no-logo.png"
195+
banner.src = "/assets/img/no-logo.png"
213196
banner.classList.add("bg-dark")
214197
banner.classList.add("bg-gradient")
215198
banner.classList.add("p-4")
@@ -350,4 +333,8 @@ $(document).ready(function(){
350333
}
351334
})
352335
}
336+
337+
get_platform_enums()
338+
get_platform_xref()
339+
initialize()
353340
})

gh-pages-template/index.html

Lines changed: 51 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,57 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<title>LizardByte - db</title>
5-
<meta charset="utf-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7-
<meta name="description" content="Video game metadata database." />
8-
<meta name="author" content="" />
9-
10-
<!-- Open Graph/Twitter metadata -->
11-
<meta property="og:site_name" content="LizardByte" />
12-
<meta property="og:title" content="LizardByte" />
13-
<meta property="og:type" content="website" />
14-
<meta property="og:image" content="https://app.lizardbyte.dev/assets/images/og-image.png" />
15-
<meta property="og:url" content="https://db.lizardbyte.dev" />
16-
<meta property="og:description" content="Video game metadata database." />
17-
<meta property="og:locale" content="en-US" />
18-
<meta property="twitter:card" content="summary_large_image" />
19-
<meta property="og:twitter_site" content="@lizardbytedev" />
20-
<meta property="og:twitter_site:id" content="@lizardbytedev" />
21-
<meta property="og:twitter_creator" content="@lizardbytedev" />
22-
<meta property="og:twitter_creator:id" content="@lizardbytedev" />
23-
<meta property="twitter:image" content="https://app.lizardbyte.dev/assets/images/og-image.png" />
24-
25-
<!-- Favicon-->
26-
<link rel="icon" type="image/x-icon" href="https://app.lizardbyte.dev/assets/images/favicon.ico" />
27-
<!-- FontAwesome-->
28-
<link href="https://app.lizardbyte.dev/node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" />
29-
<!-- Material icons-->
30-
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" rel="stylesheet" />
31-
32-
<!-- Bootstrap theme-->
33-
<link href="https://app.lizardbyte.dev/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
34-
<!-- Custom css-->
35-
<link href="https://app.lizardbyte.dev/css/custom.css" rel="stylesheet" />
36-
37-
<script src="https://app.lizardbyte.dev/node_modules/jquery/dist/jquery.min.js"></script>
38-
<script src="https://app.lizardbyte.dev/node_modules/@popperjs/core/dist/umd/popper.min.js"></script>
39-
</head>
40-
<body class="d-flex flex-column h-100 bg-dark-gray">
41-
<main class="flex-shrink-0 overflow-hidden">
42-
<!-- Navigation-->
43-
<nav id="nav-container"></nav>
44-
45-
<div class="container px-auto my-5">
46-
<div class="col-lg-12 mx-auto" id="db-container" style="min-width: 335px">
47-
48-
<!-- Search section-->
49-
<section class="py-5 offset-anchor" id="Search">
50-
<div class="container mb-5">
51-
<form id="searchForm">
52-
<div class="form-group d-flex">
53-
<div class="col-3 me-3">
54-
<select class="form-select rounded-0" aria-label="Search Type" id="search_type">
55-
</select>
56-
</div>
57-
<div class="col-6 me-3">
58-
<input type="text" class="form-control rounded-0" placeholder="Search" id="search_term">
59-
</div>
60-
<button type="button" class="btn btn-warning ml-3 rounded-0" onclick="run_search()">
61-
<i class="fa-fw fas fa-search"></i>Search</button>
62-
</div>
63-
</form>
1+
---
2+
title: GameDB
3+
layout: page
4+
full-width: true
5+
after-content:
6+
- donate.html
7+
- support.html
8+
9+
# TODO: Add `cover-img` (supports multiple)
10+
11+
ext-css:
12+
- href: https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200
13+
ext-js:
14+
- https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
15+
- https://cdn.jsdelivr.net/npm/@lizardbyte/[email protected]/dist/levenshtein-distance.js
16+
- https://cdn.jsdelivr.net/npm/@lizardbyte/[email protected]/dist/ranking-sorter.js
17+
js:
18+
- /assets/js/item_loader.js
19+
---
20+
21+
<div class="container px-auto my-5">
22+
<div class="col-lg-12 mx-auto" id="db-container" style="min-width: 335px">
23+
24+
<!-- Search section-->
25+
<section class="py-5 offset-anchor" id="Search">
26+
<div class="container mb-5">
27+
<form id="searchForm">
28+
<div class="form-group d-flex">
29+
<div class="col-3 me-3">
30+
<select class="form-select rounded-0" aria-label="Search Type" id="search_type">
31+
</select>
6432
</div>
65-
<div id="search-container"></div>
66-
</section>
67-
68-
<!-- Platforms section-->
69-
<section class="py-5 offset-anchor" id="Platforms">
70-
<div class="row gx-5 justify-content-center">
71-
<div class="col-lg-8 col-xl-6">
72-
<div class="text-center text-white">
73-
<h2 class="fw-bolder">Platforms</h2>
74-
</div>
75-
</div>
33+
<div class="col-6 me-3">
34+
<input type="text" class="form-control rounded-0" placeholder="Search" id="search_term">
7635
</div>
77-
<div class="row gx-5" id="platforms-container"></div>
78-
</section>
79-
80-
</div>
36+
<button type="button" class="btn btn-warning ml-3 rounded-0" onclick="run_search()">
37+
<i class="fa-fw fas fa-search"></i>Search</button>
38+
</div>
39+
</form>
8140
</div>
82-
83-
<!-- Donate section-->
84-
<section class="offset-anchor bg-dark p-5" id="Donate">
85-
<div class="container mb-5 shadow border-0 bg-dark-gray rounded-0 col-md-7">
86-
<div class="d-table-row g-0 text-white">
87-
<div class="d-table-cell px-3 align-middle text-center">
88-
<h1>
89-
<i class="fa-fw fas fa-coins"></i>
90-
</h1>
91-
</div>
92-
<div class="col-sm-auto border-white my-3 px-3 py-2 border-start">
93-
<div class="container">
94-
<h4 class="card-title mb-3 fw-bolder">Donate</h4>
95-
</div>
96-
<a
97-
class="text-decoration-none"
98-
href="https://github.com/sponsors/LizardByte"
99-
target="_blank">
100-
<img class="m-3"
101-
alt="GitHub Sponsors"
102-
src="https://img.shields.io/github/sponsors/lizardbyte?label=Github%20Sponsors&style=for-the-badge&color=green&logo=githubsponsors"
103-
>
104-
</a>
105-
<a
106-
class="text-decoration-none"
107-
href="https://www.patreon.com/LizardByte"
108-
target="_blank">
109-
<img class="m-3"
110-
alt="Patreon"
111-
src="https://img.shields.io/badge/dynamic/json?color=green&label=Patreon&style=for-the-badge&query=patron_count&url=https%3A%2F%2Fapp.lizardbyte.dev%2Fdashboard%2Fpatreon%2FLizardByte.json&logo=patreon"
112-
>
113-
</a>
114-
<a
115-
class="text-decoration-none"
116-
href="https://www.paypal.com/paypalme/ReenigneArcher"
117-
target="_blank">
118-
<img class="m-3"
119-
alt="PayPal"
120-
src="https://img.shields.io/static/v1?style=for-the-badge&label=PayPal&message=Donate&color=green&logo=paypal"
121-
>
122-
</a>
123-
</div>
41+
<div id="search-container"></div>
42+
</section>
43+
44+
<!-- Platforms section-->
45+
<section class="py-5 offset-anchor" id="Platforms">
46+
<div class="row gx-5 justify-content-center">
47+
<div class="col-lg-8 col-xl-6">
48+
<div class="text-center text-white">
49+
<h2 class="fw-bolder">Platforms</h2>
12450
</div>
12551
</div>
126-
</section>
127-
128-
</main>
129-
<!-- Footer-->
130-
<footer class="bg-dark py-4 mt-auto" id="footer-container"></footer>
131-
<!-- Bootstrap core JS-->
132-
<script src="https://app.lizardbyte.dev/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
52+
</div>
53+
<div class="row gx-5" id="platforms-container"></div>
54+
</section>
13355

134-
<!-- Get navbar -->
135-
<script src="https://app.lizardbyte.dev/js/navbar.js"></script>
136-
<!-- Get footer -->
137-
<script src="https://app.lizardbyte.dev/js/footer.js"></script>
138-
<!-- Discord WidgetBot -->
139-
<script src="https://app.lizardbyte.dev/js/discord.js"></script>
140-
<!-- load games and movies -->
141-
<script src="js/item_loader.js"></script>
142-
</body>
143-
</html>
56+
</div>
57+
</div>

0 commit comments

Comments
 (0)