BlogOnLemmy - I made my Blog using Lemmy's API (martijn.sh)
from kernelle@0d.gs to fediverse@lemmy.world on 11 Apr 21:34
https://0d.gs/post/3139402

Lemmydocs 7:4 – Thou shall create a blog

Features

TODO

GitHub | ./Martijn.sh > Blog

#fediverse

threaded - newest

BlueEther@no.lastname.nz on 11 Apr 22:26 next collapse

I was just thinking about this this morning as we will be going on a 6 week roadrip around NZ and I cant be bothered to stand up my wordpress server again

kernelle@0d.gs on 11 Apr 22:33 collapse

Feel free to use the code in any way you like, and enjoy your trip!

poVoq@slrpnk.net on 11 Apr 23:37 next collapse

This is pretty cool. Thanks for sharing!

kernelle@0d.gs on 12 Apr 02:49 collapse

I’m glad you liked it, thanks for the kind words!

will_a113@lemmy.ml on 11 Apr 23:48 next collapse

I’m a little lost. You mention hosting content on any instance, or on GitHub. How does that work? And if your content is elsewhere what is Lemmy doing? Authx?

Lemmchen@feddit.org on 12 Apr 00:56 next collapse

The content seems to be hosted on 0d.gs

TORFdot0@lemmy.world on 12 Apr 02:20 next collapse

A lot of static site blog generators use markdown to create posts. Lemmy also uses markdown for its’ post formatting. From my understanding what OP has done is that he made this post on Lenmy and has created a front end that basically retrieves the given post from Lemmy and displays it with a more traditional blog style CSS as well as a few other pages that aren’t hosted on Lemmy.

kernelle@0d.gs on 12 Apr 02:55 next collapse

This is in it’s simplest form a blog frontend for Lemmy indeed!

will_a113@lemmy.ml on 12 Apr 03:07 collapse

Ok so you’d literally be making a regular Lenny post to some particular community on some particular instance in that case, right?

kernelle@0d.gs on 12 Apr 03:13 collapse

Exactly, in this case the actual post is this one and posted it here as a x-post.

Edit: I own my instance, but you don’t have to own one in order to deploy this blog frontend.

kernelle@0d.gs on 12 Apr 02:44 collapse

I sepperate the hosting of the content and the page itself. With a website you do need to still be serving a html page, because it has no backend the page can be served by GitHub for example.

In theory you don’t have to touch the website anymore, so you use Lemmy as your markdown frontend.

A constraint like this ensures someone can host their BlogOnLemmy without paying for anything like hosting space or running the instance themselves.

scrubbles@poptalk.scrubbles.tech on 12 Apr 00:13 next collapse

Why not just use an actual federated blogging service like write freely?

kernelle@0d.gs on 12 Apr 02:48 collapse

That requires the running and maintenance of a federated instance, which is not easy or cheap. Doing it like this allows anyone to make a BlogOnLemmy by serving but a single webpage, no extra server cost at all.

scrubbles@poptalk.scrubbles.tech on 12 Apr 18:34 collapse

So, schlepping it off on other instance owners, so they host it, which as you say is not easy or cheap.

kernelle@0d.gs on 12 Apr 18:57 collapse

The open web and API’s are designed for this purpose, and don’t think any instance would ever follow reddit and close up theirs.

I’m all for donating to your instance owner, altough I’d be surprised if any would mind their API being used this way. Giving credit where credit is due.

Fizz@lemmy.nz on 13 Apr 07:06 next collapse

How come I can’t see the Lemmy comments on your blog?

kernelle@0d.gs on 13 Apr 09:21 collapse

Good question, it’s a design choice. Being attached to my name I had no interest in needing to moderate which comments should and shouldn’t be showing up under my name. There is a direct link to the posts on lemmy where they can be interacted with.

A second concern is XSS, with my own content I have no worries.

onlinepersona@programming.dev on 14 Apr 12:34 collapse

A blog entry on how it works and what it does at a high level could be nice. I’m not sure what I’m looking at, but there must be some API call to Lemmy and it’s probably happening on the server due to CORS; not sure how this would work just in the browser if the Lemmy instance has CORS setup…

Edit: OK the instance 0d.gs does in fact not have CORS 😮 That’s a little concerning…

Hold up, neither does programming.dev? Uh… @recursive_recursion@programming.dev and @Ategon@programming.dev is that safe? I’m not a security expert but doesn’t this allow for cross site attacks?

Anti Commercial-AI license

kernelle@0d.gs on 14 Apr 18:00 collapse

I’ve noticed that a more detailed writeup is warranted! So I’ll be working on that.

CORS is enabled on lemmy, you have to send the ‘Origin’ header in order to get the Access-Control headers. Which allows cross-origin for simple requests. No added headers, cookies or other data. So all API calls are made in JS by your browser.