From: Gabriel Dunne Date: Sat, 19 May 2012 02:34:10 +0000 (-0700) Subject: updated rss, json feed and templates X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=0a698343dcee1851945c51141a318fba2e3dceb2;p=plog.git updated rss, json feed and templates --- diff --git a/css/style.css b/css/style.css index fa34c07..726e4e0 100644 --- a/css/style.css +++ b/css/style.css @@ -32,6 +32,7 @@ h1 { padding-top:0; margin-top:0; margin-bottom:30px; + font-size } h1, h2, h3, h4, h5, h6 { font-weight:normal; @@ -44,6 +45,9 @@ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration:none; color:#666; } +h1 a { + color:#f0a; +} h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color:#fff; } @@ -90,8 +94,7 @@ table, td, tr { } #content { - position:relative; - left: 160px; + padding-left: 160px; margin-top:20px; padding-bottom: 20px; } @@ -128,7 +131,7 @@ background:rgba(25,25,25,0.3); margin-bottom:100px; } .entry .metadata { - visibility:hidden; + /*visibility:hidden;*/ } .entry:hover .metadata{ visibility:visible; @@ -142,6 +145,8 @@ background:rgba(25,25,25,0.3); } .entry h1 { margin-bottom:5px; + position:relative; + left:-1.65em; } .entry h1 a { } @@ -179,6 +184,8 @@ background:rgba(25,25,25,0.3); display:inline-block; margin-right:10px; margin-bottom:40px; + width:120px; + font-size:12px; } .thumb { width:100px; diff --git a/index.php b/index.php index a41ee49..e903382 100644 --- a/index.php +++ b/index.php @@ -28,7 +28,6 @@ else if ($m->is_multiple()) - header("Content-Type: {$m->response_mime_type}; charset=UTF-8"); $v->render( $m->template ); diff --git a/lib/init.php b/lib/init.php index 6ac949c..c7292b6 100644 --- a/lib/init.php +++ b/lib/init.php @@ -13,7 +13,7 @@ error_reporting(E_ALL); ini_set("display_errors", 1); # timezone -putenv('TZ=Asia/Calcutta'); +putenv('TZ=America/Los Angeles'); # include path ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(realpath(__FILE__))); diff --git a/lib/model.php b/lib/model.php index 86a5ddf..d4db65f 100644 --- a/lib/model.php +++ b/lib/model.php @@ -6,11 +6,11 @@ class Model var $content_request = null; var $page_request = null; + var $template = 'default.html.tpl'; var $response_format = 'html'; var $response_mime_type = 'text/html'; - var $page_title = null; - var $template = 'default.html.tpl'; + var $page_title = null; var $entries = null; var $config = null; @@ -18,7 +18,8 @@ class Model function __construct( $request ) { $this->request = $request; - list($this->response_format, $this->response_mime_type) = parse_format($this->request['extension'], 'html'); + list($this->response_format, $this->response_mime_type) = parse_format($this->request['extension']); + $this->template = 'default.' . $this->response_format . '.tpl'; $this->parse_request( $this->request ); } @@ -29,14 +30,14 @@ class Model $this->content_request = join(array($this->request['dirname'], $this->request['filename']), DIRECTORY_SEPARATOR ); $this->page_request = $this->request['filename']; + # if entries (dir in CONTENT dir) if ($this->is_multiple()) { # check if config file exists in dir if ($this->has_config()) { $this->config = parse_config( $this->content_request ); - if (isset($this->config['config']['template'])) { + if (isset($this->config['config']['template'])) $this->template = $this->config['config']['template'] . '.' . $this->response_format . '.tpl' ; - } } $this->entries = get_entries( $this->content_request ); $this->page_title = preg_replace('{^/|/$}', '', $this->request['path']); diff --git a/lib/output.php b/lib/output.php index 442d1f9..c40ebe6 100644 --- a/lib/output.php +++ b/lib/output.php @@ -5,7 +5,7 @@ * @param format * @param default format */ -function parse_format($format, $default) +function parse_format($format, $default = 'html') { $types = array('html' => 'text/html', 'php' => 'text/html', @@ -164,7 +164,7 @@ function get_request() $path_info = pathinfo( $path ); $path_info['path'] = preg_match("/\.\.\//", $path) ? '/' : $path; - $path_info['extension'] = null; + $path_info['extension'] = isset($path_info['extension']) ? $path_info['extension'] : 'html'; if ($path_info['dirname'] == '.') $path_info['dirname'] = ''; diff --git a/lib/view.php b/lib/view.php index bbd8e17..a6c8d01 100644 --- a/lib/view.php +++ b/lib/view.php @@ -7,6 +7,7 @@ class View { var $template_dir = 'templates'; // var $template_cache_dir = 'cache'; + var $default_template = 'default'; var $response_format = 'html'; var $response_mime_type = 'text/html'; @@ -42,6 +43,8 @@ class View public function render( $template ) { extract( $this->_tpl_vars ); + if (!is_file($this->template_dir . DIRECTORY_SEPARATOR . $template)) + $template = $default_template . '.' . $response_format . '.tpl'; include( $this->template_dir . DIRECTORY_SEPARATOR . $template ); } diff --git a/pages/about b/pages/about index 76643c4..a5dbc1b 100644 --- a/pages/about +++ b/pages/about @@ -3,13 +3,18 @@ title = about #about -quilime is an ongoing collection of projects, sketches, ideas, and process by **gabriel dunne** ([www](http://gabrieldunne.com), [email](mailto:gdunne@quilime.com)) +quilime.com is a place for my experiments, process. My web portfolio. -quilime.com is built with plog, a static-file `p`roject`log` engine written in PHP. +this site is built with plog, a static-file `p`roject`log` engine written in PHP. +
+## contact +gabriel dunne +[www](http://gabrieldunne.com), [email](mailto:gdunne@quilime.com) +
## related @@ -23,8 +28,3 @@ quilime.com is built with include_template('head-inc.html.tpl') ?> diff --git a/templates/default.json.tpl b/templates/default.json.tpl index 712719b..d3db7e3 100644 --- a/templates/default.json.tpl +++ b/templates/default.json.tpl @@ -1,5 +1,3 @@ { - "entries": , - "count": , - "total": + "entries": } diff --git a/templates/default.rss.tpl b/templates/default.rss.tpl index 21cd06e..2c8cd1a 100644 --- a/templates/default.rss.tpl +++ b/templates/default.rss.tpl @@ -6,15 +6,15 @@ <?=SITE_TITLE?> - + - + <?=$entry['title']?> - - + http:// + http:// diff --git a/templates/entry.html.tpl b/templates/entry.html.tpl index bd253b6..6e5fd00 100644 --- a/templates/entry.html.tpl +++ b/templates/entry.html.tpl @@ -13,7 +13,7 @@ #
in - /tags: ' . implode(', ', $entry['tags']); ?> + /' . implode(', ', $entry['tags']); ?> - -

log

- -
-

more →

- - - -

code

- - -
- -

more →

- - - -

projects

- + + + +

log

+ + + + + +

code

+ -

- -all posts → diff --git a/templates/nav.html.tpl b/templates/nav.html.tpl index 28e773d..f2e1f6c 100644 --- a/templates/nav.html.tpl +++ b/templates/nav.html.tpl @@ -15,6 +15,8 @@
  • photo
  • links
  • + +
  • about