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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.3.1

- Version `site.css` and `site.js` URLs in production builds (`?v=` plus the commit SHA, or the build time outside GitHub Actions) so visitors get new styles after a deploy without a hard refresh.

## 0.3.0

- Redesign the home page with an editorial layout: display-size hero with a photo stage and floating countdown, photo-backed live preview, capabilities bento grid, workflow tabs with steps and copy commands, a proof section with stats, image-led journal cards, FAQ, and a closing waitlist band over photography.
Expand Down
7 changes: 7 additions & 0 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ public_path_prefix =
p -> String.trim_trailing(p, "/")
end

asset_version =
case System.get_env("GITHUB_SHA") do
sha when is_binary(sha) and sha != "" -> String.slice(sha, 0, 12)
_ -> Integer.to_string(System.os_time(:second))
end

config :soonex, :public_path_prefix, public_path_prefix
config :soonex, :asset_version, asset_version
config :tableau, :config, url: site_url
config :tableau, Tableau.PostExtension, future: false, dir: ["_posts"]
config :tableau, Tableau.PageExtension, dir: ["_pages"]
4 changes: 2 additions & 2 deletions lib/layouts/root_layout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ defmodule Soonex.RootLayout do
type="font/woff2"
crossorigin
/>
<link rel="stylesheet" href={Soonex.Public.path("/css/site.css")} />
<script type="module" src={Soonex.Public.path("/js/site.js")} />
<link rel="stylesheet" href={Soonex.Public.asset("/css/site.css")} />
<script type="module" src={Soonex.Public.asset("/js/site.js")} />
</head>

<body class="layout typo flex min-h-dvh min-w-0 flex-col overflow-x-clip bg-root text-ink antialiased">
Expand Down
7 changes: 7 additions & 0 deletions lib/soonex/public.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ defmodule Soonex.Public do
pfx -> pfx <> root
end
end

def asset(path) when is_binary(path) do
case Application.get_env(:soonex, :asset_version) do
version when is_binary(version) and version != "" -> path(path) <> "?v=" <> version
_ -> path(path)
end
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Soonex.MixProject do
def project do
[
app: :soonex,
version: "0.3.0",
version: "0.3.1",
elixir: "~> 1.17",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
Expand Down
Loading