leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.14k stars 247 forks source link

Is there an wasy way to setup head... #23

Closed jordaofranca closed 11 years ago

jordaofranca commented 11 years ago

Found some issues like setup the head in a easy way, without changing the layout.

I'm trying to read the html from an .html archive but when it happens the variables wont work in the other side.

(using LuaHtml)

leafo commented 11 years ago

I made the default layout with the intention that it would be one of the first things replaced. What would you like to see in it? (Here's the source: https://github.com/leafo/lapis/blob/master/lapis/views/layout.moon)

jordaofranca commented 11 years ago

i'm trying to do it like in moonrocks, like adding meta and js, but tis not working. Me and my friend are studying your framework, I'm a graphic designer from Media Lab UFG Brasil and he is graduating at computer engineering in Goias Brasil, and we are very confident about your work till now, congratz. We found a Way to call the html archive with lua language in it (luarock = luahtml), but i is not effective, cuz they are not passing variables through. I'm trying the way of the framework (The way you made it is beauty), but when i try to insert meta ou js, and data in the html tag lyke lang, it is not working. Can you make a simple tutorial with a simple examples?

Here what i did to try meta:

--web.moon

lapis = require "lapis"

lapis.serve class extends lapis.Application

"/": => layout: require "views.layout" @html -> h1 "Test"

--views/layout.moon

import Widget from require "lapis.html"

class Layout extends Widget content: => html_5 -> head -> meta charset: "utf-8" title "test" link rel: "stylesheet", href: "/static/style.css" body -> @content_for "inner"

jordaofranca commented 11 years ago

i got it in lapis tags, its functional, thanks!

leafo commented 11 years ago

Great. I think I tutorial would be really helpful. I'll start assembling one.