mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 12:06:22 +05:30
Use schema.org for breadcrumb
Cleaning up the breadcrumb
This commit is contained in:
parent
e47d7cec97
commit
c8552f3c37
2 changed files with 19 additions and 19 deletions
|
|
@ -394,7 +394,7 @@ get('/front/edit', function () {
|
|||
}
|
||||
});
|
||||
|
||||
// Show the "Add post" page
|
||||
// Show the "Add content" page
|
||||
get('/add/content', function () {
|
||||
|
||||
$req = $_GET['type'];
|
||||
|
|
@ -412,7 +412,7 @@ get('/add/content', function () {
|
|||
'type' => $type,
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'add-content',
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add post'
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add content'
|
||||
));
|
||||
} else {
|
||||
$login = site_url() . 'login';
|
||||
|
|
@ -794,7 +794,7 @@ get('/add/category', function () {
|
|||
'type' => 'is_category',
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'add-category',
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add page'
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add category'
|
||||
));
|
||||
} else {
|
||||
$login = site_url() . 'login';
|
||||
|
|
@ -841,7 +841,7 @@ post('/add/category', function () {
|
|||
'type' => 'is_category',
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'add-category',
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add page'
|
||||
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Add category'
|
||||
));
|
||||
}
|
||||
});
|
||||
|
|
@ -1973,7 +1973,7 @@ get('/post/:name', function ($name) {
|
|||
}
|
||||
|
||||
if (config('blog.enable') === 'true') {
|
||||
$blog = ' <span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . 'blog">Blog</a></span> » ';
|
||||
$blog = '<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . site_url() . 'blog"><span itemprop="name">Blog</span></a><meta itemprop="position" content="2" /></li> » ';
|
||||
} else {
|
||||
$blog = '';
|
||||
}
|
||||
|
|
@ -2010,7 +2010,7 @@ get('/post/:name', function ($name) {
|
|||
'p' => $current,
|
||||
'author' => $author,
|
||||
'bodyclass' => 'in-post category-' . $current->ct . ' type-' . $current->type,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » '. $blog . '<span typeof="v:Breadcrumb">' . $current->categoryb . '</span>' . ' » ' . $current->title,
|
||||
'breadcrumb' => '<style>.breadcrumb-list {margin:0; padding:0;} .breadcrumb-list li {display: inline-block; list-style: none;}</style><ol class="breadcrumb-list" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . site_url() . '"><span itemprop="name">' . config('breadcrumb.home') . '</span></a><meta itemprop="position" content="1" /></li> » '. $blog . '<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">' . $current->categoryb . '<meta itemprop="position" content="3" /></li>' . ' » ' . $current->title . '</ol>',
|
||||
'prev' => has_prev($prev),
|
||||
'next' => has_next($next),
|
||||
'type' => $var,
|
||||
|
|
@ -2062,7 +2062,7 @@ get('/post/:name/edit', function ($name) {
|
|||
'type' => $type,
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'edit-post',
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
} else {
|
||||
render('denied', array(
|
||||
|
|
@ -2072,7 +2072,7 @@ get('/post/:name/edit', function ($name) {
|
|||
'p' => $current,
|
||||
'bodyclass' => 'denied',
|
||||
'is_admin' => true,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2254,7 +2254,7 @@ get('/post/:name/delete', function ($name) {
|
|||
'p' => $current,
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'delete-post',
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
} else {
|
||||
render('denied', array(
|
||||
|
|
@ -2264,7 +2264,7 @@ get('/post/:name/delete', function ($name) {
|
|||
'p' => $current,
|
||||
'is_admin' => true,
|
||||
'bodyclass' => 'delete-post',
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2957,7 +2957,7 @@ get('/:year/:month/:name', function ($year, $month, $name) {
|
|||
}
|
||||
|
||||
if (config('blog.enable') === 'true') {
|
||||
$blog = ' <span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . 'blog">Blog</a></span> » ';
|
||||
$blog = '<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . site_url() . 'blog"><span itemprop="name">Blog</span></a><meta itemprop="position" content="2" /></li> » ';
|
||||
} else {
|
||||
$blog = '';
|
||||
}
|
||||
|
|
@ -2994,7 +2994,7 @@ get('/:year/:month/:name', function ($year, $month, $name) {
|
|||
'p' => $current,
|
||||
'author' => $author,
|
||||
'bodyclass' => 'in-post category-' . $current->ct . ' type-' . $current->type,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » '. $blog . '<span typeof="v:Breadcrumb">' . $current->categoryb . '</span>' . ' » ' . $current->title,
|
||||
'breadcrumb' => '<style>.breadcrumb-list {margin:0; padding:0;} .breadcrumb-list li {display: inline-block; list-style: none;}</style><ol class="breadcrumb-list" itemscope itemtype="http://schema.org/BreadcrumbList"><li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="' . site_url() . '"><span itemprop="name">' . config('breadcrumb.home') . '</span></a><meta itemprop="position" content="1" /></li> » '. $blog . '<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">' . $current->categoryb . '<meta itemprop="position" content="3" /></li>' . ' » ' . $current->title . '</ol>',
|
||||
'prev' => has_prev($prev),
|
||||
'next' => has_next($next),
|
||||
'type' => $var,
|
||||
|
|
@ -3046,7 +3046,7 @@ get('/:year/:month/:name/edit', function ($year, $month, $name) {
|
|||
'type' => $type,
|
||||
'bodyclass' => 'edit-post',
|
||||
'is_admin' => true,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
} else {
|
||||
render('denied', array(
|
||||
|
|
@ -3056,7 +3056,7 @@ get('/:year/:month/:name/edit', function ($year, $month, $name) {
|
|||
'p' => $current,
|
||||
'bodyclass' => 'denied',
|
||||
'is_admin' => true,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -3238,7 +3238,7 @@ get('/:year/:month/:name/delete', function ($year, $month, $name) {
|
|||
'p' => $current,
|
||||
'bodyclass' => 'delete-post',
|
||||
'is_admin' => true,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
} else {
|
||||
render('denied', array(
|
||||
|
|
@ -3248,7 +3248,7 @@ get('/:year/:month/:name/delete', function ($year, $month, $name) {
|
|||
'p' => $current,
|
||||
'bodyclass' => 'delete-post',
|
||||
'is_admin' => true,
|
||||
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
'breadcrumb' => '<span><a href="' . site_url() . '">' . config('breadcrumb.home') . '</a></span> » ' . $current->tagb . ' » ' . $current->title
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -268,13 +268,13 @@ function get_posts($posts, $page = 1, $perpage = 0)
|
|||
if($str[count($str) - 3] == 'uncategorized') {
|
||||
$category = default_category();
|
||||
$post->category = '<a href="' . $category->url . '">' . $category->title . '</a>';
|
||||
$post->categoryb = '<a property="v:title" rel="v:url" href="' . $category->url . '">' . $category->title . '</a>';
|
||||
$post->categoryb = '<a itemprop="item" href="' . $category->url . '"><span itemprop="name">' . $category->title . '</span></a>';
|
||||
} else {
|
||||
|
||||
foreach ($catC as $k => $v) {
|
||||
if ($v['0'] === $str[count($str) - 3]) {
|
||||
$post->category = '<a href="' . site_url() . 'category/' . $v['0'] . '">' . $v['1'] . '</a>';
|
||||
$post->categoryb = '<a property="v:title" rel="v:url" href="' . site_url() . 'category/' . $v['0'] . '">' . $v['1'] . '</a>';
|
||||
$post->categoryb = '<a itemprop="item" href="' . site_url() . 'category/' . $v['0'] . '"><span itemprop="name">' . $v['1'] . '</span></a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
|
|||
|
||||
foreach ($tag as $a) {
|
||||
$url[] = '<a rel="tag" href="' . $a[1] . '">' . $a[0] . '</a>';
|
||||
$bc[] = '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . $a[1] . '">' . $a[0] . '</a></span>';
|
||||
$bc[] = '<span><a href="' . $a[1] . '">' . $a[0] . '</a></span>';
|
||||
}
|
||||
|
||||
$post->tag = implode(' ', $url);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue