Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 35 additions & 49 deletions .github/workflows/static.yml → .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Deploy site to Pages

on:
# Runs on pushes targeting the default branch
Expand Down Expand Up @@ -33,6 +33,8 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/kazam0180/pla-site-tool
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -42,40 +44,48 @@ jobs:
uses: actions/cache@v6
with:
path: .cache/icons
key: icons-${{ hashFiles('icons/**', 'no-icon.png', 'convert_icons') }}
key: icons-${{ hashFiles('icons/**', 'no-icon.png') }}

- name: Cache screenshots
id: screenshots-cache
uses: actions/cache@v6
with:
path: .cache/screenshots
key: screenshots-${{ hashFiles('convert_screenshots') }}
key: screenshots-v1

- name: Build App Files
- name: Build site
shell: bash
run: |
sudo apt install --no-install-recommends wget esbuild -y
wget -O pla-site-tool "$(curl -Ls https://api.github.com/repos/kazam0180/portable-apps/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*pla-site-tool.*mage$" | head -1)"

if [ ! -d .cache/icons ]; then
wget -O magick "https://github.com/ImageMagick/ImageMagick/releases/download/7.1.2-29/ImageMagick-7.1.2-29-gcc-x86_64.AppImage"
chmod a+x magick
./magick --appimage-extract
ls squashfs-root
sudo cp -r squashfs-root/usr/* /usr/
sudo chmod a+x /usr/bin/magick
rm -rf magick squashfs-root
else
echo "icon cache hit, skipping ImageMagick download" | tee build-log.txt
fi
set -e

pla-site-tool > pla-site-tool.log 2>&1 &
PLA_PID=$!

imgtool -p . -o ./public convert-screenshots > screenshots.log 2>&1 &
SS_PID=$!

[ ! -x ./pla-site-tool ] && chmod a+x ./pla-site-tool
./pla-site-tool 2>&1 | tee -a build-log.txt
test ${PIPESTATUS[0]} -eq 0 || { echo "pla-site-tool failed, aborting build" | tee -a build-log.txt; exit 1; }
wait "$PLA_PID"; PLA_STATUS=$?
wait "$SS_PID"; SS_STATUS=$?

rm -f sitemap.xml
[ ! -x ./gen_sitemap ] && chmod a+x ./gen_sitemap
./gen_sitemap public https://portable-linux-apps.github.io/ 2>&1 | tee -a build-log.txt
cat pla-site-tool.log screenshots.log | tee -a build-log.txt

[ $PLA_STATUS -eq 0 ] || { echo "pla-site-tool failed" | tee -a build-log.txt; exit 1; }
[ $SS_STATUS -eq 0 ] || { echo "imgtool convert-screenshots failed" | tee -a build-log.txt; exit 1; }

[ ! -x ./minify ] && chmod a+x ./minify
./minify public 2>&1 | tee -a build-log.txt

cp -t public/ favicon.ico *.webp *.jpg
cp -r assets/fonts public/assets/
cp -r casts public/
cp -r am-gui public/
cp -t public/ google*.html BingSiteAuth.xml

echo "site generated" | tee -a build-log.txt

- name: Process icons
run: |
set -e
if [ -d .cache/icons ]; then
mkdir -p public/icons public/icons_48
cp -r .cache/icons/public/icons/. public/icons/
Expand All @@ -84,38 +94,14 @@ jobs:
cp .cache/icons/public/no-icon_48.webp public/no-icon_48.webp
echo "icons restored from cache" | tee -a build-log.txt
else
[ ! -x ./convert_icons ] && chmod a+x ./convert_icons
./convert_icons public 2>&1 | tee -a build-log.txt
imgtool -p . -o ./public convert-icons 2>&1 | tee -a build-log.txt
mkdir -p .cache/icons/public
cp -r public/icons .cache/icons/public/
cp -r public/icons_48 .cache/icons/public/
cp public/no-icon.webp .cache/icons/public/
cp public/no-icon_48.webp .cache/icons/public/
fi

if ! command -v magick >/dev/null 2>&1; then
wget -O magick "https://github.com/ImageMagick/ImageMagick/releases/download/7.1.2-29/ImageMagick-7.1.2-29-gcc-x86_64.AppImage"
chmod a+x magick
./magick --appimage-extract
sudo cp -r squashfs-root/usr/* /usr/
sudo chmod a+x /usr/bin/magick
rm -rf magick squashfs-root
fi

[ ! -x ./convert_screenshots ] && chmod a+x ./convert_screenshots
./convert_screenshots public 2>&1 | tee -a build-log.txt

[ ! -x ./minify ] && chmod a+x ./minify
./minify public 2>&1 | tee -a build-log.txt

cp -t public/ favicon.ico *.webp *.jpg
cp -r assets/fonts public/assets/
cp -r casts public/
cp -r am-gui public/
cp -t public/ sitemap.xml google*.html BingSiteAuth.xml

echo "site generated" | tee -a build-log.txt

- name: Upload Build Log
uses: actions/upload-artifact@v7
with:
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The site supports multiple languages using gettext `.po` files. Translatable str
**Directory structure:**
```
locales/
├── pla-site.pot # Translation template
├── en/
│ └── pla-site.po # English translations (source language)
├── it/
Expand Down Expand Up @@ -122,7 +123,7 @@ The [static.yml](.github/workflows/static.yml) workflow builds and deploys the s

```sh
# download the generator
wget -O pla-site-tool "https://github.com/kazam0180/portable-apps/releases/download/pla-site-tool-0.1.3/pla-site-tool_0.1.3-x86_64.AppImage"
wget -O pla-site-tool "https://github.com/kazam0180/portable-apps/releases/download/pla-site-tool-0.2.3/pla-site-tool_0.2.3-x86_64.AppImage"
chmod +x pla-site-tool

./pla-site-tool # generates the site into public/
Expand Down
10 changes: 5 additions & 5 deletions app_page.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
<meta name="twitter:description" content="$APP_DESC">
<link rel="canonical" href="https://portable-linux-apps.github.io/$LANG/app/$APP_NAME.html">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../assets/css/style.css">
<link rel="stylesheet" href="../../assets/css/app.css">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="stylesheet" href="/assets/css/app.css">
<link rel="preconnect" href="/app/$APP_NAME.json">
<link rel="preconnect" href="../../assets/css/style.css">
<link rel="preconnect" href="../../assets/css/app.css">
<link rel="preconnect" href="../../assets/js/app_page.js">
<link rel="preconnect" href="/assets/css/style.css">
<link rel="preconnect" href="/assets/css/app.css">
<link rel="preconnect" href="/assets/js/app_page.js">
</head>
<body>
<a href="#main" class="skip-link">_("Skip to main content")</a>
Expand Down
14 changes: 6 additions & 8 deletions apps.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="$LANG">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -15,11 +15,11 @@
<meta name="twitter:image" content="https://portable-linux-apps.github.io/pla.jpg">
<meta name="twitter:description" content="_("APPLICATIONS - Portable Linux Apps full app list.")">
<link rel="canonical" href="https://portable-linux-apps.github.io/apps.html">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../assets/css/style.css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="preconnect" href="/apps.json">
<link rel="preconnect" href="../assets/js/script.js">
<link rel="preconnect" href="../assets/css/style.css">
<link rel="preconnect" href="/assets/js/script.js">
<link rel="preconnect" href="/assets/css/style.css">
</head>
<body>
<a href="#main" class="skip-link">Skip to main content</a>
Expand All @@ -46,10 +46,8 @@
<label for="arch-select" class="visually-hidden">_("Filter by architecture")</label>
<select name="arch" id="arch-select">
<option value="">_("All architectures")</option>
<option value="x86_64">x86_64</option>
<option value="aarch64">aarch64</option>
<option value="i686">i686</option>
</select>
<span id="results-count" class="results-count"></span>
</div>
<hr class="section-divider">

Expand Down
8 changes: 8 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ nav a:focus {
background: var(--color-surface);
}

/* === Results Count === */
.results-count {
color: var(--color-text-muted);
font-size: 0.875rem;
margin-left: 0.5rem;
white-space: nowrap;
}

@media (max-width: 640px) {
.lang-selector {
width: 100%;
Expand Down
3 changes: 3 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ document.addEventListener('DOMContentLoaded', function() {
if (visible) matched.push({ index: k, rank: terms.length ? matchRank(k, terms) : 0 });
}

var countEl = document.getElementById('results-count');
if (countEl) countEl.textContent = matched.length + ' results';

if (terms.length) {
matched.sort(function(a, b) {
return a.rank !== b.rank ? a.rank - b.rank : cache[a.index].name.localeCompare(cache[b.index].name);
Expand Down
14 changes: 6 additions & 8 deletions cat_page.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="$LANG">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -17,11 +17,11 @@
<meta name="twitter:image" content="https://portable-linux-apps.github.io/pla.jpg">
<meta name="twitter:description" content="$CAT_NAME_PRETTY - _("Portable Linux Apps category page.")">
<link rel="canonical" href="https://portable-linux-apps.github.io/$LANG/$CAT_NAME.html">
<link rel="icon" href="../favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../assets/css/style.css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="preconnect" href="/categories/$CAT_NAME.json">
<link rel="preconnect" href="../assets/js/script.js">
<link rel="preconnect" href="../assets/css/style.css">
<link rel="preconnect" href="/assets/js/script.js">
<link rel="preconnect" href="/assets/css/style.css">
</head>
<body>
<a href="#main" class="skip-link">_("Skip to main content")</a>
Expand All @@ -48,10 +48,8 @@
<label for="arch-select" class="visually-hidden">_("Filter by architecture")</label>
<select name="arch" id="arch-select">
<option value="">_("All architectures")</option>
<option value="x86_64">x86_64</option>
<option value="aarch64">aarch64</option>
<option value="i686">i686</option>
</select>
<span id="results-count" class="results-count"></span>
</div>
<hr class="section-divider">

Expand Down
Loading