├── site ├── cache │ └── index.html ├── plugins │ ├── index.html │ ├── tagcloud.php │ └── search.php ├── panel │ └── blueprints │ │ ├── feed.php │ │ ├── xmlsitemap.php │ │ ├── error.php │ │ ├── search.php │ │ ├── articles.php │ │ ├── default.php │ │ └── article.php ├── snippets │ ├── share.php │ ├── navigation.php │ ├── pagination.php │ ├── footer.php │ ├── disqus.php │ ├── feed.php │ └── header.php ├── templates │ ├── default.php │ ├── error.php │ ├── feed.php │ ├── xmlsitemap.php │ ├── article.php │ ├── articles.php │ └── search.php └── config │ └── config.php ├── content ├── sitemap │ └── xmlsitemap.txt ├── feed │ └── feed.txt ├── error │ └── error.txt ├── 03-search │ └── search.txt ├── 01-articles │ ├── articles.txt │ ├── 02-an-article-with-images │ │ └── article.txt │ ├── 03-an-article-with-videos │ │ └── article.txt │ └── 01-an-article-with-text │ │ └── article.txt ├── .htaccess ├── site.txt └── 02-home │ └── home.txt ├── assets ├── images │ └── icons │ │ ├── favicon.ico │ │ ├── iOS │ │ ├── apple-touch-icon-72x72.png │ │ └── apple-touch-icon-114x114.png │ │ └── facebook │ │ └── facebook-icon-646x1027.jpg ├── js │ ├── tinynav.js │ └── jquery-1.7.1.min.js └── css │ ├── 1236_grid.css │ ├── 986_grid.css │ ├── 720_grid.css │ └── base.css ├── robots.txt ├── humans.txt ├── index.php ├── README.md └── .htaccess /site/cache/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/plugins/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/sitemap/xmlsitemap.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/feed/feed.txt: -------------------------------------------------------------------------------- 1 | Title: Your Feed Title -------------------------------------------------------------------------------- /content/error/error.txt: -------------------------------------------------------------------------------- 1 | Title: Oops, Not Found! 2 | ---- 3 | Description: Error 404 - Not Found. 4 | -------------------------------------------------------------------------------- /content/03-search/search.txt: -------------------------------------------------------------------------------- 1 | Title: Search 2 | ---- 3 | Description: A short description text for your meta tags. -------------------------------------------------------------------------------- /content/01-articles/articles.txt: -------------------------------------------------------------------------------- 1 | Title: Articles 2 | ---- 3 | Description: A short description text for your meta tags. -------------------------------------------------------------------------------- /assets/images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklausgerber/monochrome/HEAD/assets/images/icons/favicon.ico -------------------------------------------------------------------------------- /content/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | RewriteEngine on 4 | RewriteRule \.txt$ /nirvana [R=301,L] 5 | 6 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-Agent: * 5 | Allow: / 6 | 7 | -------------------------------------------------------------------------------- /assets/images/icons/iOS/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklausgerber/monochrome/HEAD/assets/images/icons/iOS/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /assets/images/icons/iOS/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklausgerber/monochrome/HEAD/assets/images/icons/iOS/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /assets/images/icons/facebook/facebook-icon-646x1027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niklausgerber/monochrome/HEAD/assets/images/icons/facebook/facebook-icon-646x1027.jpg -------------------------------------------------------------------------------- /site/panel/blueprints/feed.php: -------------------------------------------------------------------------------- 1 | # Blueprints for the feed 2 | 3 | title: Error page 4 | files: false 5 | fields: 6 | title: 7 | label: title 8 | type: text 9 | help: The title of your feed. 10 | required: true -------------------------------------------------------------------------------- /site/panel/blueprints/xmlsitemap.php: -------------------------------------------------------------------------------- 1 | # Blueprints for your sitemap 2 | 3 | title: Sitemap 4 | files: false 5 | fields: 6 | title: 7 | label: title 8 | type: text 9 | help: DO NOT CHANGE! 10 | required: true -------------------------------------------------------------------------------- /site/snippets/share.php: -------------------------------------------------------------------------------- 1 |
2 |   Tweet -------------------------------------------------------------------------------- /site/snippets/navigation.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /site/templates/default.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 |
9 | text()) ?> 10 |
11 |
12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /content/site.txt: -------------------------------------------------------------------------------- 1 | Title: Your Page Title 2 | ---- 3 | Author: First & Last Name | http://yourdomain.com (for meta tags) 4 | ---- 5 | Copyright: © 2011-2012 Your Name, all rights reserved. 6 | ---- 7 | Googleauthor: First & Last Name (for Google+ and Google Search) 8 | ---- 9 | Twitter: username (your Twitter username without the @ for social sharing) -------------------------------------------------------------------------------- /site/snippets/pagination.php: -------------------------------------------------------------------------------- 1 | hasPrevPage()): ?> 2 | « Previous 3 | 4 | 5 | hasPrevPage() && $pagination->hasNextPage()): ?> 6 | | 7 | 8 | 9 | hasNextPage()): ?> 10 | Next » 11 | -------------------------------------------------------------------------------- /site/panel/blueprints/error.php: -------------------------------------------------------------------------------- 1 | # Blueprints for the error page 2 | 3 | title: Error page 4 | files: false 5 | fields: 6 | title: 7 | label: title 8 | type: text 9 | help: The title of the error page. 10 | required: true 11 | description: 12 | label: description 13 | type: textarea 14 | size: small 15 | help: The description of the error page. 16 | required: true 17 | -------------------------------------------------------------------------------- /site/panel/blueprints/search.php: -------------------------------------------------------------------------------- 1 | # Blueprints for the search page 2 | 3 | title: Search page 4 | files: false 5 | fields: 6 | title: 7 | label: title 8 | type: text 9 | help: The title of the search page. 10 | required: true 11 | description: 12 | label: description 13 | type: textarea 14 | size: small 15 | help: The description of the search page. 16 | required: true 17 | -------------------------------------------------------------------------------- /site/templates/error.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 |
9 |

title()) ?>

10 |

The requested page could not be found. If you're really lost, try searching for something.

11 |
12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /site/panel/blueprints/articles.php: -------------------------------------------------------------------------------- 1 | # Blueprints for the articles overview page 2 | 3 | title: Articles overview page 4 | pages: true 5 | template: article 6 | sort: flip 7 | limit: 10 8 | files: false 9 | fields: 10 | title: 11 | label: title 12 | type: text 13 | help: The title of the articles overview page. 14 | required: true 15 | description: 16 | label: description 17 | type: textarea 18 | size: small 19 | help: The description of the articles overview page. 20 | required: true 21 | -------------------------------------------------------------------------------- /site/templates/feed.php: -------------------------------------------------------------------------------- 1 | find('articles')->children()->visible()->flip()->limit(10); 7 | 8 | // this is how you embed the feed snippet with some options 9 | snippet('feed', array( 10 | 'link' => url('articles'), 11 | 'items' => $items, 12 | 'descriptionField' => 'text', 13 | 'descriptionLength' => 300 14 | )); 15 | 16 | ?> 17 | -------------------------------------------------------------------------------- /assets/js/tinynav.js: -------------------------------------------------------------------------------- 1 | /*! http://tinynav.viljamis.com v1.03 by @viljamis */ 2 | (function(a,i,g){a.fn.tinyNav=function(j){var c=a.extend({active:"selected",header:!1},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,e=".l_"+d,b=a("
31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 |
39 |

title() ?>

40 |

41 | description() ?> text(), 300) ?> [...] Read more. 42 |

43 |
44 |
45 | 46 |
47 |
48 | $results->pagination())) ?> 49 |
50 |
51 | query()): ?> 52 |
53 |
54 |

No posts found matching «query()) ?>».

55 |

Your search for query()) ?> returned no results.

56 |
57 |
58 | 59 |
60 |
61 |

Tags

62 |

63 | 64 | #name() ?> 65 | 66 |

67 |
68 |
69 | 70 | 71 | -------------------------------------------------------------------------------- /site/snippets/feed.php: -------------------------------------------------------------------------------- 1 | '; 11 | 12 | ?> 13 | 14 | 15 | 16 | 17 | 18 | <?php echo (isset($title)) ? xml($title) : xml($page->title()) ?> 19 | 20 | 21 | modified()) ?> 22 | 23 | 24 | description() || isset($description)): ?> 25 | description()) ?> 26 | 27 | 28 | 29 | 30 | <?php echo xml($item->title()) ?> 31 | url()) ?> 32 | url()) ?> 33 | date()) ? date('r', $item->date()) : date('r', $item->modified()) ?> 34 | 35 | 36 | 37 | {$descriptionField}) ?>]]> 38 | 39 | {$descriptionField}, (isset($descriptionLength)) ? $descriptionLength : 140) ?>]]> 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/css/720_grid.css: -------------------------------------------------------------------------------- 1 | /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid) 2 | * http://simplegrid.info 3 | * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com) 4 | * License: http://creativecommons.org/licenses/MIT/ */ 5 | 6 | /* Containers */ 7 | body { font-size: 112.5%; padding: 0; } 8 | .grid{ margin:0 auto; padding: 0 10px; width:700px; } 9 | .row{ clear:left; } 10 | 11 | /* Slots Setup */ 12 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:20px; } 13 | 14 | /* 6-Col Grid Sizes */ 15 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:100px; } /* Sixths */ 16 | .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:220px; } /* Thirds */ 17 | .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:460px; } /* Two-Thirds */ 18 | .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:580px; } /* Five-Sixths */ 19 | 20 | /* 4-Col Grid Sizes */ 21 | .slot-6,.slot-7,.slot-8,.slot-9{ width:160px; } /* Quarters */ 22 | .slot-6-7-8,.slot-7-8-9{ width:520px; } /* Three-Quarters */ 23 | 24 | /* 6-Col/4-Col Shared Grid Sizes */ 25 | .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:340px; } /* Halves */ 26 | .slot-0-1-2-3-4-5, .slot-6-7-8-9{ width: 100%; } /* Full-Width */ 27 | 28 | /* Zeroing Out Leftmost Slot Margins */ 29 | .slot-0,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-6,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-1 .slot-1,.slot-1-2 .slot-1,.slot-1-2 .slot-1-2,.slot-1-2-3 .slot-1,.slot-1-2-3 .slot-1-2,.slot-1-2-3 .slot-1-2-3,.slot-1-2-3-4 .slot-1,.slot-1-2-3-4 .slot-1-2,.slot-1-2-3-4 .slot-1-2-3,.slot-1-2-3-4 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1,.slot-1-2-3-4-5 .slot-1-2,.slot-1-2-3-4-5 .slot-1-2-3,.slot-1-2-3-4-5 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1-2-3-4-5,.slot-2 .slot-2,.slot-2-3 .slot-2,.slot-2-3 .slot-2-3,.slot-2-3-4 .slot-2,.slot-2-3-4 .slot-2-3,.slot-2-3-4 .slot-2-3-4,.slot-2-3-4-5 .slot-2,.slot-2-3-4-5 .slot-2-3,.slot-2-3-4-5 .slot-2-3-4,.slot-2-3-4-5 .slot-2-3-4-5,.slot-3 .slot-3,.slot-3-4 .slot-3,.slot-3-4 .slot-3-4,.slot-3-4-5 .slot-3,.slot-3-4-5 .slot-3-4,.slot-3-4-5 .slot-3-4-5,.slot-4 .slot-4,.slot-4-5 .slot-4,.slot-4-5 .slot-4-5,.slot-5 .slot-5,.slot-7 .slot-7,.slot-7-8 .slot-7,.slot-7-8 .slot-7-8,.slot-7-8-9 .slot-7,.slot-7-8-9 .slot-7-8,.slot-7-8-9 .slot-7-8-9,.slot-8 .slot-8,.slot-8-9 .slot-8,.slot-8-9 .slot-8-9{ margin-left:0 !important; } /* Important is to avoid repeating this in larger screen css files */ 30 | 31 | /* Row Clearfix */ 32 | .row:after{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; } 33 | .row{ zoom:1; } -------------------------------------------------------------------------------- /site/snippets/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <?php echo html($page->title()) ?> | <?php echo html($site->title()) ?> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /content/01-articles/01-an-article-with-text/article.txt: -------------------------------------------------------------------------------- 1 | Title: An article with text 2 | ---- 3 | Description: An article with text. 4 | ---- 5 | Published: 01 July 2012 6 | ---- 7 | Tags: Text, Article 8 | ---- 9 | Text: 10 | 11 | **Lorem** ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 12 | 13 | ## H2 Headline 14 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 15 | 16 | Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. 17 | 18 | Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 19 | 20 | ### H3 Headline 21 | Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. 22 | 23 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 24 | 25 | - List Item 26 | - List Item 27 | - List Item 28 | 29 | (link: http://domain.com text: Open link in new window popup: yes) 30 | (link: http://domain.com text: Open link in same window) -------------------------------------------------------------------------------- /site/plugins/search.php: -------------------------------------------------------------------------------- 1 | fields = a::get($options, 'fields', array()); 51 | $this->score = a::get($options, 'score', array()); 52 | $this->words = a::get($options, 'words'); 53 | $this->ignore = a::get($options, 'ignore', array()); 54 | $this->in = a::get($options, 'in'); 55 | $this->minlength = a::get($options, 'minlength', false); 56 | $this->stopwords = a::get($options, 'stopwords', array()); 57 | $this->query = a::get($options, 'query', false); 58 | $this->searchfield = a::get($options, 'searchfield', false); 59 | $this->paginate = a::get($options, 'paginate', false); 60 | $this->mode = str::lower(a::get($options, 'mode')) == 'and' ? 'and' : 'or'; 61 | 62 | $result = array(); 63 | 64 | // if you set a searchfield instead of a query 65 | // the query will automatically be fetched from 66 | // post or get requests 67 | if($this->searchfield) { 68 | $this->query = trim(urldecode(get($this->searchfield))); 69 | } 70 | 71 | // stop here if no searchword is found 72 | if(empty($this->query)) return false; 73 | 74 | $this->searchwords = preg_replace('/[^\pL]/u',',', preg_quote($this->query)); 75 | $this->searchwords = str::split($this->searchwords, ',', $this->minlength); 76 | 77 | if(!empty($this->stopwords)) { 78 | $this->searchwords = array_diff($this->searchwords, $this->stopwords); 79 | } 80 | 81 | if(empty($this->searchwords)) return false; 82 | 83 | // do this to save the count function for all loops 84 | $countSearchwords = count($this->searchwords); 85 | 86 | // define the set of pages to search in 87 | $pages = ($this->in) ? $site->pages()->find($this->in)->children()->index() : $site->pages()->index(); 88 | 89 | foreach($pages as $page) { 90 | 91 | if(in_array($page->uri(), $this->ignore)) continue; 92 | 93 | if(!empty($this->fields)) { 94 | $keys = array_intersect(array_keys($page->content->variables), $this->fields); 95 | } else if($page->content) { 96 | $keys = array_keys($page->content->variables); 97 | } 98 | 99 | $found = array(); 100 | $matchedTotal = 0; 101 | $score = 0; 102 | 103 | foreach($keys as $field) { 104 | $value = $page->$field; 105 | 106 | $matchedPerField = 0; 107 | $matchedWords = 0; 108 | $fieldScore = a::get($this->score, $field, 1); 109 | 110 | foreach($this->searchwords as $s) { 111 | 112 | // only match words 113 | if($this->words) { 114 | $m = @preg_match_all('!\b' . $s . '\b!i', $value, $array); 115 | } else { 116 | $m = @preg_match_all('!' . $s . '!i', $value, $array); 117 | } 118 | 119 | // track matched search words 120 | if($m) $matchedWords++; 121 | 122 | // add the matches to the page 123 | $matchedPerField = $matchedPerField+$m; 124 | 125 | } 126 | 127 | if( 128 | $this->mode == 'and' && $countSearchwords == $matchedWords && $matchedPerField > 0 || 129 | $this->mode == 'or' && $matchedPerField > 0 130 | ) { 131 | // add the number of hits; 132 | $matchedTotal = $matchedTotal+$matchedPerField; 133 | 134 | // apply the score for this field 135 | $score = $score+($matchedPerField*$fieldScore); 136 | } 137 | 138 | } 139 | 140 | // add all matched pages to the result set 141 | if($matchedTotal) { 142 | $result[$page->uid] = $page; 143 | $result[$page->uid]->searchHits = $matchedTotal; 144 | $result[$page->uid]->searchScore = $score; 145 | } 146 | 147 | } 148 | 149 | if(empty($result)) return false; 150 | 151 | $pages = new pages($result); 152 | $pages = $pages->sortBy('searchScore','desc'); 153 | 154 | // add pagination 155 | if($this->paginate) $pages = $pages->paginate($this->paginate, array('mode' => 'query')); 156 | 157 | $this->results = $pages; 158 | 159 | } 160 | 161 | function results() { 162 | return $this->results; 163 | } 164 | 165 | function query() { 166 | return $this->query; 167 | } 168 | 169 | } 170 | 171 | ?> -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # monochrome | A fully responsive Kirby CMS theme 2 | monochrome is an open source theme for [Kirby CMS](http://getkirby.com). It is fully responsive, free and you can use it out of the box. Test the live demo [here](http://monochrome.niklausgerber.com). 3 | 4 | ## Features 5 | - Clean PHP, HTML and CSS theme for Kirby CMS 6 | - Fully responsive 7 | - Works on any modern web browser 8 | - Prepared for SEO 9 | - Beautiful typography designed for perfect readability on any device 10 | - Non cluttered minimal design which guarantees lightning fast page loading speed 11 | - Can be set up to your needs in less then 10 minutes 12 | - Oh and it is free 13 | 14 | ## Kirby CMS 15 | Kirby is a file-based CMS. Easy to setup, easy to use, flexible as hell. You will need to download Kirby and install it on your server. Once you are set you can start with the installation of monochrome. [You are free to use and modify this theme, but you must purchase a Kirby license if you want to use it in production](http://getkirby.com/buy). 16 | 17 | ## Step one | Installation 18 | [Download the monochrome theme from GitHub](https://github.com/niklausgerber/monochrome/zipball/master). Delete the content of those three folders of your Kirby installation. 19 | 20 | - /assets 21 | - /content 22 | - /site 23 | 24 | Drag the monochrome theme with all its files to your kirby installation and replace existing files with them. Make sure you also copy the .htaccess files. If you now upload your kirby installation to your server the monochrome theme should be up and running. 25 | 26 | ## Step two | Configuration 27 | I will quickly guide you through the different folders and explain you which settings you will have to change and which settings need optional modification. 28 | 29 | ### /assets/css 30 | The CSS files are all set up for the beautiful monochrome theme. If you want to change the appearance of the theme you will find all important CSS styles in the base.css. 31 | 32 | ### /assets/images/icons/facebook 33 | Replace this image with a 646 × 1027 pixels version of your own. It will be used if people are sharing content on Facebook and your article does not contain any images. 34 | 35 | ### /assets/images/icons/facicon.ico 36 | Replace this image with a 16 × 16 pixels version of your own. This favicon will be displayed in the browser bar and the bookmark collection of your visitors. 37 | 38 | ### /assets/images/iOS 39 | Replace these two image with a 72 × 72 pixels and a 114 × 114 pixels version of your own. This icon will displayed if an iOS user is adding your website to the home screen. 40 | 41 | ### /assets/js 42 | Nothing to do here. jquery-1.7.1.min.js helps to power the theme and tinynav.js will change the main navigation to a drop down for mobile devices. If you have more JavaScripts you should add them here. 43 | 44 | ### /content/.htaccess 45 | Make sure you copy the .htaccess file. It will make sure no one can snoop your content folders. 46 | 47 | ### /content/01-articles 48 | Contains your blog articles. I added some examples of different content types to give you a head start. 49 | 50 | ### /content/02-home 51 | Your home/info page. 52 | 53 | ### /content/03-search 54 | Settings for the search page. 55 | 56 | ### /content/error 57 | Settings for the 404 error page. 58 | 59 | ### /content/feed 60 | Settings for the RSS feed. 61 | 62 | ### /content/site.txt 63 | Overall site settings. Make sure you update your Twitter username and change the copyright. If you do not want to use the Twitter share you will have to modify the /site/snippets/share.php file to your needs. 64 | 65 | ### /content/sitemap 66 | Generates an Google friendly XML site map. You can add the URL afterwards into the robots.txt. 67 | 68 | User-Agent: * 69 | Allow: / 70 | Sitemap: http://yourdomain.com 71 | 72 | ### /site/snippets/diqus.php 73 | Sometimes it is better to build on existing systems rather than reinventing the wheel and a great existing comment system is Disqus. 74 | 75 | Disqus has all the features you want from a good comment system: spam protection, multiple login features for your visitors, great admin tools to moderate comments, easy implementation and it is also quite easy to adapt to the design of your site. 76 | 77 | Setting up an account with Disqus only takes a few minutes and setting up comments for your site is very straight forward. You can find detailed instructions [here](http://getkirby.com/blog/adding-comments). 78 | 79 | After you setup your Disqus account you only have to change the username in the /site/templates/article.php file. 80 | 81 | 'USERNAME')) ?> 82 | 83 | ### /site/snippets/footer.php 84 | The complete footer of your page. Please change it at will but I am happy if you leave the comment on the last line. 85 | 86 | ### /site/snippets/header.php 87 | The complete header of your page. Please change it at will. 88 | 89 | ### /site/snippets/navigation.php 90 | The complete footer of your page. Please change it at will. Any content site which has a number ID will be listed. 91 | 92 | ### /site/snippets/pagination.php 93 | The pagination snippet. Please change it at will. 94 | 95 | ### /site/snippets/share.php 96 | Social share buttons. Please change them at will. 97 | 98 | ### /site/templates/article.php 99 | Style for a single article. 100 | 101 | ### /site/templates/articles.php 102 | List of all articles. If you like you can change how many articles are displayed on the page: 103 | 104 | find('articles') 107 | ->children() 108 | ->visible() 109 | ->filterBy('tags', param('tag'), ',') 110 | ->flip() 111 | ->paginate(10); 112 | 113 | } else { 114 | 115 | $articles = $pages->find('articles') 116 | ->children() 117 | ->visible() 118 | ->flip() 119 | ->paginate(10); 120 | 121 | } ?> 122 | 123 | ### /site/templates/default.php 124 | Your Info page. 125 | 126 | ### /site/templates/error.php 127 | Your Error page. 128 | 129 | ### /site/templates/search.php 130 | Your Search page.If you like you can change how many results are displayed on the page: 131 | 132 | $search = new search(array( 133 | 'searchfield' => 'q', 134 | 'words' => true, 135 | 'in' => 'articles', 136 | 'paginate' => 10 137 | )); 138 | 139 | ## Disclaimers 140 | 141 | ### Credits 142 | Please support humans.txt (http://humanstxt.org/). It's an initiative for knowing the people behind a website. It's a TXT file that contains information about the different people who have contributed to building the website. 143 | 144 | monochrome Theme: https://github.com/niklausgerber/monochrome 145 | Niklaus Gerber 146 | Twitter: @niklausgerber 147 | URL: http://niklausgerber.com 148 | Location: Bern, Switzerland 149 | 150 | If you are happy with monochrome please link to http://niklausgerber.com & follow me on [Twitter](http://twitter.com/niklausgerber). 151 | 152 | ### Licences 153 | Monochrome by Niklaus Gerber is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. 154 | Based on a work at github.com. 155 | 156 | ### Download, Fork, Commit. 157 | If you think you can make this better, please Download, Fork, & Commit. I'd love to see your ideas. -------------------------------------------------------------------------------- /assets/css/base.css: -------------------------------------------------------------------------------- 1 | /* HTML5 display-role reset for older browsers */ 2 | 3 | html, body, div, span, applet, object, iframe, 4 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 5 | a, abbr, acronym, address, big, cite, code, 6 | del, dfn, em, img, ins, kbd, q, s, samp, 7 | small, strike, strong, sub, sup, tt, var, 8 | b, u, i, center, 9 | dl, dt, dd, ol, ul, li, 10 | fieldset, form, label, legend, 11 | table, caption, tbody, tfoot, thead, tr, th, td, 12 | article, aside, canvas, details, embed, 13 | figure, figcaption, footer, header, hgroup, 14 | menu, nav, output, ruby, section, summary, 15 | time, mark, audio, video { 16 | margin: 0; 17 | padding: 0; 18 | border: 0; 19 | font-size: 100%; 20 | font: inherit; 21 | vertical-align: baseline; 22 | } 23 | 24 | article, aside, details, figcaption, figure, 25 | footer, header, hgroup, menu, nav, section { 26 | display: block; 27 | } 28 | 29 | /* CSS Enhancements for Better User Experience */ 30 | 31 | ::selection { 32 | background:#ececec; 33 | color:#000; /* Safari and Opera */ 34 | } 35 | 36 | ::-moz-selection { 37 | background:#ececec; 38 | color:#000; /* Firefox */ 39 | } 40 | 41 | html { 42 | overflow-y:scroll; 43 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 44 | tap-highlight-color: rgba(0, 0, 0, 0); 45 | text-rendering: optimizeLegibility; 46 | -webkit-font-smoothing: antialiased; 47 | } 48 | 49 | /* Brakes Text for Mobile */ 50 | .page-break { 51 | page-break-before:always; 52 | } 53 | 54 | input[type=submit], label, select, .pointer { 55 | cursor:pointer; 56 | } 57 | 58 | /* Hack */ 59 | @media all and (-webkit-min-device-pixel-ratio: 1){ 60 | selectors { 61 | properties: values; 62 | } 63 | } 64 | 65 | /* Basic Setup */ 66 | 67 | body { 68 | color: #000; 69 | line-height: 1.8em; 70 | font-family: 'Arvo', serif; 71 | } 72 | 73 | ol, ul { 74 | list-style: square; 75 | margin: 0 0 0.5em; 76 | } 77 | 78 | blockquote, q { 79 | quotes: none; 80 | } 81 | 82 | blockquote:before, blockquote:after, 83 | q:before, q:after { 84 | content: ''; 85 | content: none; 86 | } 87 | 88 | code { 89 | background-color: #f4f4f4; 90 | font-family: "Courier New", Courier, mono; 91 | font-size: 0.875em; 92 | } 93 | 94 | table { 95 | border-collapse: collapse; 96 | border-spacing: 0; 97 | } 98 | 99 | strong { 100 | font-weight: bold; 101 | } 102 | 103 | img { 104 | max-width: 100%; 105 | } 106 | 107 | hr { 108 | border: none; 109 | height: 9em; 110 | } 111 | 112 | /* styles for mobile */ 113 | @media screen and (max-width: 720px) { 114 | hr { 115 | border: none; 116 | height: 3.5em; 117 | } 118 | } 119 | 120 | .grid { 121 | padding: 0 20px; 122 | } 123 | 124 | .row { 125 | margin-bottom: 4em; 126 | } 127 | 128 | /* Typogrpaphy */ 129 | 130 | p { 131 | margin: 0 0 0.5em; 132 | margin: 0 0 2.3em; 133 | } 134 | 135 | h1, h2, h3, h4, h5, h6 { 136 | font-weight: normal; 137 | line-height: 1.25em; 138 | padding-bottom: 0.7em; 139 | padding-right: 0; 140 | padding-left: 0; 141 | font-family: 'Lato', sans-serif; 142 | text-transform: uppercase; 143 | } 144 | 145 | h1 { 146 | font-size: 4em; 147 | } 148 | 149 | h2 { 150 | font-size: 3em; 151 | } 152 | 153 | h3, h4 { 154 | font-size: 2em; 155 | } 156 | 157 | h5, h6 { 158 | font-size: 1em; 159 | } 160 | 161 | /* styles for mobile */ 162 | @media screen and (max-width: 720px) { 163 | h1 { 164 | font-size: 2em; 165 | } 166 | 167 | h2 { 168 | font-size: 1.5em; 169 | } 170 | 171 | h3, h4 { 172 | font-size: 1em; 173 | } 174 | 175 | h5, h6 { 176 | font-size: 1em; 177 | } 178 | } 179 | 180 | a, a:link, a:visited { 181 | color: #DB1010; 182 | text-decoration: none; 183 | border: none; 184 | font-weight: bold; 185 | } 186 | 187 | a:hover, a:active { 188 | color: #CCC; 189 | -moz-transition: all 0.2s ease-in; 190 | -o-transition: all 0.2s ease-in; 191 | -webkit-transition: all 0.2s ease-in; 192 | -ms-transition: all 0.2s ease-in; 193 | transition: all 0.2s ease-in; 194 | } 195 | 196 | p a { 197 | margin: -.5em; 198 | padding: .5em; 199 | position: relative; 200 | } 201 | 202 | .date { 203 | font-family: 'Lato', sans-serif; 204 | text-transform: uppercase; 205 | font-size: 0.8em; 206 | line-height: 0em; 207 | margin-bottom: 1em; 208 | color: #ccc; 209 | } 210 | 211 | /* Header */ 212 | 213 | .header { 214 | position: fixed; 215 | background: #FFF; 216 | -moz-box-shadow: 0px 2px 6px rgba(222, 222, 222, .9); 217 | -webkit-box-shadow: 0px 2px 6px rgba(222, 222, 222, .9); 218 | border-bottom: 1px solid #d4d3d3; 219 | box-shadow: 0px 2px 6px rgba(222, 222, 222, .9); 220 | top: 0; 221 | width: 100%; 222 | height: 4.5em; 223 | z-index: 9; 224 | } 225 | 226 | /* Navigation */ 227 | 228 | #navigation { 229 | list-style:none; 230 | margin:0; 231 | padding:0; 232 | text-align:center; 233 | position: relative; 234 | top: 1.5em; 235 | } 236 | 237 | a.nav, a.nav:link, a.nav:visited { 238 | color: #232323; 239 | display:inline-block; 240 | padding-right: 1.5em; 241 | padding-left: 1.5em; 242 | font-weight: normal; 243 | } 244 | 245 | a.nav:hover, a.nav:active { 246 | color: #DB1010; 247 | } 248 | 249 | .tinynav { 250 | display: none; 251 | } 252 | 253 | #navigation li { 254 | display:inline; 255 | } 256 | 257 | /* styles for mobile */ 258 | @media screen and (max-width: 720px) { 259 | .header { 260 | height: 2.5em; 261 | z-index: 9; 262 | } 263 | 264 | #navigation { 265 | top: 1.5em; 266 | } 267 | 268 | .tinynav { 269 | display: block; 270 | position: relative; 271 | top: 0.9em; 272 | z-index: 10; 273 | float: right; 274 | margin-right:0.9em; 275 | } 276 | 277 | #navigation { 278 | display: none; 279 | } 280 | } 281 | 282 | /* Article & Info Title */ 283 | .article-title a, .article-title a:link, .article-title a:visited { 284 | color: #232323; 285 | } 286 | 287 | #url { 288 | word-wrap: break-word; 289 | -ms-word-break: break-all; 290 | word-break: break-all; 291 | word-break: break-word; 292 | -webkit-hyphens: auto; 293 | -moz-hyphens: auto; 294 | hyphens: auto; 295 | } 296 | 297 | /* Error */ 298 | .error { 299 | text-align: center; 300 | } 301 | 302 | /* Search */ 303 | .search { 304 | text-align: center; 305 | } 306 | 307 | /* Footer */ 308 | 309 | .footer { 310 | width: 100%; 311 | text-align: center; 312 | color: #ccc; 313 | margin-top: 3em; 314 | font-family: 'Lato', sans-serif; 315 | text-transform: uppercase; 316 | font-size: 0.5em; 317 | color: #ccc; 318 | } 319 | 320 | /* FitMyVideo */ 321 | 322 | .FitMyVideo-container { 323 | position: relative; 324 | padding-bottom: 56.25%; 325 | padding-top: 30px; 326 | height: 0; 327 | overflow: hidden; 328 | } 329 | 330 | .FitMyVideo-container iframe, 331 | .FitMyVideo-container object, 332 | .FitMyVideo-container embed { 333 | position: absolute; 334 | top: 0; 335 | left: 0; 336 | width: 100%; 337 | height: 100%; 338 | } 339 | 340 | /* Form Fields */ 341 | 342 | #search { 343 | border: 1px solid rgba(0, 0, 0, 0.2); 344 | -webkit-border-radius:0; 345 | -webkit-appearance:none; 346 | width: 100%; 347 | height: 1.667em; 348 | padding: 0; 349 | font: 1.667em 'Arvo', serif; 350 | } 351 | 352 | input[type=submit] { 353 | background:#EEE; 354 | background:-moz-linear-gradient(top,#F7F7F7,#E6E6E6); 355 | background:-webkit-gradient(linear,left top,left bottom,from(#F7F7F7),to(#E6E6E6)); 356 | border:solid .1em #666; 357 | border-radius:.3em; 358 | -moz-border-radius:.3em; 359 | -webkit-border-radius:.3em; 360 | cursor:pointer; 361 | font-size:90%; 362 | font-weight:700; 363 | height:2em; 364 | padding:0 .5em; 365 | text-shadow:#FFF 0 .1em 0; 366 | -moz-text-shadow:#FFF 0 .1em 0; 367 | -webkit-text-shadow:#FFF 0 .1em 0; 368 | margin-top: 0.5em; 369 | } 370 | 371 | input[type=submit]:hover { 372 | border-color:#222 373 | } -------------------------------------------------------------------------------- /site/config/config.php: -------------------------------------------------------------------------------- 1 | 29 | Header set X-UA-Compatible "IE=Edge,chrome=1" 30 | # mod_headers can't match by content-type, but we don't want to send this header on *everything*... 31 | 32 | Header unset X-UA-Compatible 33 | 34 | 35 | 36 | 37 | # ---------------------------------------------------------------------- 38 | # Cross-domain AJAX requests 39 | # ---------------------------------------------------------------------- 40 | 41 | # Serve cross-domain ajax requests, disabled. 42 | # enable-cors.org 43 | # code.google.com/p/html5security/wiki/CrossOriginRequestSecurity 44 | 45 | # 46 | # Header set Access-Control-Allow-Origin "*" 47 | # 48 | 49 | 50 | 51 | # ---------------------------------------------------------------------- 52 | # Webfont access 53 | # ---------------------------------------------------------------------- 54 | 55 | # Allow access from all domains for webfonts. 56 | # Alternatively you could only whitelist your 57 | # subdomains like "subdomain.example.com". 58 | 59 | 60 | 61 | Header set Access-Control-Allow-Origin "*" 62 | 63 | 64 | 65 | 66 | 67 | # ---------------------------------------------------------------------- 68 | # Proper MIME type for all files 69 | # ---------------------------------------------------------------------- 70 | 71 | 72 | # JavaScript 73 | # Normalize to standard type (it's sniffed in IE anyways) 74 | # tools.ietf.org/html/rfc4329#section-7.2 75 | AddType application/javascript js 76 | 77 | # Audio 78 | AddType audio/ogg oga ogg 79 | AddType audio/mp4 m4a 80 | 81 | # Video 82 | AddType video/ogg ogv 83 | AddType video/mp4 mp4 m4v 84 | AddType video/webm webm 85 | 86 | # SVG. 87 | # Required for svg webfonts on iPad 88 | # twitter.com/FontSquirrel/status/14855840545 89 | AddType image/svg+xml svg svgz 90 | AddEncoding gzip svgz 91 | 92 | # Webfonts 93 | AddType application/vnd.ms-fontobject eot 94 | AddType application/x-font-ttf ttf ttc 95 | AddType font/opentype otf 96 | AddType application/x-font-woff woff 97 | 98 | # Assorted types 99 | AddType image/x-icon ico 100 | AddType image/webp webp 101 | AddType text/cache-manifest appcache manifest 102 | AddType text/x-component htc 103 | AddType application/x-chrome-extension crx 104 | AddType application/x-xpinstall xpi 105 | AddType application/octet-stream safariextz 106 | AddType text/x-vcard vcf 107 | 108 | 109 | 110 | # ---------------------------------------------------------------------- 111 | # Allow concatenation from within specific js and css files 112 | # ---------------------------------------------------------------------- 113 | 114 | # e.g. Inside of script.combined.js you could have 115 | # 116 | # 117 | # and they would be included into this single file. 118 | 119 | # This is not in use in the boilerplate as it stands. You may 120 | # choose to name your files in this way for this advantage or 121 | # concatenate and minify them manually. 122 | # Disabled by default. 123 | 124 | # 125 | # Options +Includes 126 | # AddOutputFilterByType INCLUDES application/javascript application/json 127 | # SetOutputFilter INCLUDES 128 | # 129 | # 130 | # Options +Includes 131 | # AddOutputFilterByType INCLUDES text/css 132 | # SetOutputFilter INCLUDES 133 | # 134 | 135 | 136 | # ---------------------------------------------------------------------- 137 | # Gzip compression 138 | # ---------------------------------------------------------------------- 139 | 140 | 141 | 142 | # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ 143 | 144 | 145 | SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding 146 | RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding 147 | 148 | 149 | 150 | # HTML, TXT, CSS, JavaScript, JSON, XML, HTC: 151 | 152 | FilterDeclare COMPRESS 153 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html 154 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css 155 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain 156 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml 157 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component 158 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript 159 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json 160 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml 161 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml 162 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml 163 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml 164 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject 165 | FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml 166 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf 167 | FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype 168 | FilterChain COMPRESS 169 | FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no 170 | 171 | 172 | 173 | # Legacy versions of Apache 174 | AddOutputFilterByType DEFLATE text/html text/plain text/css application/json 175 | AddOutputFilterByType DEFLATE application/javascript 176 | AddOutputFilterByType DEFLATE text/xml application/xml text/x-component 177 | AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml 178 | AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype 179 | 180 | 181 | 182 | 183 | 184 | # ---------------------------------------------------------------------- 185 | # Expires headers (for better cache control) 186 | # ---------------------------------------------------------------------- 187 | 188 | # These are pretty far-future expires headers. 189 | # They assume you control versioning with cachebusting query params like 190 | #