Vals are made to be shared, and not just on val.town!
You can embed any public or unlisted val on another site by copying the embed URL from the val menu.
When writing for the web, lots of people use WYSIWYG editors, such as those in Wordpress or Notion. In tools with a simple writing experience, you can paste your embed URL straight in. Here’s how it looks when pasted into Notion (which generates this page):
https://www.val.town/embed/neverstew.embedded
In other editors, you might have to create an “embed” and paste the URL into the form that the tool provides.
For sites that don’t provide an editing experience as smooth as Notion or Wordpress, you can embed your val using an iframe element.
Here’s an example, using a web page created by a val that embeds itself:
https://www.val.town/embed/neverstew.embedSelf
And here’s the final web page:
https://neverstew-embedself.web.val.run/
In some scenarios, especially those where you’re providing a guide or a post that the reader is following along with, it’s useful to provide a template for your readers to fork. You can do that using the https://val.town/embed/new endpoint. To generate a new val: