I’ve looked at the ‘Publish to GitHub’ link but that didn’t help as it didn’t work for me. There must be a simpler way!?
I’m new to this and need to get something published soon. Please help.
I published to github, but I think you can only do that with one site. Otherwise you have to pay for a hosting solution. There’s bits about that in the course. Google cheap web hosting solutions, and many of them will take you through this.
Hi and welcome to the forums!
If you’re just looking for a completely static website to be published (that is, purely HTML, CSS and JS) then Github Pages is definitely the best way to go. It’s really easy, and completely free to host your website there. Following that link will give you the steps but here is a quick summary:
- Go to your Github account, if you don’t have one yet create an account.
- Start a new repository called [username].github.io. So if your Github username was micro06, you would name the repository “micro06.github.io”.
- Once that’s done, you can upload your files to the repository by opening the repository and clicking Add file > Upload files.
- The only important condition to note is that your homepage must be called “index.html” so that github can detect it’s a website.
After your files are uploaded, you should be able to type [username].github.io into your address bar and after a few minutes your website should be showing there with no problems! If you’ve used all relative links to stylesheets and such and kept the same structure on Github then it should all be done correctly. For example, my username is AdamGaffney96, so my github pages is adamgaffney96.github.io, and you can also check out the repository here if you want an idea of what the structure should look like.
If you require a backend, say for example a database and some admin pages, then there’s multiple directions you could take. Node.js I’ve heard works well, personally I use Django, for which the linked Codecademy course is fantastic. The prerequisite for Django is that you need to know python already, so if you only know JS I’d look into Node.js, Angular or React. I personally host my site using Heroku as they provide a lot of stuff up front for free, you can freely host one project, deploy it and also get a free PostgreSQL database, however that requires a lot more setup and learning.
If you want something robust and fully interactive with possibilities for variable urls and user input, I recommend learning Python and using Django with Heroku hosting. However if you just want a quick, static website, then Github Pages takes only a couple minutes to set up.
The Vancouver Code Projects Chapter recently hosted an event about creating your own website on GitHub Pages. The event was recorded and you can view it on YouTube here. You can also download the slides (which contain lots of helpful links) from the YouTube page.