|
|
@ -1275,39 +1275,44 @@ function find_draft_subpage($sub_static = null) |
|
|
|
|
|
|
|
|
foreach ($posts as $index => $v) { |
|
|
foreach ($posts as $index => $v) { |
|
|
if (stripos($v['basename'], $sub_static . '.md') !== false) { |
|
|
if (stripos($v['basename'], $sub_static . '.md') !== false) { |
|
|
|
|
|
|
|
|
$post = new stdClass; |
|
|
|
|
|
|
|
|
|
|
|
$static = str_replace('content/static/', '', dirname($v['dirname'])); |
|
|
$static = str_replace('content/static/', '', dirname($v['dirname'])); |
|
|
|
|
|
|
|
|
// The static page URL
|
|
|
|
|
|
$url= $v['filename']; |
|
|
|
|
|
$post->url = site_url() . $static . "/" . $url; |
|
|
|
|
|
|
|
|
|
|
|
$post->file = $v['dirname'] . '/' . $v['basename']; |
|
|
|
|
|
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); |
|
|
|
|
|
|
|
|
|
|
|
$post->md = $url; |
|
|
|
|
|
|
|
|
$spage = find_page($static); |
|
|
|
|
|
|
|
|
$post->parent = $static; |
|
|
|
|
|
|
|
|
if ($spage) { |
|
|
|
|
|
|
|
|
|
|
|
$post = new stdClass; |
|
|
|
|
|
|
|
|
|
|
|
// The static page URL
|
|
|
|
|
|
$url= $v['filename']; |
|
|
|
|
|
$post->url = site_url() . $static . "/" . $url; |
|
|
|
|
|
|
|
|
// Get the contents and convert it to HTML
|
|
|
|
|
|
$content = file_get_contents($post->file); |
|
|
|
|
|
|
|
|
$post->file = $v['dirname'] . '/' . $v['basename']; |
|
|
|
|
|
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); |
|
|
|
|
|
|
|
|
|
|
|
$post->md = $url; |
|
|
|
|
|
|
|
|
|
|
|
$post->parent = $static; |
|
|
|
|
|
|
|
|
// Extract the title and body
|
|
|
|
|
|
$post->title = get_content_tag('t', $content, 'Untitled static subpage: ' . format_date($post->lastMod, 'l, j F Y, H:i')); |
|
|
|
|
|
|
|
|
// Get the contents and convert it to HTML
|
|
|
|
|
|
$content = file_get_contents($post->file); |
|
|
|
|
|
|
|
|
// Get the contents and convert it to HTML
|
|
|
|
|
|
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); |
|
|
|
|
|
|
|
|
// Extract the title and body
|
|
|
|
|
|
$post->title = get_content_tag('t', $content, 'Untitled static subpage: ' . format_date($post->lastMod, 'l, j F Y, H:i')); |
|
|
|
|
|
|
|
|
$post->views = get_views($post->file); |
|
|
|
|
|
|
|
|
// Get the contents and convert it to HTML
|
|
|
|
|
|
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); |
|
|
|
|
|
|
|
|
$post->description = get_content_tag("d", $content, get_description($post->body)); |
|
|
|
|
|
|
|
|
$post->views = get_views($post->file); |
|
|
|
|
|
|
|
|
$word_count = str_word_count(strip_tags($post->body)); |
|
|
|
|
|
$post->readTime = ceil($word_count / 200); |
|
|
|
|
|
|
|
|
$post->description = get_content_tag("d", $content, get_description($post->body)); |
|
|
|
|
|
|
|
|
$tmp[] = $post; |
|
|
|
|
|
|
|
|
$word_count = str_word_count(strip_tags($post->body)); |
|
|
|
|
|
$post->readTime = ceil($word_count / 200); |
|
|
|
|
|
|
|
|
|
|
|
$tmp[] = $post; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|