One of the really cool features in our latest release of Magic is the ability to render static websites directly from your cloudlet. Basically, just search for "free website template download", choose any of the 1.2 billion hits, drag and drop it to your cloudlet - And voila! You've got a website.
Ignoring that this is easier than using GitHub pages, WordPress, Wix, or anything else out there of course, there is one additional kick ass feature you'll get with Aista, which is that you can create dynamic Hyperlambda substitutions directly in your HTML. Below is an example of how to replace the H1
tag with dynamic content.
<h1>{{*/execute-dynamic-insert}}</h1>
If you add the above in your index.html page, and add the following Hyperlambda in a file called "index.hl", you will have created your first snippet of server side rendered HTML.
execute-dynamic-insert
data.connect:magic
data.select:select value from users_extra where type = 'name' limit 1
return:x:@data.select/*/*/value
Below is a screenshot of how your file system should look like. Notice the HTML page has an associated .hl
file.
The reference in your HTML is basically an expression to a Hyperlambda "mixin", which is evaluated as a lambda object, for then to dynamically include whatever your lambda object returns, by substituting the reference in your HTML. This allows you to dynamically build your websites, similarly to how PHP works, except minus all the (censored) PHP syntax. Basically, PHP minus the braindead syntax. In the video below I am illustrating how it works, by creating a new cloudlet, downloading a website template, and creating a Hyperlambda mixin substituting parts of my HTML.
To try this out for yourself, you can signup at Aista Hub, create a new cloudlet, and get going. Let me know in the comments what you think :)
Ohh yeah, the price for a cloudlet is €6 per month, but you'll get a trial cloudlet for 90 days if you just want to try things out ... ^_^
Try out the website I'm deploying in the above video here
Top comments (0)