类 PublishContentDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class PublishContentDirective extends AbstractTaskDirective
publishContent 发布分类静态页面指令

参数列表

  • id:内容id
  • ids:多个内容id,id为空时有效

返回结果

  • mapmap类型,键值内容id,值为生成结果

使用示例

<@task.publishContent id=1><#list map as k,v>${k}:${v}<#sep>,</#list></@task.publishContent>

<script>
 fetch('${site.dynamicPath}api/directive/task/publishContent?id=1',{"headers":{"appToken":"接口访问授权Token"}}).then(res => res.json()).then(data=>{
   console.log(data);
 });
 </script>