<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Random recommendation</title>
</head>
<body>
    <header data-diy="page">
        <h1>${(site.name)!}</h1>
    </header>
    <nav data-diy="category">
        <a href="${site.useStatic?then(site.sitePath,site.dynamicPath)}">Home</a>
<@cms.categoryList>
    <#list page.list as category>
        <a href="${category.url!}" target="_blank" data-diy-item="${category.id}">${category.name}</a>
    </#list>
</@cms.categoryList>
    </nav>
    <main>
<@cms.contentList pageSize=10>
    <@cms.contentList pageIndex=getRandom(page.totalPage) pageSize=10>
        <ul data-diy="content">
        <#list page.list as content>
            <li data-diy-item="${content.id}">
                <h3><a href="<#if content.onlyUrl>${site.dynamicPath}content/redirect?id=${content.id}<#else>${content.url!}</#if>" target="_blank">${content.title}</a></h3>
                <p>
                    <#if content.cover?has_content><img src="${content.cover}" alt="${content.title}"/></#if>
                    ${content.description!}
                </p>
            </li>
        </#list>
        </ul>
    </@cms.contentList>
</@cms.contentList>
    </main>
    <footer>
        Copyright &copy; ${.now?string('yyyy')}
    </footer>
    <script>
    var templatePath='${.current_template_name?keep_after('/')}';
    </script>
    <script src="${site.dynamicPath}resource/js/cms.support.js"></script>
    <script>
        var ca = cmsAnalytics();
        var url='${site.dynamicPath}api/visit/record';
        if("string" ==typeof itemString){
            url=url+"?"+itemString;
        }
        ca.setDomain('${site.sitePath?keep_after('//')?keep_before('/')?keep_before(':')}');
        ca.setPath('/');
        ca.report(url);
    </script>
</body>
</html>