jsakamoto / BlazorWasmPreRendering.Build

When you publish your Blazor Wasm app, this package pre-renders and saves the app as static HTML files in your public folder.
https://jsakamoto.github.io/BlazorWasmPreRendering.Build/
Mozilla Public License 2.0
245 stars 13 forks source link

Prerender specific paths #20

Open marinasundstrom opened 1 year ago

marinasundstrom commented 1 year ago

Is it possible to configure the rendering? To tell it to generate unique pages based on a route with specific parameter.

I want to prerender my blog which is written in Blazor. To get SEO.

I have posts stored as markdown files which are loaded by page which has the following route:

@page "/posts/{id}"

id is mapped to the name of a markdown file. test.md has Id test

So I wish that I could configure the generator to iterate the markdown files in a folder, and to construct the paths (with parameters) for it to prerender into separate files.

jsakamoto commented 1 year ago

@marinasundstrom

Currently, I don't provide any feature on this library to directly support your scenario.

However, this library will recursively traverse all links inter pages, starting with the root page, and save them into static HTML files. So, as long as users can read all posts on your blog by traversing links on that blog pages on a web browser, this library can prerender those pages to static HTML files. Therefore I assume that you don't have to do such as "iterate the markdown files in a folder".

Could you tell me the URL of your blog site? And the source code of your blog site is disclosed? If so, could you show me the source code of your blog site? I'll take a look at it if you can do that.

jsakamoto commented 1 year ago

@marinasundstrom P.S. Please see also: https://dev.to/j_sakamoto/pre-render-blazor-webassembly-on-static-web-hosting-at-publishing-time-50d8#2nd-crawling

marinasundstrom commented 1 year ago

Aha. So it just crawls a running instance?

Sure.

https://www.sundstrom.dev/about

https://github.com/marinasundstrom/marinas-blog

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: jsakamoto @.> Sent: Monday, October 17, 2022 1:19:53 AM To: jsakamoto/BlazorWasmPreRendering.Build @.> Cc: Marina SundstrΓΆm @.>; Mention @.> Subject: Re: [jsakamoto/BlazorWasmPreRendering.Build] Prerender specific paths (Issue #20)

@marinasundstromhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmarinasundstrom&data=05%7C01%7C%7C8067ac9900b4426e749508daafccef09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638015591957799857%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xQxqWn6NErBYEa5tf04z4Da5Pl5v49YKqrPprGeXmjU%3D&reserved=0 P.S. Please see also: https://dev.to/j_sakamoto/pre-render-blazor-webassembly-on-static-web-hosting-at-publishing-time-50d8#2nd-crawlinghttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.to%2Fj_sakamoto%2Fpre-render-blazor-webassembly-on-static-web-hosting-at-publishing-time-50d8%232nd-crawling&data=05%7C01%7C%7C8067ac9900b4426e749508daafccef09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638015591957799857%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CMQdbyDs917UG1SRzeeYuOXO0jBEVy3%2BJ8z8DAiyyPM%3D&reserved=0

β€” Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjsakamoto%2FBlazorWasmPreRendering.Build%2Fissues%2F20%23issuecomment-1280084929&data=05%7C01%7C%7C8067ac9900b4426e749508daafccef09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638015591957799857%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VAMgI0EuPMltXTiu%2BW7Zyw4o1zIsD8AdwKbSfee77kI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAHAQHHTWOWO4MXKJX267B3WDSERTANCNFSM6AAAAAARGOOQKY&data=05%7C01%7C%7C8067ac9900b4426e749508daafccef09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638015591957799857%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gEidaay2%2FE0uwCKT1UxjbRO87VmIxSz%2FlgDimZuHxe0%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

jsakamoto commented 1 year ago

@marinasundstrom I tried to pre-render your project with the "BlazorWasmPreRendering.Build" package. But unfortunately, I ran into an unexpected critical error. 😱 The error was caused by the incompatible version between assemblies used from your project and used from the "BlazorWasmPreRendering.Build" package. This error depends on the architecture of the "BlazorWasmPreRendering.Build" package, so I'll resolve this problem by my hand.

Please wait for a while until I get it done. πŸ™‡β€β™‚οΈ

marinasundstrom commented 1 year ago

@jsakamoto Thanks! I'm reading your comment after my own attempt at compiling it. I got the error.

I'll be waiting for your fix! πŸ™‚

marinasundstrom commented 1 year ago

When will this be solved? πŸ™‚

jsakamoto commented 1 year ago

@marinasundstrom Well, I estimate it will take this weekend. So, if I did well, we might get the fixed version next Monday. This product is my hobby, and I can spend only about one or two hours per day maintaining my OSS software. Thank you for your patience and your understanding! Anyway, I'm working on it on this branch πŸ‘.

marinasundstrom commented 1 year ago

@jsakamoto I understand that. I just wanted an estimated timeframe. πŸ™‚

Before reading your message I actually worried about having stressed you. Not my intent!

jsakamoto commented 1 year ago

@marinasundstrom Thank you for your patience. I fixed the problem of the "Blazor Wasm Pre-rendering Build" NuGet package and released its new version today.

And moreover, I applied it to your project and sent a pull request.

https://github.com/marinasundstrom/marinas-blog/pull/1

There are still some points that can be improved and an undesirable limitation, but I'll appreciate it if you check out the pull request above link.

marinasundstrom commented 1 year ago

@jsakamoto Thank you! I will have a look this and see how well it works for me πŸ™‚