Notes on: Hand-code simple/medium complexity static websites in HTML, CSS and JavaScript or use a website builder or static site generator?
Last updated on 14 May 2024
This post is capturing my thoughts on this topic. As of now, I don't know enough to have a clear view. As I explore this area further over time, I plan to use this post to capture my learnings and views.
One of the text/video intro/tutorials for Jekyll or Gatsby that I saw recently, said that one of the reasons for using them is to avoid repeating (HTML) code in the various pages of a website, and gave an example of header and footer, if I recall correctly. It said that if changes have to be made to this repeated header and footer (HTML) code, then the changes will have to be done repeatedly for all the pages using them.
That set me thinking. I thought of HTML frames and I wondered why I had not seen any coverage of that (as far as I can recall) in the HTML 5 tutorial I had been through. Some browsing led me to an article that gives the reasons why HTML frames have been made obsolete by w3.org in HTML5: HTML Frames Are Obsolete In HTML5: Here's How To Make Them Responsive, https://html.com/frames/.
Hmm. I rechecked the Dave Gray HTML tutorial final lesson code and saw that yes, the header and footer are repeated in the three or so pages the final lesson code has.
Did some browsing on the issue. Led me to: How to avoid code repetition for webpages?, https://www.reddit.com/r/webdev/comments/bpzlce/how_to_avoid_code_repetition_for_webpages/ , May 2019. The answers were: using template engine (on server) (e.g. PHP), Server Side Rendering, Static Site Generation, Angular, React, Vue ...
In some very old page (over 10 years back), there was a suggestion of using JavaScript to insert the header and footer code into pages but there were some arguments about the suggestion too.
That took me to the next question of do people develop (static) websites with hand-coded HTML, CSS and JavaScript nowadays. Related posts: Do people still write HTML and CSS to build a website?, https://www.quora.com/Do-people-still-write-HTML-and-CSS-to-build-a-website but this post mixes up HTML and CSS usage along with other technologies like CMS and React.
This post is more focused: Does anyone Develop websites with just HTML / CSS / JS anymore?, https://www.reddit.com/r/webdev/comments/nbfml9/does_anyone_develop_websites_with_just_html_css/ , May 2021. One response by Citrous_Oyster (3 years back) is very interesting as the person says, "I exclusively only use html css and js to make all my websites." and provides a link to one such website developed by him: https://www.drvictoriachan.com . I visited the website and it does have quite a few pages with a common header. Using Inspect, one can view the code but as of now I don't want to spend too much time on it. Later, out of curiousity, I may see if I can find out whether he is using JavaScript to provide common header HTML code to various pages in the website.
Is Hand-Coding HTML Web Sites Dead?, https://www.hbdesign.com/hand-coding-html-web-sites-dead/ ... The post is not dated but a comment on it is dated May 2017.
The impression I am getting is that the templates offered by website builder software/CMS platforms are the great advantage in terms of ease-of-use and speed for developing simple/medium complexity static websites, as compared to hand-coding them. But for small static websites, hand-coding them may still be a good solution/approach with the advantage of full control over the website, if the person maintaining the site knows HTML, CSS and JS. As of now, I do not know enough about templates support in tools/frameworks like Gatsby and Next.js when used as a static site generator, to comment on them.
Comments
Post a Comment