Skip to content

Commit

Permalink
添加 Microdata 支持,改进与搜索引擎的关系
Browse files Browse the repository at this point in the history
  • Loading branch information
fen committed Jan 4, 2014
1 parent a9000a7 commit 8a58ab7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions usr/themes/default/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 6 additions & 6 deletions usr/themes/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions usr/themes/default/page.php
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
12 changes: 6 additions & 6 deletions usr/themes/default/post.php
Original file line number Diff line number Diff line change
@@ -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'); ?>
Expand Down
16 changes: 8 additions & 8 deletions var/Widget/Comments/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private function threadedCommentsCallback($singleCommentOptions)

$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');
Expand All @@ -105,28 +105,28 @@ private function threadedCommentsCallback($singleCommentOptions)
$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 } ?>
Expand Down

0 comments on commit 8a58ab7

Please sign in to comment.