havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
475 stars 66 forks source link

[doc] Documentation RenderBootstrapJavaScriptReference() #741

Closed oscar230 closed 7 months ago

oscar230 commented 7 months ago

Issue

In the documentation Getting Started - Bootstrap JavaScript, there is a snippet of code for adding the bootstrap.bundle.min.js-script tag automaticly. The current helper method snippet looks like this.

<!-- JavaScript Bundle with Popper -->
@Html.Raw(HxSetup.RenderBootstrapJavaScriptReference())

When working on a Blazor Web App project in NET 8.0 this does not work since the Html namespace in not avaliable. One sulution is to resort to manual import of the script tag. Ive found a workaround where HxSetup.RenderBootstrapJavaScriptReference() can be used in side of @((MarkupString)XXX) to accomplish the same thing.

@((MarkupString)HxSetup.RenderBootstrapJavaScriptReference())

Proposed change

Add @((MarkupString)HxSetup.RenderBootstrapJavaScriptReference()) to the Getting Started page in the documentation for developers using Blazor Web App in NET 8.

Why is this issue not a PR?

I don't know if this is the right way to do it since I just started using Blazor in NET 8. If this is accepted as a solution, I can send in a PR.

hakenr commented 7 months ago

I'm enthusiastic about the .razor file instructions for .NET 8. Would you prefer to create the PR yourself, or should we handle it on our end? Let us know what works best for you. Thanks!

oscar230 commented 7 months ago

I'm enthusiastic about the .razor file instructions for .NET 8. Would you prefer to create the PR yourself, or should we handle it on our end? Let us know what works best for you. Thanks!

Yeah after playing around for a bit with the new .razor files and the new Blazor Web App template allowing server, client, SSR and a hybrid solution, these new changes in 8 are just great.

I've like to get into contributing to this project and this might be a great first issue for me. So I created a PR. Can you have a look at this? If anything is incorrect just leave a comment or a commit and I will have a look at it.

Thanks. :)

hakenr commented 7 months ago

Thanks for your contribution! I've rearranged and expanded the HxSetup example to include CSS as well.

oscar230 commented 7 months ago

Thanks for your contribution! I've rearranged and expanded the HxSetup example to include CSS as well.

Awesome, looking at the new getting started page now, looks really nice with the changes! Glad I could help.

Have a nice weekend. :)