mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 05:26:22 +05:30
Add author info
Add author info on post.
This commit is contained in:
parent
231b0ab32f
commit
350133e7c3
8 changed files with 78 additions and 43 deletions
|
|
@ -59,13 +59,13 @@ get('/tag/:tag',function($tag){
|
|||
}
|
||||
|
||||
render('main',array(
|
||||
'title' => 'Tag - ' . $tag .' - ' . config('blog.title'),
|
||||
'title' => 'Posts tagged: ' . $tag .' - ' . config('blog.title'),
|
||||
'page' => $page,
|
||||
'posts' => $posts,
|
||||
'canonical' => config('site.url') . '/tag/' . $tag,
|
||||
'description' => 'All posts tagged ' . $tag . ' on '. config('blog.title') . '.',
|
||||
'bodyclass' => 'intag',
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Posts tagged ' . $tag,
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Posts tagged: ' . $tag,
|
||||
'pagination' => has_pagination($total, $perpage, $page)
|
||||
));
|
||||
});
|
||||
|
|
@ -108,13 +108,13 @@ get('/archive/:req',function($req){
|
|||
}
|
||||
|
||||
render('main',array(
|
||||
'title' => 'Archive - ' . $timestamp .' - ' . config('blog.title'),
|
||||
'title' => 'Archive for: ' . $timestamp .' - ' . config('blog.title'),
|
||||
'page' => $page,
|
||||
'posts' => $posts,
|
||||
'canonical' => config('site.url') . '/archive/' . $req,
|
||||
'description' => 'Archive page for ' . $timestamp . ' on ' . config('blog.title') . '.',
|
||||
'description' => 'Archive page for: ' . $timestamp . ' on ' . config('blog.title') . '.',
|
||||
'bodyclass' => 'inarchive',
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Archive for ' . $timestamp,
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Archive for: ' . $timestamp,
|
||||
'pagination' => has_pagination($total, $perpage, $page)
|
||||
));
|
||||
});
|
||||
|
|
@ -130,6 +130,8 @@ get('/:year/:month/:name', function($year, $month, $name){
|
|||
not_found();
|
||||
}
|
||||
|
||||
$bio = find_bio($current->author);
|
||||
|
||||
if (array_key_exists('prev', $post)) {
|
||||
$prev = $post['prev'];
|
||||
}
|
||||
|
|
@ -147,6 +149,7 @@ get('/:year/:month/:name', function($year, $month, $name){
|
|||
render('post',array(
|
||||
'title' => $current->title .' - ' . config('blog.title'),
|
||||
'p' => $current,
|
||||
'authorinfo' => '<div class="author-info"><div class="separator">→</div><h4><strong>by ' . $bio->title . '</strong></h4>' . $bio->body . '</div>',
|
||||
'canonical' => $current->url,
|
||||
'description' => $description = get_description($current->body),
|
||||
'bodyclass' => 'inpost',
|
||||
|
|
@ -178,7 +181,7 @@ get('/search/:keyword', function($keyword){
|
|||
}
|
||||
|
||||
render('main',array(
|
||||
'title' => 'Search - ' . $keyword . ' - ' . config('blog.title'),
|
||||
'title' => 'Search results for: ' . $keyword . ' - ' . config('blog.title'),
|
||||
'page' => $page,
|
||||
'posts' => $posts,
|
||||
'canonical' => config('site.url') . '/search/' . $keyword,
|
||||
|
|
@ -231,7 +234,7 @@ get('/author/:profile',function($profile){
|
|||
}
|
||||
|
||||
render('profile',array(
|
||||
'title' => 'Author - '. $bio->title .' - ' . config('blog.title'),
|
||||
'title' => 'Profile for: '. $bio->title .' - ' . config('blog.title'),
|
||||
'page' => $page,
|
||||
'posts' => $posts,
|
||||
'bio' => $bio->body,
|
||||
|
|
@ -239,7 +242,7 @@ get('/author/:profile',function($profile){
|
|||
'canonical' => config('site.url') . '/author/' . $profile,
|
||||
'description' => 'Profile page and all posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
|
||||
'bodyclass' => 'inprofile',
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Profile page for ' . $bio->title,
|
||||
'breadcrumb' => '<a href="' . config('site.url') . '">Home</a> » Profile for: ' . $bio->title,
|
||||
'pagination' => has_pagination($total, $perpage, $page)
|
||||
));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -660,13 +660,13 @@ function has_pagination($total, $perpage, $page = 1){
|
|||
function get_description($text) {
|
||||
|
||||
$string = explode('</p>', $text);
|
||||
$string = preg_replace('@[\s]{2,}@',' ', strip_tags($string[0] . '</p>'));
|
||||
$string = preg_replace('/[^,;a-zA-Z0-9_-]|[,;]$/s', ' ', strip_tags($string[0] . '</p>'));
|
||||
|
||||
if (strlen($string) > 1) {
|
||||
return $string;
|
||||
}
|
||||
else {
|
||||
$string = preg_replace('@[\s]{2,}@',' ', strip_tags($text));
|
||||
$string = preg_replace('/[^,;a-zA-Z0-9_-]|[,;]$/s', ' ', strip_tags($text));
|
||||
if (strlen($string) < config('description.char')) {
|
||||
return $string;
|
||||
}
|
||||
|
|
@ -681,12 +681,12 @@ function get_description($text) {
|
|||
function get_teaser($text, $url) {
|
||||
|
||||
if (strlen(strip_tags($text)) < config('teaser.char')) {
|
||||
$string = preg_replace('@[\s]{2,}@',' ', strip_tags($text));
|
||||
$string = preg_replace('/[^,;a-zA-Z0-9_-]|[,;]$/s', ' ', strip_tags($text));
|
||||
$body = $string . '...' . ' <a class="readmore" href="' . $url . '#more">more</a>' ;
|
||||
echo '<p>' . $body . '</p>';
|
||||
}
|
||||
else {
|
||||
$string = preg_replace('@[\s]{2,}@',' ', strip_tags($text));
|
||||
$string = preg_replace('/[^,;a-zA-Z0-9_-]|[,;]$/s', ' ', strip_tags($text));
|
||||
$string = substr($string, 0, strpos($string, ' ', config('teaser.char')));
|
||||
$body = $string . '...' . ' <a class="readmore" href="' . $url . '#more">more</a>' ;
|
||||
echo '<p>' . $body . '</p>';
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@
|
|||
<h1>Search results not found!</h1>
|
||||
<div class="search">
|
||||
<form id="search-form" method="get">
|
||||
<input type="text" class="search-input" name="keyword" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="text" class="search-input" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="submit" value="Search" class="search-button">
|
||||
</form>
|
||||
<?php if(isset($_GET['keyword'])) {$url = site_url() . 'search/' . $_GET['keyword']; header ("Location: $url");} ?>
|
||||
<?php if(isset($_GET['search'])) {$url = site_url() . 'search/' . $_GET['search']; header ("Location: $url");} ?>
|
||||
</div>
|
||||
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -51,13 +51,16 @@ img {
|
|||
-----------------------------*/
|
||||
|
||||
h1{
|
||||
font: 20px 'Open Sans Condensed', sans-serif;
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.3;
|
||||
font: 28px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h1.blog-title {
|
||||
text-transform:uppercase;
|
||||
font: 20px 'Open Sans Condensed', sans-serif;
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
h1.blog-title a {
|
||||
|
|
@ -69,36 +72,6 @@ h1.blog-title a:hover {
|
|||
color: #389dc1;
|
||||
}
|
||||
|
||||
h2{
|
||||
font: 22px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
h3{
|
||||
font: 18px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
h4{
|
||||
font: 16px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
h5{
|
||||
font: 14px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
h6{
|
||||
font: 12px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
h1.title-post, h2.title-index{
|
||||
font: 28px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
|
|
@ -115,6 +88,43 @@ h1.title-post a:hover, h2.title-index a:hover {
|
|||
color: #389dc1;
|
||||
}
|
||||
|
||||
h2{
|
||||
font: 22px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h2.title-index{
|
||||
font: 28px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
text-transform:normal;
|
||||
margin:0 0 20px 0;
|
||||
}
|
||||
|
||||
h3{
|
||||
font: 18px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h4{
|
||||
font: 16px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h5{
|
||||
font: 14px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h6{
|
||||
font: 12px 'Open Sans Condensed', sans-serif;
|
||||
line-height: 1.2;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Content & Posts
|
||||
-----------------------------*/
|
||||
|
|
@ -161,6 +171,10 @@ h1.title-post a:hover, h2.title-index a:hover {
|
|||
text-decoration:none;
|
||||
}
|
||||
|
||||
.body {
|
||||
min-height: 90px;
|
||||
}
|
||||
|
||||
.infront .post, .intag .post, .inarchive .post, .insearch .post, .inprofile .post{
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
padding: 30px 0 10px 0;
|
||||
|
|
@ -541,6 +555,21 @@ aside .copyright p{
|
|||
font-size: 12px;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Author info
|
||||
-----------------------------*/
|
||||
|
||||
.author-info {
|
||||
font-size: 12px;
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
.separator {
|
||||
text-align:left;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Media queries
|
||||
-----------------------------*/
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
<div class="description"><p><?php echo config('blog.description')?></p></div>
|
||||
<div class="search">
|
||||
<form id="search-form" method="get">
|
||||
<input type="text" class="search-input" name="keyword" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="text" class="search-input" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="submit" value="Search" class="search-button">
|
||||
</form>
|
||||
<?php if(isset($_GET['keyword'])) {$url = site_url() . 'search/' . $_GET['keyword']; header ("Location: $url");} ?>
|
||||
<?php if(isset($_GET['search'])) {$url = site_url() . 'search/' . $_GET['search']; header ("Location: $url");} ?>
|
||||
</div>
|
||||
<div class="social"><?php echo social() ?></div>
|
||||
<?php if (menu() == true):?><div class="menu"><?php echo menu() ?></div><?php endif;?>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<div class="main">
|
||||
<h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2>
|
||||
<div class="date"><span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in <span itemprop="articleSection"><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div>
|
||||
<div itemprop="articleBody">
|
||||
<div class="body" itemprop="articleBody">
|
||||
<?php if (config('img.thumbnail') == 'true'):?>
|
||||
<?php echo get_thumbnail($p->body)?>
|
||||
<?php endif;?>
|
||||
|
|
|
|||
|
|
@ -8,10 +8,13 @@
|
|||
<?php if ($type == 'blogpost'):?>
|
||||
<div class="date"><span itemprop="datePublished"><a href="<?php echo $p->archive ?>" title="Show all posts made on this day"><?php echo date('d F Y', $p->date)?></a></span> - Posted in <span itemprop="articleSection"><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> - <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span></div>
|
||||
<?php endif;?>
|
||||
<div itemprop="articleBody">
|
||||
<div class="body" itemprop="articleBody">
|
||||
<?php echo $p->body; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (config('author.info') == 'true'):?>
|
||||
<?php echo $authorinfo ?>
|
||||
<?php endif;?>
|
||||
<div class="comments border">
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<?php if (disqus(null, null) == true):?>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
$i++;
|
||||
?>
|
||||
<li>
|
||||
<span><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></span> on <span><?php echo date('d F Y', $p->date)?></span> - Posted in <span><a href="<?php echo $p->tagurl ?>"><?php echo ucfirst($p->tag) ?></a></span>
|
||||
<span><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></span> on <span><?php echo date('d F Y', $p->date)?></span> - Posted in <span><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></span>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue