mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
adding samples
This commit is contained in:
30
samples/FreeMarker/example.ftl
Normal file
30
samples/FreeMarker/example.ftl
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<#import "layout.ftl" as layout>
|
||||||
|
|
||||||
|
<#assign results = [
|
||||||
|
{
|
||||||
|
"title": "Example Result",
|
||||||
|
"description": "Lorem ipsum dolor sit amet, pede id pellentesque, sollicitudin turpis sed in sed sed, libero dictum."
|
||||||
|
}
|
||||||
|
] />
|
||||||
|
|
||||||
|
<@layout.page title="FreeMarker Example">
|
||||||
|
<#if results?size == 0>
|
||||||
|
There were no results.
|
||||||
|
<#else>
|
||||||
|
<ul>
|
||||||
|
<#list results as result>
|
||||||
|
<li>
|
||||||
|
<strong>${result.title}</strong>
|
||||||
|
<p>${result.description}</p>
|
||||||
|
</li>
|
||||||
|
</#list>
|
||||||
|
</ul>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<@currentTime />
|
||||||
|
</@layout.page>
|
||||||
|
|
||||||
|
|
||||||
|
<#macro currentTime>
|
||||||
|
${.now?string.full}
|
||||||
|
</#macro>
|
||||||
12
samples/FreeMarker/layout.ftl
Normal file
12
samples/FreeMarker/layout.ftl
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<#macro page title>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>${title}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<#nested />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</#macro>
|
||||||
Reference in New Issue
Block a user