mirror of
https://github.com/typecho/typecho.git
synced 2025-04-15 07:13:05 +02:00
添加 Microdata 支持,改进与搜索引擎的关系
This commit is contained in:
parent
a9000a7e43
commit
8a58ab79cd
@ -9,15 +9,15 @@
|
||||
), '', ''); ?></h3>
|
||||
<?php if ($this->have()): ?>
|
||||
<?php while($this->next()): ?>
|
||||
<article class="post">
|
||||
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<h2 class="post-title" itemprop="name headline"><a itemtype="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<ul class="post-meta">
|
||||
<li><?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></li>
|
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者:'); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间:'); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date('F j, Y'); ?></time></li>
|
||||
<li><?php _e('分类:'); ?><?php $this->category(','); ?></li>
|
||||
<li><a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
<li itemprop="interactionCount"><a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
</ul>
|
||||
<div class="post-content">
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
<?php $this->content('- 阅读剩余部分 -'); ?>
|
||||
</div>
|
||||
</article>
|
||||
|
@ -13,15 +13,15 @@
|
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main">
|
||||
<?php while($this->next()): ?>
|
||||
<article class="post">
|
||||
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<h2 class="post-title" itemprop="name headline"><a itemtype="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
|
||||
<ul class="post-meta">
|
||||
<li><?php _e('作者:'); ?><a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></li>
|
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者:'); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间:'); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date('F j, Y'); ?></time></li>
|
||||
<li><?php _e('分类:'); ?><?php $this->category(','); ?></li>
|
||||
<li><a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
<li itemprop="interactionCount"><a itemprop="discussionUrl" href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?></a></li>
|
||||
</ul>
|
||||
<div class="post-content">
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
<?php $this->content('- 阅读剩余部分 -'); ?>
|
||||
</div>
|
||||
</article>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php $this->need('header.php'); ?>
|
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main">
|
||||
<article class="post">
|
||||
<h1 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<div class="post-content">
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<h1 class="post-title" itemprop="name headline"><a itemtype="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
<?php $this->content(); ?>
|
||||
</div>
|
||||
</article>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<?php $this->need('header.php'); ?>
|
||||
|
||||
<div class="col-mb-12 col-8" id="main" role="main">
|
||||
<article class="post">
|
||||
<h1 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<h1 class="post-title" itemprop="name headline"><a itemtype="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
|
||||
<ul class="post-meta">
|
||||
<li><?php _e('作者:'); ?><?php $this->author(); ?></li>
|
||||
<li><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></li>
|
||||
<li itemprop="author" itemscope itemtype="http://schema.org/Person"><?php _e('作者:'); ?><a itemprop="name" href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a></li>
|
||||
<li><?php _e('时间:'); ?><time datetime="<?php $this->date('c'); ?>" itemprop="datePublished"><?php $this->date('F j, Y'); ?></time></li>
|
||||
<li><?php _e('分类:'); ?><?php $this->category(','); ?></li>
|
||||
</ul>
|
||||
<div class="post-content">
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
<?php $this->content(); ?>
|
||||
</div>
|
||||
<p class="tags"><?php _e('标签:'); ?><?php $this->tags(', ', true, 'none'); ?></p>
|
||||
<p itemprop="keywords" class="tags"><?php _e('标签:'); ?><?php $this->tags(', ', true, 'none'); ?></p>
|
||||
</article>
|
||||
|
||||
<?php $this->need('comments.php'); ?>
|
||||
|
@ -95,7 +95,7 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments
|
||||
|
||||
$commentLevelClass = $this->levels > 0 ? ' comment-child' : ' comment-parent';
|
||||
?>
|
||||
<li id="<?php $this->theId(); ?>" class="comment-body<?php
|
||||
<li itemscope itemtype="http://schema.org/UserComments" id="<?php $this->theId(); ?>" class="comment-body<?php
|
||||
if ($this->levels > 0) {
|
||||
echo ' comment-child';
|
||||
$this->levelsAlt(' comment-level-odd', ' comment-level-even');
|
||||
@ -105,28 +105,28 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments
|
||||
$this->alt(' comment-odd', ' comment-even');
|
||||
echo $commentClass;
|
||||
?>">
|
||||
<div class="comment-author">
|
||||
<?php $this->gravatar($singleCommentOptions->avatarSize, $singleCommentOptions->defaultAvatar); ?>
|
||||
<cite class="fn"><?php $singleCommentOptions->beforeAuthor();
|
||||
<div class="comment-author" itemprop="creator" itemscope itemtype="http://schema.org/Person">
|
||||
<span itemprop="image"><?php $this->gravatar($singleCommentOptions->avatarSize, $singleCommentOptions->defaultAvatar); ?></span>
|
||||
<cite class="fn" itemprop="name"><?php $singleCommentOptions->beforeAuthor();
|
||||
$this->author();
|
||||
$singleCommentOptions->afterAuthor(); ?></cite>
|
||||
</div>
|
||||
<div class="comment-meta">
|
||||
<a href="<?php $this->permalink(); ?>"><?php $singleCommentOptions->beforeDate();
|
||||
<a href="<?php $this->permalink(); ?>"><time itemprop="commentTime" datetime="<?php $this->date('c'); ?>"><?php $singleCommentOptions->beforeDate();
|
||||
$this->date($singleCommentOptions->dateFormat);
|
||||
$singleCommentOptions->afterDate(); ?></a>
|
||||
$singleCommentOptions->afterDate(); ?></time></a>
|
||||
<?php if ('waiting' == $this->status) { ?>
|
||||
<em class="comment-awaiting-moderation"><?php $singleCommentOptions->commentStatus(); ?></em>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="comment-content">
|
||||
<div class="comment-content" itemprop="commentText">
|
||||
<?php $this->content(); ?>
|
||||
</div>
|
||||
<div class="comment-reply">
|
||||
<?php $this->reply($singleCommentOptions->replyWord); ?>
|
||||
</div>
|
||||
<?php if ($this->children) { ?>
|
||||
<div class="comment-children">
|
||||
<div class="comment-children" itemprop="discusses">
|
||||
<?php $this->threadedComments($singleCommentOptions); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user