I think everyone writing content for the web should learn HTML and maybe some CSS - although the design part should be done by someone good with CSS, so that you only need to use semantic HTML, or you will end up with div's all over.
How to build a website without frameworks and tons of libraries
81–90 of 270 posts
Re: How to build a website without frameworks and tons of libraries
#82They use Jinja templating, I prefer Slim (https://github.com/slim-template/slim#syntax-example) which has a more Pythonic syntax (there is plim [0] in Python for that)
I use Tailwind as well for terse styling and fast experimentation (allows me to write a darkMode-aware and responsive 100 line CSS in a single line with about 10 classes)
For interaction I can write CoffeeScript directly in the page [1] and have it compiled by plim.
I run a Caddy static server [2] and use Syncthing [3] to have every file save deployed instantly to my Hetzner server.
I use entr [4] and livereloadx [5] to rebuild the pages and do hot reload on file save. All the commands are managed in a simple Makefile [6]
———
You can already see how the footnotes take up a large chunk of this comment, this is not my idea of simple. Sure, the end result is readable static HTML and I never have to fight obscure React errors, but it’s a high effort setup for starters.
Simple for me would be: write markdown files for pages, a simple CSS for general styling (should be optional), click to deploy on my domain. Images should automatically be resized to multiple sizes and optimized, videos re-encoded for smaller filesize etc.
I have mostly implemented that for myself (https://notes.alinpanaitiu.com/How%20I%20write%20this%20blog...) but it feels fragile. I’d rather pay for a professional solution.
[0] https://plim.readthedocs.io/en/latest/
[1] https://github.com/FuzzyIdeas/lowtechguys/blob/main/src/rcmd...
[2] https://caddyserver.com/docs/command-line#caddy-file-server
[4] https://github.com/eradman/entr
[5] https://nitoyon.github.io/livereloadx/
[6] https://github.com/FuzzyIdeas/lowtechguys/blob/main/Makefile
Re: How to build a website without frameworks and tons of libraries
#83github pages
Re: How to build a website without frameworks and tons of libraries
#84A tiny mostly static website written by one person certainly doesn’t need anything special. A website/webapp with millions of visits per day and a ton of stakeholders requesting features every week, on the other hand... It all depends on the use case, like most stuff.
Re: How to build a website without frameworks and tons of libraries
#85Re: How to build a website without frameworks and tons of libraries
#86Pure HTML + CSS, with the CSS in the or inline in each html tag... this is a fine way to get something going. And then when you have two pages, you pull the CSS out to a separate file.
But once you start making any site which has multiple pages of the same format, you want some kind of template system with includes and a (static page) generator.
If your pages are data-driven, then you might want a programmable site generator which can ingest the data and spit out pages.
But if your data is "live", you end up needing per-view page creation, which is at minimum PHP realm (and certainly leaning into modern web framework with running servers realm).
I recently built a pro-bono website for a hobby of mine. The site is a dance promotion and event site, and the owner is a very non-technical dance teacher. It uses Eleventy (https://www.11ty.dev/) to generate a static site on Netlify (free tier), and it has some custom build code which pulls data from a Google Sheet which I have setup for the teacher to use to define upcoming events. It took a good dozen hours to build, but now it works like a charm while costing nothing to operate or manage. Now having built this, I have discovered a great and powerful sweet spot between absolute bare minimum and Rails/Phoenix/Django level.
Re: How to build a website without frameworks and tons of libraries
#87Re: How to build a website without frameworks and tons of libraries
#88Slightly off-topic: His single "index.php" with jQuery is helping him to earn thousands per month. https://twitter.com/levelsio/status/1675829733668319233/phot...
Are there ways to view tweets without an account? Kind of like archive.is? For now, I could enter it in Google and view cache, but I assume that will go away soon. And if I understand correctly, it's not the index.php, but the actual service behind it, that earns thousands per month. Looks nice :)
Re: How to build a website without frameworks and tons of libraries
#89I've landed on the same approach for my photography portfolio. Benefit of jumping ship from development to photography is that I don't have to rely on Squarespace like most other photographers! After trying a few server-based options like Ghost, Statamic and self-built ones with Phoenix or Vapor (I've covered some ground as a dev) and the usual SSG options I ended up just writing everything as straight HTML without a…
Also, you might find some value in an approach that I used recently (https://news.ycombinator.com/item?id=36592641). Using a Google Sheet as the data driver was easy, but it could have just as well been a filesystem of photos.
Re: How to build a website without frameworks and tons of libraries
#90Not sure about other Static Site Generators, but Eleventy lets you write your content in straight HTML, or whatever else you want, doesn't have to be in Markdown. Do that, plus don't use anything much else except simple template includes, and you've basically got the author's build script, without having to write or maintain any code yourself. Just sayin'.