Skip to content

Commit a3c6b60

Browse files
committed
fix url
1 parent 7120ed5 commit a3c6b60

12 files changed

Lines changed: 88 additions & 31 deletions

File tree

config/config.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ config :tableau, :reloader,
99

1010
config :web_dev_utils, :reload_log, true
1111

12+
config :soonex, :public_path_prefix, ""
13+
1214
config :esbuild,
1315
version: "0.25.5",
1416
default: [
@@ -41,7 +43,7 @@ end
4143

4244
config :tableau, :config,
4345
url: "http://localhost:4999",
44-
include_dir: Path.expand("../static", __DIR__),
46+
include_dir: Path.expand("../extra", __DIR__),
4547
converters: [md: Soonex.MDExConverter],
4648
markdown: [
4749
mdex: [

config/prod.exs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ site_url =
66
_ -> "https://corex-ui.github.io/soonex"
77
end
88

9+
public_path_prefix =
10+
site_url
11+
|> URI.parse()
12+
|> Map.get(:path)
13+
|> case do
14+
nil -> ""
15+
"/" -> ""
16+
p -> String.trim_trailing(p, "/")
17+
end
18+
19+
config :soonex, :public_path_prefix, public_path_prefix
920
config :tableau, :config, url: site_url
1021
config :tableau, Tableau.PostExtension, future: false, dir: ["_posts"]
1122
config :tableau, Tableau.PageExtension, dir: ["_pages"]

extra/site.webmanifest

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "Soonex",
33
"short_name": "Soonex",
4+
"start_url": "./",
5+
"scope": "./",
46
"icons": [
57
{
6-
"src": "/images/android-chrome-192x192.png",
8+
"src": "images/android-chrome-192x192.png",
79
"sizes": "192x192",
810
"type": "image/png"
911
},
1012
{
11-
"src": "/images/android-chrome-512x512.png",
13+
"src": "images/android-chrome-512x512.png",
1214
"sizes": "512x512",
1315
"type": "image/png"
1416
}

lib/layouts/post_layout.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ defmodule Soonex.PostLayout do
2727
<article class="flex min-h-dvh flex-col px-space py-size-xl">
2828
<div class="mx-auto flex w-full max-w-3xl flex-col gap-space-lg">
2929
<div class="flex flex-col gap-space-sm sm:flex-row sm:flex-wrap sm:gap-space">
30-
<.navigate to="/" class="link link--accent w-fit">
30+
<.navigate to={Soonex.Public.path("/")} class="link link--accent w-fit">
3131
Back to home
3232
</.navigate>
33-
<.navigate to="/tags" class="link link--accent w-fit">
33+
<.navigate to={Soonex.Public.path("/tags")} class="link link--accent w-fit">
3434
Browse tags
3535
</.navigate>
3636
</div>

lib/layouts/root/footer.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ defmodule Soonex.Layouts.Root.Footer do
2121
<p class="text-ink-muted max-w-prose">
2222
One email at launch. Optional build updates. No spam, no resale, ever.
2323
</p>
24-
<.navigate to="/#waitlist" class="button button--accent w-fit">
24+
<.navigate to={Soonex.Public.path("/") <> "#waitlist"} class="button button--accent w-fit">
2525
Join the waitlist
2626
</.navigate>
2727
</div>
@@ -36,27 +36,27 @@ defmodule Soonex.Layouts.Root.Footer do
3636
</p>
3737
<ul class="m-0 flex list-none flex-col gap-space-sm p-0">
3838
<li>
39-
<.navigate to="/#highlights" class="link link--accent">
39+
<.navigate to={Soonex.Public.path("/") <> "#highlights"} class="link link--accent">
4040
Highlights
4141
</.navigate>
4242
</li>
4343
<li>
44-
<.navigate to="/#scale" class="link link--accent">
44+
<.navigate to={Soonex.Public.path("/") <> "#scale"} class="link link--accent">
4545
Scale
4646
</.navigate>
4747
</li>
4848
<li>
49-
<.navigate to="/#pricing" class="link link--accent">
49+
<.navigate to={Soonex.Public.path("/") <> "#pricing"} class="link link--accent">
5050
Pricing
5151
</.navigate>
5252
</li>
5353
<li>
54-
<.navigate to="/#faq" class="link link--accent">
54+
<.navigate to={Soonex.Public.path("/") <> "#faq"} class="link link--accent">
5555
FAQ
5656
</.navigate>
5757
</li>
5858
<li>
59-
<.navigate to="/#waitlist" class="link link--accent">
59+
<.navigate to={Soonex.Public.path("/") <> "#waitlist"} class="link link--accent">
6060
Waitlist
6161
</.navigate>
6262
</li>
@@ -69,7 +69,7 @@ defmodule Soonex.Layouts.Root.Footer do
6969
</p>
7070
<ul class="m-0 flex list-none flex-col gap-space-sm p-0">
7171
<li>
72-
<.navigate to="/tags" class="link link--accent">
72+
<.navigate to={Soonex.Public.path("/tags")} class="link link--accent">
7373
Tags
7474
</.navigate>
7575
</li>
@@ -79,7 +79,7 @@ defmodule Soonex.Layouts.Root.Footer do
7979
</.navigate>
8080
</li>
8181
<li>
82-
<.navigate to="/docs" class="link link--accent">
82+
<.navigate to={Soonex.Public.path("/docs")} class="link link--accent">
8383
Documentation
8484
</.navigate>
8585
</li>
@@ -89,7 +89,7 @@ defmodule Soonex.Layouts.Root.Footer do
8989
</.navigate>
9090
</li>
9191
<li>
92-
<.navigate to="/#highlights" class="link link--accent">
92+
<.navigate to={Soonex.Public.path("/") <> "#highlights"} class="link link--accent">
9393
Templates
9494
</.navigate>
9595
</li>
@@ -161,7 +161,7 @@ defmodule Soonex.Layouts.Root.Footer do
161161
<.heroicon name="hero-megaphone" />
162162
</.navigate>
163163
<.navigate
164-
to="/feed.xml"
164+
to={Soonex.Public.path("/feed.xml")}
165165
class="button button--circle button--ghost"
166166
aria_label="RSS"
167167
>

lib/layouts/root_layout.ex

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,37 @@ defmodule Soonex.RootLayout do
8181
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8282
<meta name="csrf-token" content={get_csrf_token()} />
8383
84-
<link rel="icon" href="/images/favicon.ico" sizes="48x48" />
85-
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png" />
86-
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png" />
87-
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png" />
88-
<link rel="icon" type="image/png" sizes="192x192" href="/images/android-chrome-192x192.png" />
89-
<link rel="icon" type="image/png" sizes="512x512" href="/images/android-chrome-512x512.png" />
90-
<link rel="manifest" href="/site.webmanifest" />
84+
<link rel="icon" href={Soonex.Public.path("/images/favicon.ico")} sizes="48x48" />
85+
<link
86+
rel="icon"
87+
type="image/png"
88+
sizes="32x32"
89+
href={Soonex.Public.path("/images/favicon-32x32.png")}
90+
/>
91+
<link
92+
rel="icon"
93+
type="image/png"
94+
sizes="16x16"
95+
href={Soonex.Public.path("/images/favicon-16x16.png")}
96+
/>
97+
<link
98+
rel="apple-touch-icon"
99+
sizes="180x180"
100+
href={Soonex.Public.path("/images/apple-touch-icon.png")}
101+
/>
102+
<link
103+
rel="icon"
104+
type="image/png"
105+
sizes="192x192"
106+
href={Soonex.Public.path("/images/android-chrome-192x192.png")}
107+
/>
108+
<link
109+
rel="icon"
110+
type="image/png"
111+
sizes="512x512"
112+
href={Soonex.Public.path("/images/android-chrome-512x512.png")}
113+
/>
114+
<link rel="manifest" href={Soonex.Public.path("/site.webmanifest")} />
91115
92116
<title>{@doc_title}</title>
93117
<meta name="description" content={@doc_description} />
@@ -114,8 +138,8 @@ defmodule Soonex.RootLayout do
114138
rel="stylesheet"
115139
href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Lexend:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap"
116140
/>
117-
<link rel="stylesheet" href="/css/site.css" />
118-
<script type="module" src="/js/site.js" />
141+
<link rel="stylesheet" href={Soonex.Public.path("/css/site.css")} />
142+
<script type="module" src={Soonex.Public.path("/js/site.js")} />
119143
</head>
120144
121145
<body class="layout typo">

lib/layouts/tag_layout.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule Soonex.TagLayout do
1818
~H"""
1919
<article class="flex min-h-dvh flex-col px-space py-size-xl">
2020
<div class="mx-auto flex w-full max-w-3xl flex-col gap-space-lg">
21-
<.navigate to="/tags" class="link link--accent w-fit">
21+
<.navigate to={Soonex.Public.path("/tags")} class="link link--accent w-fit">
2222
All tags
2323
</.navigate>
2424
<header class="flex flex-col gap-space-sm border-b border-border pb-space-lg">
@@ -29,7 +29,7 @@ defmodule Soonex.TagLayout do
2929
</header>
3030
<ul class="m-0 flex list-none flex-col gap-space-sm p-0">
3131
<li :for={post <- @tag_posts}>
32-
<.navigate to={post.permalink} class="link link--accent">
32+
<.navigate to={Soonex.Public.path(post.permalink)} class="link link--accent">
3333
{post[:title] || "Untitled"}
3434
</.navigate>
3535
</li>

lib/pages/home/hero.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ defmodule Soonex.HomePage.Hero do
6666
<.navigate to="#waitlist" class="button button--accent">
6767
Join the waitlist
6868
</.navigate>
69-
<.navigate to="/docs" class="button button--ghost">
69+
<.navigate to={Soonex.Public.path("/docs")} class="button button--ghost">
7070
Read the documentation <.heroicon name="hero-arrow-up-right" />
7171
</.navigate>
7272
</div>

lib/pages/home/pricing.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ defmodule Soonex.HomePage.Pricing do
175175
</ul>
176176
177177
<.navigate
178-
to={if tier.cta_to == :docs, do: "/docs", else: tier.cta_to}
178+
to={if tier.cta_to == :docs, do: Soonex.Public.path("/docs"), else: tier.cta_to}
179179
class={["mt-auto w-full justify-center", tier.cta_class]}
180180
external={tier.cta_external}
181181
>

lib/pages/not_found_page.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule Soonex.NotFoundPage do
2626
<p class="m-0 text-ink-muted">
2727
The URL may be mistyped, or the page may have moved. Try the home page.
2828
</p>
29-
<.navigate to="/" class="button button--accent w-fit self-center">
29+
<.navigate to={Soonex.Public.path("/")} class="button button--accent w-fit self-center">
3030
Back to home
3131
</.navigate>
3232
</div>

0 commit comments

Comments
 (0)