Просмотр исходного кода

fixed lack of {{ pages }} since new meta

William Duyck 12 лет назад
Родитель
Сommit
9307e2e63b
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      lib/pico.php

+ 2 - 1
lib/pico.php

@@ -155,7 +155,7 @@ class Pico {
 		$content = $match[0];
 		$content = $match[0];
 
 
 		// parse values and custom fields, add to headers array
 		// parse values and custom fields, add to headers array
-		$rval = preg_match_all('/^[ \t\/*#@](.*):(.*)$/mi', $content, $matches);
+		$rval = preg_match_all('/^(.*):(.*)$/mi', $content, $matches);
 		if($rval){
 		if($rval){
 			for($m=0;$m<count($matches[1]);$m++){
 			for($m=0;$m<count($matches[1]);$m++){
 				$field = trim(strtolower($matches[1][$m]));
 				$field = trim(strtolower($matches[1][$m]));
@@ -220,6 +220,7 @@ class Pico {
 			// Get title and format $page
 			// Get title and format $page
 			$page_content = file_get_contents($page);
 			$page_content = file_get_contents($page);
 			$page_meta = $this->read_file_meta($page_content);
 			$page_meta = $this->read_file_meta($page_content);
+			if(!$page_meta) trigger_error("$page meta not read");
 			$page_content = $this->parse_content($page_content);
 			$page_content = $this->parse_content($page_content);
 			$url = str_replace(CONTENT_DIR, $base_url .'/', $page);
 			$url = str_replace(CONTENT_DIR, $base_url .'/', $page);
 			$url = str_replace('index'. CONTENT_EXT, '', $url);
 			$url = str_replace('index'. CONTENT_EXT, '', $url);