Commit 665956e
committed
Merge #140: fix browser issues
50133fa fix browser issues (Graeme Byrne)
Pull request description:
* Duplicate was being used in `data/blog-posts` and `data/index-posts.ts`. Data now stored in data/posts.ts
* `routes/+layout.ts`, `routes/(home)/+page.server.ts` and `routes/api/+server.ts` updated to access data from correct location.
* Text in `prevNext` component modified to reflect issue #138
* `.md` files added to `.prettierignore` so `CodeBlock` component can be applied to all code blocks.
* `CodeBlock.svelte` component modified as mentioned in #52. Inspiration for change came from https://www.roboleary.net/2022/01/13/copy-code-to-clipboard-blog.html?utm_source=chatgpt.com
* In order to solve issue #137, the reliance on unsupported `startViewTransition` is removed, ensuring more consistent behavior across different browsers and preventing navigation issues.
```
const supportsViewTransition = typeof window !== 'undefined' && 'startViewTransition' in document;
onNavigate((navigation) => {
return new Promise((resolve) => {
if (supportsViewTransition) {
const transition = document.startViewTransition(async () => {
if (contentDiv) {
contentDiv.scrollTop = 0;
}
resolve();
await navigation.complete;
});
} else {
if (contentDiv) {
contentDiv.scrollTop = 0;
}
resolve();
}
});
});
```
* Overlapping `PostTable.svelte` in blog posts as mentioned in #139. The below change explicitly handles the resize event with `on:resize`, preventing conflicts between automatic binding and reactive updates, ensuring smoother state management.
```
<svelte:window on:resize={() => (size = window.innerWidth)} />
<div class={size >= 1440 ? 'scroll-container' : ''} style={divStyle}>
<div>
<slot />
</div>
</div>
```
ACKs for top commit:
josecelano:
ACK 50133fa
Tree-SHA512: 4a042cc0a98abca811b9506e08e4d1edc614f0cce36e54286606e1801960e94d1947798de740b6f0ebf3e42a75e882b42cf8a27db9bff3d4ee2da847ff963d70File tree
18 files changed
+258
-483
lines changed- src
- lib
- components
- molecules
- singletons
- data
- blog-posts
- routes
- (home)
- api
- blog
- [slug]
18 files changed
+258
-483
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
63 | 52 | | |
64 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 128 | | |
123 | 129 | | |
124 | | - | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
| |||
137 | 143 | | |
138 | 144 | | |
139 | 145 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
144 | 150 | | |
| 151 | + | |
| 152 | + | |
145 | 153 | | |
146 | 154 | | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
This file was deleted.
This file was deleted.
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
12 | 23 | | |
13 | | - | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | | - | |
18 | | - | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
0 commit comments