-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 4a042cc0a98abca811b9506e08e4d1edc614f0cce36e54286606e1801960e94d1947798de740b6f0ebf3e42a75e882b42cf8a27db9bff3d4ee2da847ff963d70
- Loading branch information
Showing
18 changed files
with
258 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ node_modules | |
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
|
||
src/routes/blog/**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,5 @@ export const fetchMarkdownPosts = async () => { | |
}; | ||
}) | ||
); | ||
|
||
return allPosts; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
export const prerender = true; | ||
|
||
import { filteredPosts } from '$lib/data/blog-posts'; | ||
export const load = async ({ fetch }) => { | ||
const response = await fetch(`/api`); | ||
const posts = await response.json(); | ||
|
||
export async function load() { | ||
return { | ||
posts: filteredPosts | ||
posts | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.