From d971a45ec433200d21cd384da6d1f07db166a50d Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Sun, 1 Aug 2010 14:58:02 -0700 Subject: [PATCH] brought in more-link changes from the quilime branch --- content/blog/2010-07-29_biennial_perf | 6 ++++-- lib/data.php | 11 ++++++++++- lib/init.php | 3 ++- lib/template.php | 2 +- public/index.php | 2 ++ templates/default.html.tpl | 8 ++++++-- templates/default.txt.tpl | 2 +- 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/content/blog/2010-07-29_biennial_perf b/content/blog/2010-07-29_biennial_perf index 11350ad..b10e4f9 100644 --- a/content/blog/2010-07-29_biennial_perf +++ b/content/blog/2010-07-29_biennial_perf @@ -3,9 +3,11 @@ tags = perf install projection vis aud notes = this might need to be split up into a few posts -- -# video +[video1] -[video] +[video2] + +two audiovisual performances, done July 29 2010 during the [Biennial of the Americas](http://biennialoftheamericas.org), Denver, Colorado. diff --git a/lib/data.php b/lib/data.php index 9bee7ea..3e0613e 100644 --- a/lib/data.php +++ b/lib/data.php @@ -10,7 +10,7 @@ function get_entries( $path = "", $args = array()) $recursive = isset($args['recursive']) ? $args['recursive'] : 1; $order_by = empty($args['order_by']) ? null : $args['order_by']; $order = empty($args['order']) ? SORT_DESC : $args['order']; - + $path = LOCAL_ROOT . CONTENT_DIR . $path; if ($recursive) { $iterator = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_PATHNAME); @@ -96,6 +96,7 @@ function parse_entry($fileInfo, $page = 0) { $config = ""; $content = ""; + $content_short = ""; $passed_config = false; $file_contents = file($fileInfo->getRealPath(), FILE_USE_INCLUDE_PATH); foreach ( $file_contents as $line ) { @@ -107,6 +108,12 @@ function parse_entry($fileInfo, $page = 0) $config .= $line; continue; } + if (trim($line) == MORE_DELIM) { + $passed_more = true; + } + if (!$passed_more) { + $content_short .= $line; + } $content .= $line; } @@ -116,6 +123,8 @@ function parse_entry($fileInfo, $page = 0) $file['timestamp'] = $file['config']['date'] ? date('U', strtotime( $file['config']['date'])) : $fileInfo->getCTime(); $file['tags'] = $file['config']['tags'] ? explode(" ", $file['config']['tags']) : null; $file['content'] = Markdown($content); + if ($passed_more) + $file['content_short'] = Markdown($content_short); $cat = clean_slashes(str_replace(LOCAL_ROOT . CONTENT_DIR, "", $fileInfo->getPath())); $file['cat'] = $page ? null : array('name' => substr($cat,1), 'url' => $cat.'/' ); $file['path'] = $fileInfo->getRealPath(); diff --git a/lib/init.php b/lib/init.php index a46bb52..3fea4be 100644 --- a/lib/init.php +++ b/lib/init.php @@ -11,7 +11,8 @@ define ('CONTENT_DIR', 'content'); define ('TEMPLATE_DIR', 'templates'); define ('PAGE_DIR', 'pages'); - define ('CONFIG_DELIMITER', '--'); + define ('CONFIG_DELIMITER', '--'); + define ('MORE_DELIM', ''); define ('TITLE_DELIMITER', ': '); define ('CONFIG_FILE', 'config'); diff --git a/lib/template.php b/lib/template.php index c470488..fea9eed 100644 --- a/lib/template.php +++ b/lib/template.php @@ -49,7 +49,7 @@ class Template public function page_title($delim) { - return isset($this->_tpl_vars['page_title']) ? $delim . $this->_tpl_vars['page_title'] : ""; + return $this->_tpl_vars['page_title'] ? $delim . $this->_tpl_vars['page_title'] : ""; } } diff --git a/public/index.php b/public/index.php index fbb2931..76e89fb 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,7 @@ include_template('head-inc.html.tpl') ?> - <?=SITE_TITLE?>: <?=$page_title?> + <?=SITE_TITLE?><?=$this->page_title(TITLE_DELIMITER);?> @@ -13,7 +13,11 @@
- include_template('entry.html.tpl', array('data' => $entry)); ?> + more →

'; + $this->include_template('entry.html.tpl', array('data' => $entry)); + ?>
diff --git a/templates/default.txt.tpl b/templates/default.txt.tpl index bfef63c..eac9fb2 100644 --- a/templates/default.txt.tpl +++ b/templates/default.txt.tpl @@ -1,4 +1,4 @@ -title : title()."\n"; ?> +title : , author : gabriel dunne email : gdunne at quilime dot com copyright : 1997 - -- 2.34.1