mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 05:26:22 +05:30
Use traditional title
Use traditional input for title.
This commit is contained in:
parent
39bf9f843a
commit
4e27072496
6 changed files with 66 additions and 23 deletions
|
|
@ -156,13 +156,13 @@ function get_posts($posts, $page = 1, $perpage = 0){
|
|||
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
$arr = explode('t-->', $content);
|
||||
if(isset($arr[1])) {
|
||||
$post->title = str_replace('<h1>','',$arr[0]);
|
||||
$post->title = str_replace('<!--t','',$arr[0]);
|
||||
$post->body = $arr[1];
|
||||
}
|
||||
else {
|
||||
$post->title = 'Untitled: ' . date('l jS \of F Y', $post->date);
|
||||
$post->title = ' Untitled: ' . date('l jS \of F Y', $post->date);
|
||||
$post->body = $arr[0];
|
||||
}
|
||||
|
||||
|
|
@ -322,9 +322,9 @@ function get_bio($author){
|
|||
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
$arr = explode('t-->', $content);
|
||||
if(isset($arr[1])) {
|
||||
$post->title = str_replace('<h1>','',$arr[0]);
|
||||
$post->title = str_replace('<!--t','',$arr[0]);
|
||||
$post->body = $arr[1];
|
||||
}
|
||||
else {
|
||||
|
|
@ -374,9 +374,9 @@ function get_static_post($static){
|
|||
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
$arr = explode('t-->', $content);
|
||||
if(isset($arr[1])) {
|
||||
$post->title = str_replace('<h1>','',$arr[0]);
|
||||
$post->title = str_replace('<!--t','',$arr[0]);
|
||||
$post->body = $arr[1];
|
||||
}
|
||||
else {
|
||||
|
|
@ -452,13 +452,13 @@ function get_keyword($keyword){
|
|||
$post->tagb = implode(' » ', $bc);
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
$arr = explode('t-->', $content);
|
||||
if(isset($arr[1])) {
|
||||
$post->title = str_replace('<h1>','',$arr[0]);
|
||||
$post->title = str_replace('<!--t','',$arr[0]);
|
||||
$post->body = $arr[1];
|
||||
}
|
||||
else {
|
||||
$post->title = 'Untitled: ' . date('l jS \of F Y', $post->date);
|
||||
$post->title = ' Untitled: ' . date('l jS \of F Y', $post->date);
|
||||
$post->body = $arr[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue