Skip to content

Commit

Permalink
Embeds public URL in diff.rs build
Browse files Browse the repository at this point in the history
  • Loading branch information
xfbs committed Oct 18, 2024
1 parent 5da0a85 commit 6780cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ stages:
variables:
RUST_VERSION: "1.81"
TRUNK_VERSION: "0.21.1"
PUBLIC_URL: "https://diff.rs/"

# Run unit tests
test:
Expand Down Expand Up @@ -43,7 +44,7 @@ build:
- rustup target add wasm32-unknown-unknown
- wget -qO- https://github.com/thedodd/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- -C /usr/local/bin
script:
- trunk build --release
- trunk build --release --public-url "$PUBLIC_URL"
artifacts:
paths:
- dist
Expand Down
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<!-- metadata -->
<meta charset="utf-8" />
<meta name="description" content="View what is changed between different versions of crates published on crates.io." />
<!-- use native resolution on mobile, disable auto-zoom -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>diff.rs</title>

<!-- resources -->
<link data-trunk rel="tailwind-css" href="src/tailwind.css">
<!-- use wasm-opt to minimize the webassembly output -->
<link data-trunk rel="rust" data-wasm-opt="z">
<script
data-trunk src="static/counter.js"
data-id="bcaf6280-06af-48e2-8e4c-03817fb76945">
</script>
<!-- include base URI -->
<base data-trunk-public-url />
</head>
</html>

0 comments on commit 6780cd3

Please sign in to comment.