From a1120ab42b1abe822710d82e48ff4902e71d1381 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Sun, 27 Jun 2010 00:07:14 -0700 Subject: [PATCH] major template updates, organization, wip --- README | 0 css/style.css | 25 ++- css/style2.css | 86 ++++++++++ index.php | 53 ++++-- js/prettify/prettify.css | 2 +- lib/data.php | 199 ++++++++++++++-------- lib/init.php | 9 +- lib/output.php | 28 +-- lib/static.php | 89 ---------- lib/template.php | 43 +++++ templates/404.html | 27 --- templates/404.html.tpl | 22 +++ templates/{about.html => about.html.tpl} | 0 templates/agg.html | 149 ---------------- templates/{code.html => code copy 2.html} | 0 templates/code copy.html | 112 ++++++++++++ templates/code.html.tpl | 118 +++++++++++++ templates/entry.html.tpl | 13 ++ templates/footer.html.tpl | 14 ++ templates/head-inc.html.tpl | 23 +++ templates/index.html.tpl | 24 +++ templates/index.json.tpl | 5 + templates/{links.html => links.html.tpl} | 3 +- templates/{log.html => log.html.tpl} | 56 +++--- templates/nav.html | 8 +- 25 files changed, 701 insertions(+), 407 deletions(-) create mode 100644 README create mode 100644 css/style2.css create mode 100644 lib/template.php delete mode 100644 templates/404.html create mode 100644 templates/404.html.tpl rename templates/{about.html => about.html.tpl} (100%) delete mode 100644 templates/agg.html rename templates/{code.html => code copy 2.html} (100%) create mode 100644 templates/code copy.html create mode 100644 templates/code.html.tpl create mode 100644 templates/entry.html.tpl create mode 100644 templates/footer.html.tpl create mode 100644 templates/head-inc.html.tpl create mode 100644 templates/index.html.tpl create mode 100644 templates/index.json.tpl rename templates/{links.html => links.html.tpl} (95%) rename templates/{log.html => log.html.tpl} (64%) diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/css/style.css b/css/style.css index f84fab6..3aff87e 100644 --- a/css/style.css +++ b/css/style.css @@ -1,28 +1,27 @@ body { margin:80px 100px 50px 40px; } -html, body, table { font-family: monaco, monospace; font-size:12px; line-height:1.6em; color:#444; } +html, body, table { font-family: monospace; font-size:12px; line-height:1.6em; color:#666; } - -.nav { position:absolute; z-index:1; top:20px; left:20px; } +.nav { position:absolute; z-index:1; top:20px; left:30px; } .nav ul { margin-left:1em; } .nav h1 { margin-bottom:50px;} -#head { position:absolute; top: 20px; left: 160px;} +#head { position:absolute; top: 20px; left: 160px; } /*selection*/ ::-moz-selection {background: #08f !important; color:#fff;} ::selection {background: #08f !important; color:#fff;} /*links*/ -a { color:#555; border:0; padding:0.2em 0.1em 0 0; font-weight:bold; } +a { color:#000; border:0; padding:0.2em 0.1em 0 0; } a img { border:0; } a.mute { text-decoration:none !important; } -a:hover, a.mute:hover { color:#d15; } +a:hover, a.mute:hover { color:#d15; text-decoration:none; } /*headings*/ -h1, h2, h3, h4, h5, h6 { font-size:1.2em; } +h1, h2, h3, h4, h5, h6 { font-size:1em; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration:none; } -h1 { margin:0 0 3em 0; font-size:2em;} -h2 { margin:4em 0 0.5em 0; } +h1 { margin:0 0 3em 0; } +h2 { margin:0 0 0.5em 0; } h3 { margin:0 0 0 0; } ol li { list-style-type:decimal; } @@ -44,6 +43,8 @@ table .reader li, table .bookmarks li { margin-bottom:1em; padding-bottom:1em; .bookmark_links li span { font-style: italic; color:#444; } .image li a { background:none;} +table.archive td {padding-right:20px; } + .c_pop { position:absolute; background:#fff; display:none; border:5px outset #000; padding:1em 2em; z-index:5; } .func { font-weight:bold; color:#444; } @@ -76,10 +77,8 @@ table .reader li, table .bookmarks li { margin-bottom:1em; padding-bottom:1em; .text { font-family:serif; font-size:15px; line-height:2.2em; margin-top:80px;} .indent { text-indent:3em; } - - - - +.entry { margin-bottom:100px; } +.entry h2 { border-bottom:1px solid #ddd; padding-bottom:4px; } .caption { font-style:italic; margin-top:5px; color:#444; } .more, .home { text-decoration:none; color:#000; font-weight:bold; } diff --git a/css/style2.css b/css/style2.css new file mode 100644 index 0000000..1536ba7 --- /dev/null +++ b/css/style2.css @@ -0,0 +1,86 @@ +body { margin:80px 100px 50px 40px; } +html, body, table { font-family: helvetica; font-size:11px; line-height:1.5em; color:#999; } + +.nav { position:absolute; z-index:1; top:20px; left:20px; line-height:1.3em;} +.nav ul { margin-left:1em; } +.nav h1 { margin-bottom:50px;} + +#head { position:absolute; top: 20px; left: 160px;} + +/*selection*/ +::-moz-selection {background: #08f !important; color:#fff;} +::selection {background: #08f !important; color:#fff;} + +/*links*/ +a { color:#555; border:0; padding:0.2em 0.1em 0.1em 0em; font-weight:bold; text-decoration:none; } +a img { border:0; } +a.mute { } +a:hover, a.mute:hover { color:#d15; border-bottom:2px solid #d15; text-decoration:none; } + +/*headings*/ +h1, h2, h3, h4, h5, h6 { font-size:1.3em; } +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration:none; } +h1 { margin:0 0 3em 0; font-size:2em;} +h2 { margin:4em 0 0.5em 0; } +h3 { margin:0 0 0 0; } + +blockquote { font-family:times; background:#000; color:#aaa; +margin:0; font-size:15px; line-height:1.4em; padding:2em 4em; font-style:italic; line-height:1.45em; max-width:600px;} + +p { max-width:720px; } + +ul, li { margin:0; padding:0; list-style-type:none; } +table { margin:0; padding:0; border:0; } +table .column { padding-right:100px; min-width:120px; max-width:400px; } +table .column h2 a { text-decoration:none; } +table h2, table h3 { margin-bottom:2em;} +table .video li, table .image li { margin-bottom:2em; } +table .reader li, table .bookmarks li { margin-bottom:1em; padding-bottom:1em; border-bottom:1px dotted #ddd; } +.reader_links li, .bookmark_links li { padding-top:.75em; margin-bottom:.75em; } +.bookmark_links li a { display:block; } +.bookmark_links li span { font-style: italic; color:#444; } +.image li a { background:none;} + +.c_pop { position:absolute; background:#fff; display:none; border:5px outset #000; padding:1em 2em; z-index:5; } + +.func { font-weight:bold; color:#444; } + +#home_arrow { position: absolute; top:11px; left:23px; margin-left:250px; text-decoration:none; } + +#content { margin-left:120px; min-width:500px; position:absolute; top:20px; padding-bottom:200px; z-index:10;} + #content p { } + ul.inline_content {} + ul.inline_content li .content { } + ul.inline_content li { margin:0 0 150px 0; } + ul.inline_content li h3 { border-bottom:2px solid #ddd; } + ul.inline_content ol li { margin:0; padding:0; border:0;} + ul.thumbnails { } + ul.thumbnails li { display:inline-block; margin: 0px 60px 60px 0px; } + ul.thumbnails .thumbnail { width:160px; height:120px; text-align:center; background:#888; } + ul.thumbnails a:hover img { + filter:alpha(opacity=75); + -moz-opacity:0.75; + -khtml-opacity: 0.75; + opacity: 0.75; + } + ul.thumbnails a { text-decoration:none; } + ul.thumbnails .title { } + + .date { color:#ccc;} + .func { margin-bottom:2em; } + .func a { background:#daa; padding:0.2em 1em 0.02em 1em; font-size:9px; text-transform:uppercase;} + + .text { font-family:serif; font-size:15px; line-height:2.2em; margin-top:80px;} + .indent { text-indent:3em; } + + + + + + +.caption { font-style:italic; margin-top:5px; color:#444; } +.more, .home { text-decoration:none; color:#000; font-weight:bold; } + +#footer { margin-top:120px; } +#footer .copy a { text-decoration:none; } + diff --git a/index.php b/index.php index 7fee153..7df8b0b 100644 --- a/index.php +++ b/index.php @@ -2,28 +2,57 @@ require_once 'lib/init.php'; - $url_string = get_url_string(); + $url_parts = get_url(); - if (is_string($url_string)) { +// print_r($url_parts); + +// echo "

"; - if ( basename($url_string) == "aggregate") { - header ("Location: http://quilime.com/aggregate/index.php"); - exit; - } - else if (is_file ( TEMPLATE_DIR . basename($url_string) . '.html' )) { - include ( TEMPLATE_DIR . basename($url_string) . '.html' ); + list($response_format, $response_mime_type) = parse_format($url_parts['extension'], 'html'); + + $t = get_template_instance(); + + $view = isset($_GET['v']) ? $_GET['v'] : 'inline'; + + if (is_string($url_parts['basename'])) + { + + # base content folder + if (is_dir ( CONTENT_DIR . DIRECTORY_SEPARATOR . $url_parts['basename'])) { + + list($items, $total) = get_data(array($url_parts['basename'])); + $t->assign('items', $items); + $t->assign('total', $total); + $t->assign('view', $view); + $t->render($url_parts['basename'] . '.' . $response_format . '.tpl'); exit; } - else if (dirname($url_string) != '.' && is_dir(CONTENT_DIR . dirname($url_string))) { - include( TEMPLATE_DIR . dirname($url_string) . '.html' ); + + # single entry + else if ($url_parts['dirname'] != '.' && is_dir(CONTENT_DIR . $url_parts['dirname'])) { + + $t->assign('single', true); + $t->assign('item', parse_config(CONTENT_DIR . $url_parts['dirname'] . DIRECTORY_SEPARATOR . $url_parts['filename'])); + $t->assign('content', $url_parts['dirname'] . DIRECTORY_SEPARATOR . $url_parts['filename']); + + $t->render($url_parts['dirname'] . '.' . $response_format . '.tpl'); exit; } + + # not found else { - include( TEMPLATE_DIR . '404.html' ); + $t->render('404.'.$response_format.'.tpl'); exit; } + } - include ( TEMPLATE_DIR . 'index.html' ); + + # render all entries inline + list($entries, $total) = get_inline_entries(array('log', 'code')); + + $t->assign('entries', $entries); + $t->assign('total', $total); + $t->render('index.'.$response_format.'.tpl'); ?> diff --git a/js/prettify/prettify.css b/js/prettify/prettify.css index f38550c..90200e1 100755 --- a/js/prettify/prettify.css +++ b/js/prettify/prettify.css @@ -11,7 +11,7 @@ .atn { color: #606; } .atv { color: #080; } .dec { color: #606; } -pre.prettyprint, code.prettyprint { font-family:monaco, "Lucida Console", monospace; font-size:12px; line-height:2em; padding:0.4em 0.6em; background:#322323; +pre.prettyprint, code.prettyprint { font-family:monaco, "Lucida Console", monospace; font-size:12px; line-height:2em; padding:0.4em 0.6em; background:#222333; -moz-border-radius: 8px; -webkit-border-radius: 8px; } diff --git a/lib/data.php b/lib/data.php index df82852..20ecec1 100644 --- a/lib/data.php +++ b/lib/data.php @@ -1,95 +1,150 @@ ' . $l['title'] . ''; - } - return join("\n", $ret); + +# parse inline content +function get_data( $sources, $params = array() ) +{ + $result = array(); + $result_total = 0; + foreach ($sources as $dir) { + $contents = glob(LOCAL_ROOT . CONTENT_DIR . DIRECTORY_SEPARATOR . $dir . '/*'); + foreach ($contents as $f) { + if (!is_dir($f)) { + + if ($params['name']) { + if (basename($f) != $params['name']) + continue; + } + + $file_contents = explode("\n", file_get_contents($f, FILE_USE_INCLUDE_PATH)); + $cc = ""; + $content = ""; + $conf = true; + foreach ( $file_contents as $fc ) { + if ($fc == CONFIG_DELIMITER) { + $conf = false; + continue; + } + if ($conf) $cc .= $fc . "\n"; + else $content .= $fc . "\n"; + } + + $config = parse_ini_string($cc); + + $config['url'] = WEB_ROOT . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . basename($f); + $config['timestamp'] = mktime($config['date']); + $config['category'] = $dir; + $config['content'] = $content; + $config['tags'] = explode(' ', $config['tags']); + + $result[] = $config; + $result_total++; + } + } + } + + // order by date + foreach ($result as $key => $row) { + $time[$key] = $row['date']; + } + array_multisort($time, SORT_DESC, $result); + + return array($result, $result_total); +} + + + + +function list_content($path, $args="") +{ + list($list, $total) = get_content($path, $args); + $ret = array(); + foreach($list as $l) { + $ret[] = '
  • ' . $l['title'] . '
  • '; } + return join("\n", $ret); +} - function get_content ($path, $args="") - { - parse_str($args, $args); - - $type = isset($args['type']) ? $args['type'] : 'folder'; - $config = $type == 'folder' ? $c . '/config' : $c; - - $content = array(); - $glob = glob( CONTENT_DIR . $path . '/*' ); +function get_content ($path, $args="") +{ + parse_str($args, $args); + + $type = isset($args['type']) ? $args['type'] : 'folder'; + $config = $type == 'folder' ? $c . '/config' : $c; + + $content = array(); + $glob = glob( CONTENT_DIR . $path . '/*' ); - - foreach ($glob as $c) { - if (is_file($c . $config) || is_dir($c . $config)) { - $config_array = parse_config($c . $config); - if ($config_array['title'] && $config_array['hide'] != "true") { - $content[] = $config_array; - } + + foreach ($glob as $c) { + if (is_file($c . $config) || is_dir($c . $config)) { + $config_array = parse_config($c . $config); + if ($config_array['title'] && $config_array['hide'] != "true") { + $content[] = $config_array; } } - return array(array_reverse($content), count($content)); } + return array(array_reverse($content), count($content)); +} - function parse_config ($config_file) - { - $config = array(); - - $config_settings = explode("\n", file_get_contents( $config_file , FILE_USE_INCLUDE_PATH )); +function parse_config ($config_file) +{ + $config = array(); + + $config_settings = explode("\n", file_get_contents( $config_file , FILE_USE_INCLUDE_PATH )); - $break = false; - foreach ( $config_settings as $c ) - { - if ($c == '--') { - $break = true; - $config['inline_content'] = ""; - continue; - } - - if ($break) { - $config['inline_content'] .= $c; - } - else { - $conf = explode("=", $c); - $config[trim($conf[0])] = trim($conf[1]); - } + $break = false; + foreach ( $config_settings as $c ) + { + if ($c == '--') { + $break = true; + $config['inline_content'] = ""; + continue; } - if ($config['thumb'] && is_file( dirname($config_file) . '/' . $config['thumb'] )) { - $config['thumb'] = get_base_dir() . '/' . dirname($config_file) . '/' . $config['thumb']; - } - else if (is_file(get_base_dir() . '/' . dirname($config_file) . '/thumb.png')) { - $config['thumb'] = get_base_dir() . '/' . dirname($config_file) . '/thumb.png'; + if ($break) { + $config['inline_content'] .= $c; } - - $config['timestamp'] = strtotime($config['date']); + else { + $conf = explode("=", $c); + $config[trim($conf[0])] = trim($conf[1]); + } + } + + if ($config['thumb'] && is_file( dirname($config_file) . '/' . $config['thumb'] )) { + $config['thumb'] = get_base_dir() . '/' . dirname($config_file) . '/' . $config['thumb']; + } + else if (is_file(get_base_dir() . '/' . dirname($config_file) . '/thumb.png')) { + $config['thumb'] = get_base_dir() . '/' . dirname($config_file) . '/thumb.png'; + } + + $config['timestamp'] = strtotime($config['date']); - $config['content'] = is_file( dirname($config_file) . '/' . $config['content'] ) ? - dirname($config_file) . '/' . $config['content'] : - dirname($config_file) . '/content.html'; + $config['content'] = is_file( dirname($config_file) . '/' . $config['content'] ) ? + dirname($config_file) . '/' . $config['content'] : + dirname($config_file) . '/content.html'; - $config['href'] = basename($config_file) == 'config' ? - get_base_dir() . '/' . str_replace(CONTENT_DIR, "", dirname($config_file)) : - get_base_dir() . '/' . str_replace(CONTENT_DIR, "", $config_file); - - $config['base_dir'] = get_base_dir() . '/' . CONTENT_DIR . $config['href']; - - return $config; - } + $config['href'] = basename($config_file) == 'config' ? + get_base_dir() . '/' . str_replace(CONTENT_DIR, "", dirname($config_file)) : + get_base_dir() . '/' . str_replace(CONTENT_DIR, "", $config_file); + + $config['base_dir'] = get_base_dir() . '/' . CONTENT_DIR . $config['href']; + + return $config; +} - function define_constants($constants = 'config') - { - $config = explode("\n", file_get_contents( $constants , FILE_USE_INCLUDE_PATH )); - foreach($config as $c) { - $var = explode("=", $c); - define(trim($var[0]), trim($var[1])); - } - } +function define_constants($constants = 'config') +{ + $config = explode("\n", file_get_contents( $constants , FILE_USE_INCLUDE_PATH )); + foreach($config as $c) { + $var = explode("=", $c); + define(trim($var[0]), trim($var[1])); + } +} diff --git a/lib/init.php b/lib/init.php index 7807a17..a90c832 100644 --- a/lib/init.php +++ b/lib/init.php @@ -6,14 +6,15 @@ define ('SITE_TITLE', 'quilime'); define ('LOCAL_ROOT', '/home/quilime/quilime.com/'); - define('WEB_ROOT', 'http://quilime.com/'); - define ('CONTENT_DIR', 'content/'); - define ('TEMPLATE_DIR', 'templates/'); + define('WEB_ROOT', 'http://quilime.com'); + define ('CONTENT_DIR', 'content'); + define ('TEMPLATE_DIR', 'templates'); define ('CONFIG_DELIMITER', '--'); require_once 'data.php'; require_once 'output.php'; - + require_once 'template.php'; + define_constants(); ?> \ No newline at end of file diff --git a/lib/output.php b/lib/output.php index 386713e..112c083 100644 --- a/lib/output.php +++ b/lib/output.php @@ -1,6 +1,14 @@ template_dir = join(DIRECTORY_SEPARATOR, array(dirname(__FILE__), '..', 'templates')); + return $t; + } + + /** * @param string $format "text", "xml", etc. * @param string $default Default format @@ -42,18 +50,18 @@ return $array; } } + + + function get_url_parts() + { + $parts = explode('/', substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/'))); + return $parts[0] ? $parts : 0; + } + - - function get_url_parts() - { - $parts = explode('/', substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/'))); - return $parts[0] ? $parts : 0; - } - - - function get_url_string() + function get_url() { - return substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/')); + return pathinfo($_SERVER['SCRIPT_URL']); //substr($_SERVER['SCRIPT_URL'], strlen(get_base_dir() . '/')); } diff --git a/lib/static.php b/lib/static.php index efb18fa..ea0082e 100644 --- a/lib/static.php +++ b/lib/static.php @@ -11,96 +11,7 @@ } echo ''; - - # parse inline content - function get_inline_entries( $sources ) - { - $result = array(); - $result_total = 0; - foreach ($sources as $dir) { - $contents = glob(LOCAL_ROOT . CONTENT_DIR . $dir . '/*'); - foreach ($contents as $f) { - if (!is_dir($f)) { - $file_contents = explode("\n", file_get_contents($f, FILE_USE_INCLUDE_PATH)); - $cc = ""; - $content = ""; - $conf = true; - foreach ( $file_contents as $fc ) { - if ($fc == CONFIG_DELIMITER) { - $conf = false; - continue; - } - if ($conf) $cc .= $fc . "\n"; - else $content .= $fc . "\n"; - } - $config = parse_ini_string($cc); - - $config['url'] = WEB_ROOT . $dir . DIRECTORY_SEPARATOR . basename($f); - $config['timestamp'] = mktime($config['date']); - $config['category'] = $dir; - $config['content'] = $content; - $config['tags'] = explode(' ', $config['tags']); - - $result[] = $config; - $result_total++; - } - } - } - // order by date - foreach ($result as $key => $row) { - $time[$key] = $row['date']; - } - array_multisort($time, SORT_DESC, $result); - - return array($result, $result_total); - } - - - - $files = glob('../content/log/*'); - - $result = array(); - $result['count'] = 0; - foreach ($files as $f) - { - if (!is_dir($f)) { - - $config_settings = explode("\n", file_get_contents($f, FILE_USE_INCLUDE_PATH)); - - $cc = ""; - $content = ""; - $past_conf = false; - foreach ( $config_settings as $c ) { - if ($c == CONFIG_DELIMITER) { - $past_conf = true; - continue; - } - if ($past_conf) $content .= $c . "\n"; - else $cc .= $c . "\n"; - } - $config = parse_ini_string($cc); - $config['content'] = $content; - - if ($config['hide'] == 'true') - continue; - - $result['count'] += 1; - $result['entries'][] = $config; - -// print_r($cc); -// echo "content: " . $content; - -// echo $config; -// echo "\n"; - } - } - -// echo json_encode($result); - -// print_r($entries); - - diff --git a/lib/template.php b/lib/template.php new file mode 100644 index 0000000..5be035b --- /dev/null +++ b/lib/template.php @@ -0,0 +1,43 @@ + $val) + if ($key != '') + $this->_tpl_vars[$key] = $val; + } else { + if ($tpl_var != '') + $this->_tpl_vars[$tpl_var] = $value; + } + } + + + public function include_template ($template, $vars = array()) + { + $this->_tpl_vars = array_merge($this->_tpl_vars, $vars); + $this->render($template); + } + + + public function render( $template ) + { + extract( $this->_tpl_vars ); + include( $this->template_dir . DIRECTORY_SEPARATOR . $template ); + } +} + +?> \ No newline at end of file diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index 6cf670a..0000000 --- a/templates/404.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - <?php echo SITE_TITLE; ?> :404 - - - - - - - -
    - -

    oops

    - -

    - 404 -

    - -
    - - - - \ No newline at end of file diff --git a/templates/404.html.tpl b/templates/404.html.tpl new file mode 100644 index 0000000..ac9a892 --- /dev/null +++ b/templates/404.html.tpl @@ -0,0 +1,22 @@ + + + + include_template('head-inc.html.tpl'); ?> + + <?=SITE_TITLE?> + + + + + include_template('nav.html'); ?> + +
    + + oops. 404. + +
    + + include_template('footer.html.tpl'); ?> + + + diff --git a/templates/about.html b/templates/about.html.tpl similarity index 100% rename from templates/about.html rename to templates/about.html.tpl diff --git a/templates/agg.html b/templates/agg.html deleted file mode 100644 index a00a0c2..0000000 --- a/templates/agg.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - <?php echo SITE_TITLE; ?> - aggregate - - - - - - - - - -
    - - - - - - - - -

    video

    - -

    - more → -

    - -*/ ?> - - - - - - - - - -

    reader

    - -

    - more → -

    - - - */ - ?> - - - - -
    - -

    image aggregate

    -
      - - channel->item as $item) : - if ($count-- == 0) break; - ?> -
    • - - - -
    • - -
    -

    - more → -

    - -
    - -

    bookmarks

    -
      - post as $d) : ?> -
    • - -
      - - -
    • - -
    -

    - more → -

    -
    - -
    - - - - - \ No newline at end of file diff --git a/templates/code.html b/templates/code copy 2.html similarity index 100% rename from templates/code.html rename to templates/code copy 2.html diff --git a/templates/code copy.html b/templates/code copy.html new file mode 100644 index 0000000..63aa896 --- /dev/null +++ b/templates/code copy.html @@ -0,0 +1,112 @@ + + + + + + + + <?php echo SITE_TITLE; ?> - code<?php if (sizeof($items) > 0 ) : ?>: <?echo strtolower($items['title']); ?> [<?php echo $items['medium']; ?>]<?php endif; ?> + + + + + + + + + +
    + + + + +
    + +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    languagename
    + + + + + +
    + +
    +
    + + + +
    + + + + \ No newline at end of file diff --git a/templates/code.html.tpl b/templates/code.html.tpl new file mode 100644 index 0000000..2502d79 --- /dev/null +++ b/templates/code.html.tpl @@ -0,0 +1,118 @@ +basename($url_string))); + $items = $items[0]; + $single = true; + } + + $inline = isset($_GET['inline']) ? true : false; + + $page = "code"; + + +?> + + + + + + + <?php echo SITE_TITLE; ?> - code<?php if (sizeof($items) > 0 ) : ?>: <?echo strtolower($items['title']); ?> [<?php echo $items['medium']; ?>]<?php endif; ?> + + + + + + + +
    + + + +

    []

    + +
    + +
    + + + + + + + +
    + + + + + +

    code

    + + + + + + + + + + + + + + + + +
    languagename
    + + + +
    + +
    +
    + + + +
    + + + + \ No newline at end of file diff --git a/templates/entry.html.tpl b/templates/entry.html.tpl new file mode 100644 index 0000000..d60ee65 --- /dev/null +++ b/templates/entry.html.tpl @@ -0,0 +1,13 @@ + +
    + +

    + +

    + +
    + + + +
    +
    diff --git a/templates/footer.html.tpl b/templates/footer.html.tpl new file mode 100644 index 0000000..bb41cff --- /dev/null +++ b/templates/footer.html.tpl @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/templates/head-inc.html.tpl b/templates/head-inc.html.tpl new file mode 100644 index 0000000..5904973 --- /dev/null +++ b/templates/head-inc.html.tpl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/index.html.tpl b/templates/index.html.tpl new file mode 100644 index 0000000..0342c64 --- /dev/null +++ b/templates/index.html.tpl @@ -0,0 +1,24 @@ + + + + include_template('head-inc.html.tpl') ?> + + <?=SITE_TITLE?> + + + + + include_template('nav.html') ?> + +
    + + + include_template('entry.html.tpl', array('entry' => $entry)); ?> + + +
    + + include_template('footer.html.tpl') ?> + + + diff --git a/templates/index.json.tpl b/templates/index.json.tpl new file mode 100644 index 0000000..712719b --- /dev/null +++ b/templates/index.json.tpl @@ -0,0 +1,5 @@ +{ + "entries": , + "count": , + "total": +} diff --git a/templates/links.html b/templates/links.html.tpl similarity index 95% rename from templates/links.html rename to templates/links.html.tpl index 55a769d..ef7e0dd 100644 --- a/templates/links.html +++ b/templates/links.html.tpl @@ -25,7 +25,7 @@ function linklist($links) { ?> -
  • +
  • - + include_template('head-inc.html.tpl') ?> - <?php echo SITE_TITLE; ?><?php if ($single) : ?> - log: <?echo strtolower($log['title']); ?> [<?php echo date("Y M d", strtotime($log['date']));?>]<? else: ?> - log<? endif; ?> - - + + + - log: + [] + + - log + + @@ -34,25 +41,23 @@ - -
    -

    - - - [] -

    +

    + + + [] +

    - +
    - + @@ -63,7 +68,7 @@ @@ -95,20 +97,22 @@
    - view archive + view archive diff --git a/templates/nav.html b/templates/nav.html index 57688ba..3bb026a 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,8 +1,10 @@ -- 2.34.1
    @@ -74,10 +79,7 @@
    - +