Version site CSS and split Linux package downloads
This commit is contained in:
1 parent
6bbc48d32b
commit
c7b7e5528a
9 files changed
+63
-22
No files matched your search
+30
-11
@@ -49,18 +49,23 @@ expand_template_file() {
|
||||
src=$1
|
||||
dst=$2
|
||||
version=$3
|
||||
asset_version=$4
|
||||
mkdir -p "$(dirname -- "$dst")"
|
||||
sed "s#\\\${version}#$version#g" "$src" > "$dst"
|
||||
sed \
|
||||
-e "s#\\\${version}#$version#g" \
|
||||
-e "s#\\\${asset_version}#$asset_version#g" \
|
||||
"$src" > "$dst"
|
||||
}
|
||||
|
||||
copy_template_file() {
|
||||
template_src=$1
|
||||
template_dst=$2
|
||||
template_version=$3
|
||||
template_asset_version=$4
|
||||
|
||||
case ${template_src##*.} in
|
||||
html|htm|txt|xml|json|css|js)
|
||||
expand_template_file "$template_src" "$template_dst" "$template_version"
|
||||
expand_template_file "$template_src" "$template_dst" "$template_version" "$template_asset_version"
|
||||
;;
|
||||
*)
|
||||
copy_path "$template_src" "$template_dst"
|
||||
@@ -72,6 +77,7 @@ copy_template_dir() {
|
||||
template_src_dir=$1
|
||||
template_dst_dir=$2
|
||||
template_version=$3
|
||||
template_asset_version=$4
|
||||
|
||||
require_path "$template_src_dir"
|
||||
find "$template_src_dir" -type d -print | while IFS= read -r dir_path; do
|
||||
@@ -80,16 +86,18 @@ copy_template_dir() {
|
||||
done
|
||||
find "$template_src_dir" -type f -print | while IFS= read -r file_path; do
|
||||
rel=${file_path#"$template_src_dir"/}
|
||||
copy_template_file "$file_path" "$template_dst_dir/$rel" "$template_version"
|
||||
copy_template_file "$file_path" "$template_dst_dir/$rel" "$template_version" "$template_asset_version"
|
||||
done
|
||||
}
|
||||
|
||||
write_site_imports() {
|
||||
cat > "$out_dir/style.css" <<'EOF'
|
||||
@import url('/css/base.css');
|
||||
@import url('/css/components.css');
|
||||
@import url('/theme.css');
|
||||
EOF
|
||||
asset_version=$1
|
||||
: > "$out_dir/style.css"
|
||||
{
|
||||
printf "@import url('/css/base.css?v=%s');\n" "$asset_version"
|
||||
printf "@import url('/css/components.css?v=%s');\n" "$asset_version"
|
||||
printf "@import url('/theme.css?v=%s');\n" "$asset_version"
|
||||
} >> "$out_dir/style.css"
|
||||
}
|
||||
|
||||
write_web_app_csp_html() {
|
||||
@@ -173,15 +181,23 @@ version=$(read_version) || {
|
||||
printf 'Error: could not read app version from %s\n' "$root_dir/src/core/version.h" >&2
|
||||
exit 1
|
||||
}
|
||||
asset_version=${SITE_ASSET_VERSION:-}
|
||||
if [ -z "$asset_version" ]; then
|
||||
if git -C "$root_dir" diff --quiet --ignore-submodules HEAD -- 2>/dev/null; then
|
||||
asset_version=$(git -C "$root_dir" rev-parse --short HEAD 2>/dev/null || date +%s)
|
||||
else
|
||||
asset_version=$(date +%s)
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$out_dir"
|
||||
mkdir -p "$out_dir"
|
||||
|
||||
copy_dir_contents "$script_dir/css" "$out_dir/css"
|
||||
copy_path "$script_dir/themes/inbe.css" "$out_dir/theme.css"
|
||||
write_site_imports
|
||||
copy_template_dir "$script_dir/static" "$out_dir" "$version"
|
||||
expand_template_file "$script_dir/index.html" "$out_dir/index.html" "$version"
|
||||
write_site_imports "$asset_version"
|
||||
copy_template_dir "$script_dir/static" "$out_dir" "$version" "$asset_version"
|
||||
expand_template_file "$script_dir/index.html" "$out_dir/index.html" "$version" "$asset_version"
|
||||
|
||||
copy_dir_contents "$root_dir/web-assets" "$out_dir/web-assets"
|
||||
copy_dir_contents "$root_dir/site-icons" "$out_dir/site-icons"
|
||||
@@ -208,6 +224,9 @@ for path in \
|
||||
web-assets/icons/inbe.png \
|
||||
web-assets/icons/github.png \
|
||||
web-assets/icons/itch.png \
|
||||
web-assets/icons/appimage.png \
|
||||
web-assets/icons/flatpak.png \
|
||||
web-assets/icons/snap.png \
|
||||
build/web/index.html \
|
||||
build/web/index.js \
|
||||
build/web/index.wasm \
|
||||
|
||||
+29
-7
@@ -6,9 +6,9 @@
|
||||
<title>Inner Breeze - Breathing, Meditation, and Habits</title>
|
||||
<meta name="description" content="Inner Breeze is a free, open-source breathing and meditation app with Wim Hof breathing, meditation timers, optional background music, habit tracking, themes, and local-first history.">
|
||||
<link rel="canonical" href="https://inbe.waozi.xyz/">
|
||||
<link href="/css/base.css" rel="stylesheet">
|
||||
<link href="/css/components.css" rel="stylesheet">
|
||||
<link href="/theme.css" rel="stylesheet">
|
||||
<link href="/css/base.css?v=${asset_version}" rel="stylesheet">
|
||||
<link href="/css/components.css?v=${asset_version}" rel="stylesheet">
|
||||
<link href="/theme.css?v=${asset_version}" rel="stylesheet">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/site-icons/favicon-32x32.png">
|
||||
<link rel="apple-touch-icon" href="/site-icons/apple-touch-icon.png">
|
||||
@@ -175,18 +175,40 @@
|
||||
</article>
|
||||
<article class="download-platform">
|
||||
<div class="download-platform-icon">
|
||||
<img src="/web-assets/icons/tux.png" alt="">
|
||||
<img src="/web-assets/icons/appimage.png" alt="">
|
||||
</div>
|
||||
<div class="download-platform-body">
|
||||
<h3>Flatpak / Snap / AppImage</h3>
|
||||
<p>Portable Linux package formats by architecture.</p>
|
||||
<nav aria-label="Portable Linux downloads" class="download-pills">
|
||||
<h3>AppImage</h3>
|
||||
<p>Portable Linux app bundle by CPU architecture.</p>
|
||||
<nav aria-label="AppImage downloads" class="download-pills">
|
||||
<a hidden data-release-asset="inbe-linux-x86_64.AppImage" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-linux-x86_64.AppImage" target="_blank" rel="noopener">AppImage x86_64</a>
|
||||
<a hidden data-release-asset="inbe-linux-aarch64.AppImage" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-linux-aarch64.AppImage" target="_blank" rel="noopener">AppImage aarch64</a>
|
||||
<a hidden data-release-asset="inbe-linux-riscv64.AppImage" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-linux-riscv64.AppImage" target="_blank" rel="noopener">AppImage riscv64</a>
|
||||
</nav>
|
||||
</div>
|
||||
</article>
|
||||
<article class="download-platform">
|
||||
<div class="download-platform-icon">
|
||||
<img src="/web-assets/icons/flatpak.png" alt="">
|
||||
</div>
|
||||
<div class="download-platform-body">
|
||||
<h3>Flatpak</h3>
|
||||
<p>Sandboxed Linux packages by CPU architecture.</p>
|
||||
<nav aria-label="Flatpak downloads" class="download-pills">
|
||||
<a class="is-primary" data-release-asset="inbe-${version}-x86_64.flatpak" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-${version}-x86_64.flatpak" target="_blank" rel="noopener">Flatpak x86_64</a>
|
||||
<a hidden data-release-asset="inbe-${version}-aarch64.flatpak" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-${version}-aarch64.flatpak" target="_blank" rel="noopener">Flatpak aarch64</a>
|
||||
<a hidden data-release-asset="inbe-${version}-riscv64.flatpak" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe-${version}-riscv64.flatpak" target="_blank" rel="noopener">Flatpak riscv64</a>
|
||||
</nav>
|
||||
</div>
|
||||
</article>
|
||||
<article class="download-platform">
|
||||
<div class="download-platform-icon">
|
||||
<img src="/web-assets/icons/snap.png" alt="">
|
||||
</div>
|
||||
<div class="download-platform-body">
|
||||
<h3>Snap</h3>
|
||||
<p>Snap packages by CPU architecture.</p>
|
||||
<nav aria-label="Snap downloads" class="download-pills">
|
||||
<a data-release-asset="inbe_${version}_x86_64.snap" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe_${version}_x86_64.snap" target="_blank" rel="noopener">Snap x86_64</a>
|
||||
<a hidden data-release-asset="inbe_${version}_arm64.snap" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe_${version}_arm64.snap" target="_blank" rel="noopener">Snap arm64</a>
|
||||
<a hidden data-release-asset="inbe_${version}_riscv64.snap" href="https://github.com/waozixyz/inbe/releases/download/v${version}/inbe_${version}_riscv64.snap" target="_blank" rel="noopener">Snap riscv64</a>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Delete Sync Account - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<link href="/style.css?v=${asset_version}" rel="stylesheet" />
|
||||
<meta name="description" content="Delete an Inner Breeze remote sync account using the exported inbe-sync.key file.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
<style>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Delete Sync Account - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<link href="/style.css?v=${asset_version}" rel="stylesheet" />
|
||||
<meta name="description" content="Delete an Inner Breeze remote sync account using the exported inbe-sync.key file.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
<style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<head>
|
||||
<title>Inner Breeze Legacy Data Converter</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<link href="/style.css?v=${asset_version}" rel="stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Convert inbe-legacy JSON exports into the current Inner Breeze import ZIP format.">
|
||||
<link rel="canonical" href="https://inbe.waozi.xyz/legacy-converter.html">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Privacy Policy - Inner Breeze</title>
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
<link href="/style.css?v=${asset_version}" rel="stylesheet" />
|
||||
<meta name="description" content="Privacy policy for Inner Breeze.">
|
||||
<meta name="theme-color" content="#5566aa">
|
||||
</head>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 406 B |
Binary file not shown.
|
After Width: | Height: | Size: 396 B |
Binary file not shown.
|
After Width: | Height: | Size: 397 B |
Reference in new issue
Block a user