Comments (2)
调用方法写在模板里了。参看index.html 或 category/article.html
{% for item in articles %}
<li class="item">
<a href="{{getUrl("article", item, 0)}}" class="link flex-item">
<h5 class="title">{{item.Title}}</h5>
<div class="description">{{item.Description}}</div>
<div class="meta">
{% if item.Category %}<span>{{item.Category.Title}}</span>{% endif %}
<span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
<span>{{item.Views}} 阅读</span>
</div>
</a>
{% if item.GetThumb() %}
<a href="{{getUrl("article", item, 0)}}" class="thumb">
<img class="thumb-image" alt="{{item.Title}}" src="{{item.GetThumb()}}">
</a>
{% endif %}
</li>
{% empty %}
<li class="item empty">
该列表没有任何内容
</li>
{% endfor %}```
from goblog.
调用方法写在模板里了。参看index.html 或 category/article.html
{% for item in articles %} <li class="item"> <a href="{{getUrl("article", item, 0)}}" class="link flex-item"> <h5 class="title">{{item.Title}}</h5> <div class="description">{{item.Description}}</div> <div class="meta"> {% if item.Category %}<span>{{item.Category.Title}}</span>{% endif %} <span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span> <span>{{item.Views}} 阅读</span> </div> </a> {% if item.GetThumb() %} <a href="{{getUrl("article", item, 0)}}" class="thumb"> <img class="thumb-image" alt="{{item.Title}}" src="{{item.GetThumb()}}"> </a> {% endif %} </li> {% empty %} <li class="item empty"> 该列表没有任何内容 </li> {% endfor %}```
好的 谢谢了
from goblog.
Related Issues (20)
- 大佬 可以加入博客加密功能吗 HOT 1
- 根据分类添加文章,点击首页导航分类显示404 HOT 4
- 当伪静态规则改成命名模式后,首页导航就打不开了 HOT 5
- 初始化填写提交没有反应? HOT 1
- 提个建议 HOT 2
- 大佬建议加个自定义tags功能 有助于seo和内容搜索和识别 HOT 3
- 数据库怎么搭 HOT 3
- 高老师,加油! HOT 3
- 你好,请教怎么在列表调用内容? HOT 5
- 有没Docker镜像可快速体验下? HOT 2
- linux 下编译报错, HOT 1
- 防止众多安全问题发生
- go-imagequant apple 错误 error: "This header is only meant to be used on x86 and x64 architecture" HOT 3
- 博客无法评论
- MAC M1 编译不过 HOT 1
- 后台路径/system,这种很容易被猜测到,可以做到配置文件写入类似c6nul4xepof91wbv这样的作为管理后台路由路径吗? HOT 1
- 写错了
- 有网站访问页吗? HOT 1
- 如何访问前台代码? HOT 1
- 盒子添加文章测试,程序崩溃
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goblog.