Skip to content

Conversation

@khajavi
Copy link
Member

@khajavi khajavi commented Dec 6, 2025

also resolved #3157

@netlify
Copy link

netlify bot commented Dec 6, 2025

Deploy Preview for zio-http ready!

Name Link
🔨 Latest commit cdbdc29
🔍 Latest deploy log https://app.netlify.com/projects/zio-http/deploys/69342b0665c08d00082023f2
😎 Deploy Preview https://deploy-preview-3839--zio-http.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@khajavi
Copy link
Member Author

khajavi commented Dec 6, 2025

@jdegoes This is ready for your review!

Copy link
Contributor

@987Nabil 987Nabil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For template2 as well as twirl an example with the endpoint API would be nice. template2 has an HttpContentCodec. That one could also be used by twirl. Like call transform and transform a twirl Html or String to a Dom

div(`class` := "user-card")(
h3(user.name),
if (showEmail) p(user.email) else Dom.empty,
user.avatar.map(url => img(src := url))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should make explicit in text that this is option of Dom

If we need to create a custom element that is not predefined, we can use the `Dom.element` method:

```scala mdoc:compile-only
Dom.element("custom-tag")(custom("x-property") := "value")("Content here")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer Dom.attr over custom. I think it is more explicit

//</style>
```

To inline a CSS file from the resource directory, use `inlineResource`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also exists for script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

give me some examples how to use zio-http with templates engine like thymeleaf or twirl

2 participants