C
C#ā€¢2y ago
BlueJayBird

I need to build a static website at GitHub pages. Can I use NET technologies for that? What stack?

I've done already something using only html files, adding some JS functionality and adding Bootstrap for the looks. But I'd like to add dependencies and make something more professional (though always static). What can I do without using Jekyll and taking the most .NET approach possible? I've heard about Webpack, Gulp, and others, but I don't know where to start (I'm pretty much of newbie regarding web dev outside the .NET ecosystem).
32 Replies
Up
Upā€¢2y ago
basically you have one core limitation, and that is that github pages requires your end product to be static html/js/css, and cannot run code on the server for each request. that doesn't mean you can only use plain html/js/css during development, however. anything that can ultimately export to static files is fine webpack is a nodeJS tool (so no .net), but there is plenty of static site generators available for .NET as well, if you want to use those
Doombox
Doomboxā€¢2y ago
can't blazor frontend actually be built as static?
Up
Upā€¢2y ago
ĀÆ\_(惄)_/ĀÆ
Monsieur Wholesome
Monsieur Wholesomeā€¢2y ago
I can confirm, you can build and deploy Blazor WASM on github pages
Monsieur Wholesome
Monsieur Wholesomeā€¢2y ago
Swimburger
YouTube
How to Deploy Blazor WebAssembly to GitHub Pages
Correction: You can now make GitHub Pages private: https://github.blog/changelog/2021-01-21-access-control-for-github-pages/ With ASP.NET Blazor WebAssembly you can create .NET applications that run completely inside of the browser. The output of a Blazor WASM project are all static files. You can deploy these applications to various static sit...
Monsieur Wholesome
Monsieur Wholesomeā€¢2y ago
This one helped me do it It's a bit finicky doe
ZacharyPatten
ZacharyPattenā€¢2y ago
I have multiple blazor webassembly apps running on github pages you can ping me if you need help it must be webassembly (not server) to run on GitHub Pages but works like a charm šŸ™‚
Up
Upā€¢2y ago
how does it hold up performance wise? say, compared to CRA
ZacharyPatten
ZacharyPattenā€¢2y ago
I can't offer a performance comparison, but im using it for small games and they run mostly okay, but I do have performance issues but I assume they will optimize blazor more in future would you like an actual example of noticable slowdown? I have one
Up
Upā€¢2y ago
sure
Up
Upā€¢2y ago
but if you say games.. that might be a deciding factor regarding perfomance. certainly needs more juice than just client-rendering a "static" page ok yeah.. first one: mostly fine, but I do notice it stuttering when moving too fast second one: rather than stuttering it feels like input lag?
ZacharyPatten
ZacharyPattenā€¢2y ago
it is related to holding keys yes but when I profile it, it appears to be the framework (not my code) that is slow so either way it is an issue in blazor
Monsieur Wholesome
Monsieur Wholesomeā€¢2y ago
Have you tried adding an minimal artificial delay?
ZacharyPatten
ZacharyPattenā€¢2y ago
yes blazor webassembly is not multithreaded if i add a delay it bogs down the UI thread so I cannot
Up
Upā€¢2y ago
uh.. coroutines?
ZacharyPatten
ZacharyPattenā€¢2y ago
the problem is not im my code though it is in the framework which I cannot edit unless the profiler is lying (which I wouldn't be surprised)
BlueJayBird
BlueJayBirdā€¢2y ago
What .NET static site generator can you recommend?
ZacharyPatten
ZacharyPattenā€¢2y ago
re you wanting a documentation website?
Up
Upā€¢2y ago
none, I don't use them. šŸ˜… (I usually stay within the node ecosystem for webapps, ex. nextJS. not exactly a static site generator but can export statically for certain things)
BlueJayBird
BlueJayBirdā€¢2y ago
May you can share one of them here? Some names would be enough. I can google from there. What's CRA?
Up
Upā€¢2y ago
create-react-app it's a project template to create react single page applications on nodeJS (not necessarily the best one, but by far the most popular)
BlueJayBird
BlueJayBirdā€¢2y ago
Ok Do you have any thoughts in Hugo or 11ty?
Up
Upā€¢2y ago
heard good things about them, never used them myself (yet), as I'm not primarily a web developer
Up
Upā€¢2y ago
here's a pretty decent video that quickly glances over a bunch of javascript web frameworks, compares their pros and cons, and when to use each. of course it's JS and not .NET, but the general principles still apply. https://youtu.be/SJeBRW1QQMA
Fireship
YouTube
I built a JavaScript framework
Learn how to choose a fullstack JavaScript framework by asking questions about your web app in a flow chart. If you're crazy enough, you can even build your own JS framework from scratch like me. #js #webdevelopment #programming šŸ”— Resources Flamethrower on GitHub https://github.com/fireship-io/flamethrower Web Components https://developer.m...
ZacharyPatten
ZacharyPattenā€¢2y ago
I'm not sure exactly what you are looking for, but I have this documentation website on GitHub Pages: https://zacharypatten.github.io/Towel/index.html and it was generated by https://github.com/dotnet/docfx I also have this website on GitHub pages and it is a blazor webassembly project: https://zacharypatten.github.io/dotnet-console-games/
BlueJayBird
BlueJayBirdā€¢2y ago
Thanks. I'll take a look at those. I'm looking something to generate a static website with easy, getting multiple pages. So probably I'll try using something like 11ty, and some other web technologies. Though I'll consider using Blazor at some point, since I'm a .NET Developer. I'm rather new at web dev, so I'm not sure where to start, other than using npm for getting my modules and working from them. If you have any idea/video/tutorial at hand that you can recommend, I'll appreciate it. I've just found out there's a static site generator for React, named Gatsby: https://youtu.be/Tn6-PIqc4UM?t=86 I'll keep on researching.
ZacharyPatten
ZacharyPattenā€¢2y ago
why are you wanting to use a generator so bad?
BlueJayBird
BlueJayBirdā€¢2y ago
For the sake of learning/practice. I already have a mental map of what's going on from the DB to the back-end and from the FE, thanks to Razor, but I'm not so sure about the building-up process of developing the entire site in the UI using a JS Framework. And I want to implement some of these ideas in the development of my GitHub Pages blog site.
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
Accord
Accordā€¢2y ago
āœ… This post has been marked as answered!