Nostr Sites is now open source 🤙

There is still a lot of work to do. I’m currently working on adding support for editable kind events (not 30023), and eventually the ability to publish straight from the client.

Also, Nostr Sites was recently mentioned by nostr:npub1az9xj85cmxv8e9j9y80lvqp97crsqdu2fpu3srwthd99qfu9qsgstam8y8 on Bitcoin Review 🔥

Check out the code here:

https://github.com/BTCapsule/nostr-sites/

Reply to this note

Please Login to reply.

Discussion

Exciting. Can you please explain to me like I’m 5?

Sure, there are several features to Nostr Sites.

You can write some HTML code into a nostr note, and paste the noteID into the main page. In about 10 seconds, it will render your code and give you a url associated with the noteID.

There is an option to fill out a form, and it will give you some HTML you can use to create a default link tree. Or you can write with markdown, and it will convert it to HTML. Then you just copy this HTML code and paste it into your favorite client.

And finally, there is a paid service that gives you several cool features. You will get a custom url (nostrsites.com/btcapsule), and the option to use additional frameworks like jquery.

You can check out my link tree below, and here is the noteID with the code:

nostr:note1jyma6pkue2jz6aqn3nstve0rxlh6hfrfanevg69jlzktluwlkpzq7s6j4g

https://nostrsites.com/btcapsule

Ok that’s nice. But where are the website hosted? This seems to be similar to Nostr.build but for webpage?

The webpage is hosted on https://nostrsites.com, but the code is transmitted by relays and available to anyone. So it’s more like https://habla.news. Other clients could be built like Nostr Sites, and none of us would have access to the actual code on the note.

Nostr.build is different because it doesn’t render images posted to nostr. It hosts the actual image so it can be viewed on nostr. It’s basically like Imgur, but with some cool nostr features built into it.

Going to check this out tomorrow morning!

💜🫂

so much developments on nostr actually ! it's super great to see ! thank you

Why use a Kind 1, though.. It would be better if you create your own kinds, like I just did with Nostryfied here:

https://nostr-webserver-3c29f7957ffe.herokuapp.com/e/7b8a47b1c97b449e842bc0186e89102874ea801b041c822fdecac50f2f3d91b2

Yes I’m working on using another kind. I saw the kinds you created, and think I’m going to try and add them to Nostr Sites.

Nice! It's just a few numbers. We can make a NIP if this goes forward and formalize them further for your needs.

The main goal is to not pollute kind 1s with code while helping clients figure out how to display these new events correctly.

I am basically doing this:

if (event.kind == 5393) {

response.setHeader('content-type', "text/css")

response.send(event.content)

} else if (event.kind == 5392) {

response.setHeader('content-type', "text/html")

response.send(event.content)

} else if (event.kind == 5394) {

response.setHeader('content-type', "text/javascript")

response.send(event.content)

}

Awesome I will look into this. Yes, I don’t want to pollute everyone’s feed with html code. This was just the easiest way for me to get a minimal product out. I recently learned how to work with kind 30023, so it shouldn’t be too hard to work with other kinds