Writing a Website part 1: Recipe for Making a Website!
Creating and hosting a website is not hard, and it is much cheeper than you think! And there are other options even if you don't want to pay.
- Published on .
- Last updated on .
- Tagged under
Why a Recipe?
Creating a project is like cooking. You need the right ingredients, follow a process, and have a bit of patients. Just like it is unhealthy to consume instant food, it is not good for one to rely on a service to publish their content.
There are an interesting number of people even amoung techies who thinks that owning a website is hard and costs a lot. But it is not true, Domain names are cheep, and hosting a website can be done on a low end hardware with 1GB ram and enough GB to run an OS.
Yes, you can host a website on a raspberryPI or other single board computers, but that's not what I'm about to tell you here. I will give you the recipe, and just like any other recipe, how you cook is up to you!
Ingredients
- Domain (optional)
- Hosting provider (optional)
- Content for the website.
Instructions
Step 1: Get a domain
-
Option 1: Using someone elses domain
Some code hosting services like codeberg, gitlab, and github let you create a subdomain to their site with your username and host your website at the same place, you can choose this option if you do not want to pay for a domain. The catch is that you will need to create a static website.
There are also other options like ichi.city and neocities where you can use a subdomain to create sites.
Option 2: Owning a domain
I suggest buying a domain, it is cheep and helps you create an identity. The challenging part is choosing a domain name that is not already taken by someone else, and some will squat on a domain and ask you to pay more for it, avoid them no matter how much you like that domain.
I prefer njalla or netcup when buying a domain. Search for a domain regisrtar and find one that suites you (make sure to read the terms, some cheep registrars have very concerning terms).
Step 2: Decide how it behaves
-
Before you go search for free website builders without code, you need to know a few things.
How a website behaves for a user decides the best way you can write it.
Ignoring most of the techinal stuff, for a user there are two types of websites, static or dynamic.Option 1: Static website
A static webpage is a simple text file usually formatted in HTML format to include images, videos, and styles.
A static website is a collection of static webpages stored in sub folders.Static websites are usually faster as it is not doing much computation, and it will be easier for you too as you don't need to worry about writing code to handle different user inputs or changing what you show to the user based on it. There are ways to do the latter using JavaScript, but it is not needed for a majority of websites like blogs.
It is perfectly possible to create a website without JavaScript or a code running in some server. My previous website did this, the current one is hosted on a virtual private server and runs in rust (still no JavaScript).
Option 2: Dynamic website
A dynamic website, as the name suggests, is a generated at runtime. For example: when a user requests for a page, you can decide how to show it and what content it should have based on some logic.
For a dynamic website, you most likely need to rely on JavaScript. The basic things that you want to do can probably be written in vanilla JavaScript, but there are some JavaScript frameworks out there that claims to make things easier, search and find one that you feel comfortable with.
It is usually not necessary to create a dynamic website. But if you want the page to contain a user-driven flow like dashboards, fancy action-driven user interface (like desktop.exeami.com), etc, you can choose to build a dynamic website.
Step 3: Host the website
-
Option 1: Let someone else host it for you
For both static and dynamic websites, if you are not doing anything fancy like handlig user input for search, comments, forums, etc,. You can use some code hosting services like I mentioned in using someone elses domain section. The links I provided there shows you how to build and host a webiste in their platform.
Option 2: Use a hosting provider
There are many reasons for one to choose a hosting provider, usually it is to store things like comments, user generated images and videos, etc. And the ISP does not give you enough bandwidth for your traffic. In these cases, you might be able to use a hosting provider, and usually, this is also cheep (starting around $5 per month).
I have used njalla and vultr before, they are great. I currently use netcup to host things.
Option 3: Self-host
If your website is small and has less traffic (this is you if you just started a blog), it might be possible to host the site at your own house if your Internet Service Provider (ISP) let you have a static IP address and enough bandwidth.
Step 4: Finishing touch
-
Accessibility
Now that you have a website, you need to make it usable by others, a fancy animation that you liked and added could be trippy for someone, some colors you used might be unreadable due to low contrast, I recommend using WAVE tool or IBM Able extension to fix them, don't worry, they guide you on how and why you should do the changes they recommend.
Read the part 2 of this series to learn about writing a website using simple HTML and CSS.