Skip to content

Commit 751720a

Browse files
committed
web updates
1 parent 541636a commit 751720a

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

examples/ultra-website/mdx/docs.mdx

+12-2
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ Ultra comes with a build function. What it do:
135135

136136
---
137137

138-
### [Deployment](#deployment)
138+
### [Deploying](#deploying)
139139

140-
Use this `Dockerfile`
140+
Use this `Dockerfile`. It is multi-stage, and will both build and run the production ready app.
141141

142142
```bash
143143
FROM denoland/deno:1.25.0 as builder
@@ -151,3 +151,13 @@ COPY --from=builder /app/.ultra /app
151151
WORKDIR /app
152152
CMD ["deno", "task", "start"]
153153
```
154+
155+
You can modify this as needed, another possible Dockerfile assumes you commit your build artifacts, or deploy locally from built files.
156+
157+
```bash
158+
FROM denoland/deno:1.25.0
159+
EXPOSE 8000
160+
WORKDIR /app
161+
COPY .ultra /app
162+
CMD ["deno", "task", "start"]
163+
```

examples/ultra-website/public/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ body {
3131

3232
body {
3333
max-width: 1500px;
34-
min-width: 390px;
34+
min-width: 350px;
3535
margin: auto;
3636
font-size: 120%;
3737
padding-bottom: 5rem;

examples/ultra-website/src/app.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect } from "react";
1+
import { useEffect, useRef } from "react";
22
import useAsset from "ultra/hooks/use-asset.js";
33
import { Link, Route, Switch, useLocation } from "wouter";
44
import HomePage from "./components/Home.tsx";
@@ -9,6 +9,7 @@ import { Helmet } from "react-helmet-async";
99

1010
export default function App() {
1111
const [pathname] = useLocation();
12+
const hasMounted = useRef(false);
1213

1314
useEffect(() => {
1415
if ("serviceWorker" in navigator && location.hostname == "ultrajs.dev") {
@@ -17,7 +18,8 @@ export default function App() {
1718
}, []);
1819

1920
useEffect(() => {
20-
window.scrollTo(0, 0);
21+
if (hasMounted.current) window.scrollTo(0, 0);
22+
else hasMounted.current = true;
2123
}, [pathname]);
2224

2325
const top = () => {

0 commit comments

Comments
 (0)