Skip to content

Commit 6d8ee70

Browse files
authored
improved meta #2
1 parent f903230 commit 6d8ee70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

microblog/blog.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ function renderBlog(){
4141
while( (!$listPosts && $currentPost > $firstPost-blogPostsPerPage && $currentPost>0) || ($listPosts && $currentPost > 0) ){
4242
$filename=dirname(__FILE__)."/content/".$currentPost.'.html';
4343
$content = file_get_contents($filename);
44+
$content_preview = strip_tags(preg_replace('/^.+\n/', '', $content));
4445
$title=strtok($content, "\n");
4546
if($permaLink!==false){
4647
echo("<meta itemprop=\"name\" content=\"$title\">");
47-
echo("<meta name=\"description\" content=\"$title\">");
48-
echo("<meta name=\"title\" content=\"".blogName."\">");
48+
echo("<meta name=\"description\" content=\"$content_preview\">");
49+
echo("<meta name=\"title\" content=\"$title\">");
4950
}
5051
$content=substr($content, strpos($content, "\n") + 1);
5152
if($listPosts){

0 commit comments

Comments
 (0)