Add support for description metatag
There is no abstraction for the description metatag yet in WebDSL.
Not sure what the following ‘description’ is used for, if used at all:
"description" "{" Word* "}" -> Description {cons("Description")}
Anyway, Let’s add support for the description metatag. We can add the following template to built-in:
define description() { includeHead("<meta name='description' content='" + /'/.replaceAll( "'" ,rendertemplate(elements) ) +"'>") }
Note: We need to filter the value of
rendertemplate(elements)
in some way that it won’t interfere with the surrounding tag. I think replacing all single quotes with the html code'
would suffice.Or we need to treat it differently by our compiler in a similar fashion as title.
Submitted by Elmer van Chastelet on 26 November 2012 at 22:05
Issue Log
The existing description syntax is an unrelated construct for comments, and hardly ever used.
The description template looks like a good solution for now, title should become something similar instead of a separate code generation rule.
The bigger refactoring that needs to happen here is to move the base page template (the html surrounding each page definition) to the library, allowing an application to override it for complete control.
Added description template in r5538.
Danny: concerning the bigger refactoring, let’s create a new issue for that?
Log in to post comments