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
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
can't blazor frontend actually be built as static?
ĀÆ\_(ć)_/ĀÆ
I can confirm, you can build and deploy Blazor WASM on github pages
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...
This one helped me do it
It's a bit finicky doe
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 š
how does it hold up performance wise?
say, compared to CRA
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
sure
This runs fine for me: https://zacharypatten.github.io/dotnet-console-games/Role%20Playing%20Game
But this has noticeable slowdown: https://zacharypatten.github.io/dotnet-console-games/Console%20Monsters
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?
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
Have you tried adding an minimal artificial delay?
yes
blazor webassembly is not multithreaded
if i add a delay
it bogs down the UI thread
so I cannot
uh.. coroutines?
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)
What .NET static site generator can you recommend?
re you wanting a documentation website?
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)
May you can share one of them here?
Some names would be enough. I can google from there.
What's CRA?
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)
Ok
Do you have any thoughts in Hugo or 11ty?
heard good things about them, never used them myself (yet), as I'm not primarily a web developer
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...
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/
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.
why are you wanting to use a generator so bad?
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ā¢3y ago
Message Not Public
Sign In & Join Server To View
ā
This post has been marked as answered!