全局变量
基本变量不依赖任何标签,可以直接使用。
| 变量名 |
说明 |
| {$global.name} |
博客名称 |
| {$global.description} |
博客描述 |
| {$global.url} |
博客地址 |
| {$global.cover_24} |
博客封面,24x24像素 |
| {$global.cover_64} |
博客封面,64x64像素 |
| {$global.cover_200} |
博客封面,200像素宽度 |
| {$global.archive_url} |
存档页地址 |
| {$global.tag_name} |
当前标签名,非标签页则空 |
| {$global.random_url} |
随机文章 |
| {$global.fans_count} |
博客关注者人数 |
| {$global.notes_count} |
博客总热度数 |
| {$global.post_count} |
博客文章总数 |
| {$global.total_pageviews} |
博客总页面访问量(PV) |
| {$global.day_pageviews} |
博客当天页面访问量(PV) |
| {$global.month_pageviews} |
博客当前自然月页面访问量(PV) |
| {$global.week_pageviews} |
博客本周页面访问量(PV) |
元信息变量
元信息变量不依赖任何标签,常用于页面head区域。
| 变量名 |
说明 |
| {$meta.rss} |
RSS地址 |
| {$meta.description} |
用于meta标签的描述 |
| {$meta.keywords} |
用于meta标签的关键词 |
| {$meta.title} |
经过SEO优化的网页标题,用于<title>标签 |
| {$meta.mobile_icon} |
供智能手机使用的大图标 |
| {$meta.favicon} |
博客的favicon图标 |
| {$meta.syntaxhighlighter} |
给模板加入代码高亮支持 |
示例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| <html>
<head>
<!-- 经过搜索引擎优化的标题 -->
<title>{$meta.title}</title>
<!-- 当前页面说明:会在搜索结果链接下的说明部分显示 -->
<meta name="description" content="{$meta.description}" />
<!-- 页面关键词 -->
<meta name="keywords" content="{$meta.keywords}">
<!-- RSS订阅地址 -->
<link href="{$meta.rss}" rel="alternate" title="订阅{$global.name}" type="application/rss+xml" />
<!-- 网站地址栏、收藏夹图标 -->
<link rel="shortcut icon" type="image/jpeg" href="{$meta.favicon}" />
<!-- iOS/Android移动设备图标 -->
<link rel="apple-touch-icon" href="{$meta.mobile_icon}" />
</head>
<body>
<div class="header">
<!-- 博客地址与博客名称 -->
<h1><a href="{$global.url}">{$global.name}</a></h1>
<!-- 博客说明 -->
{?$global.description}
<p>{$global.description}</p>
{/$global.description}
<!-- 存档页链接 -->
<a href="{$global.archive_url}">存档</a>
<!--随机文章链接-->
<a href="{$global.random_url}">随机文章</a>
</div>
<div class="aside">
<!-- 博客封面 -->
<a href="{$global.url}">
<img src="{$global.cover_200}" />
</a>
<!-- 关注人数 -->
<span>{$global.fans_count}人关注了此博客</span>
</div>
</body>
</html>
|