Technology
This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.
Ask in DM before posting product reviews or ads. All such posts otherwise are subject to removal.
Rules:
1: All Lemmy rules apply
2: Do not post low effort posts
3: NEVER post naziped*gore stuff
4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.
5: personal rants of Big Tech CEOs like Elon Musk are unwelcome (does not include posts about their companies affecting wide range of people)
6: no advertisement posts unless verified as legitimate and non-exploitative/non-consumerist
7: crypto related posts, unless essential, are disallowed
view the rest of the comments
Or you could just use a https://github.com/myles/awesome-static-generators
I prefer the flexibility of PHP personally, but there's pros and cons to everything. For example, I don't really see how setting up 11ty is any easier than a 10 line
build.php. Might as well keep it simpleI tried SSGs like 11ty, but they are overkill for simple things.
I'd be interested in the 10 line build.php. Care to share?
Sure, I'm typing it out on my phone though so excuse any mistakes:
Tap for build.sh
Tap for build.php
Tap for utils.php
Tap for bootstrap.php
I stripped out all the database stuff because as my site grew I kept expanding on it and I needed a database.
Mine will also probably be longer than average because I wanted fancy stuff like my source pages being just "about.php" instead of "about/index.php", but I wanted the output to be "about/index.html" so it got way more complicated than it needed to be. But again most of those lines in the for loop are just me being obsessive compulsive about my own directory structure 😂. I also didn't count the utilities functions in my original line count because to me that's equivalent of importing a module; I didn't write that file, I just copy pasted it from online. You could probably find a simpler build script online.
Tap for example.php
Thank you very much. I'll try to comprehend all this later, since I'm on the phone as well :)
PHP is additional vulnerability, while static html is bullet proof, as long as http server is safe and up to date.
How is PHP a vulnerability if it never leaves your machine and you only use it to build the HTML?
Oh, if you're only using it to generate static html it's of course safe. I would prefer minimal markdown for blogs, though.
I guess I just really like HTML. Any excuse to write actual HTML makes me happy