我是 Blogger 模板的新手,还在学习。基于 Blogger 和其他一些网站上的 Google 文档,我设法创建了以下模板。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version="2" expr:dir="data:blog.languageDirection" xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://www.google.com/2005/gml/b" xmlns:data="http://www.google.com/2005/gml/data"
xmlns:expr="http://www.google.com/2005/gml/expr">
<b:skin>
<![CDATA[]]>
</b:skin>
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" />
<title>
<data:blog.title />
</title>
</head>
<body>
<b:section id='main' name='Main' showaddelement='yes'>
<b:widget id="Blog1" locked="false" title="Anything" type="Blog" pageType="all">
<b:includable id='main' var='AnythingWidget'>
<b:if cond='data:blog.pageType == "index"'>
<table border="1">
<tr>
<th>Title</th>
<th>Link</th>
</tr>
<b:loop var='post' values='data:posts'>
<b:include name="post_preview" data="post" />
</b:loop>
</table>
</b:if>
<b:if cond='data:blog.pageType == "static_page"'>
<b:loop var='post' values='data:posts'>
<b:include name="page_content" data="post" />
</b:loop>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:loop var='post' values='data:posts'>
<b:include name="post_detail" data="post" />
</b:loop>
</b:if>
</b:includable>
<b:includable id='post_preview' var="post">
<tr>
<td>
<data:post.title />
</td>
<td>
<a expr:href="data:post.url">
<data:post.url /></a>
</td>
</tr>
</b:includable>
<b:includable id="post_detail" var="post">
<table>
<tr>
<th>
<h2>
<data:post.title />
</h2>
</th>
</tr>
<tr>
<td>
<data:post.body />
</td>
</tr>
</table>
</b:includable>
<b:includable id="page_content" var="post">
<table>
<tr>
<th>
<h2>
<data:post.title />
</h2>
</th>
</tr>
<tr>
<td>
<data:post.body />
</td>
</tr>
</table>
</b:includable>
</b:widget>
</b:section>
</body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</html>
我能够在索引页面、帖子详细信息和静态页面内容中显示帖子。下图显示了我的索引页面。
我要补充的是:
- 呈现我创建的所有静态页面的链接列表,
- 呈现标签的链接列表,
- 呈现页码的链接列表。
有谁能够帮我?我已经从以下站点学习,但仍然无法弄清楚如何添加这些小部件。
- https://amprandom.blogspot.com/2017/01/7-blogger-pagetypes-most-used.html
- https://sneeit.com/blogger-basic-global-layout-data-tags/
- https://sites.google.com/site/templateofdoom/Home
- https://www.compromath.com/2017/07/create-blogger-template.html
请不要让我参考模板应用程序。谢谢。