diff --git a/CHANGELOG.md b/CHANGELOG.md index 4245dcd..223b536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Pico Changelog ============== +### Version 1.0.4 +Released: - + +``` +* [New] Add Pico's social icons to default theme +* [Fixed] Fix handling of non-YAML 1-line front matters +``` + ### Version 1.0.3 Released: 2016-05-11 diff --git a/content-sample/index.md b/content-sample/index.md index edbfcc8..530cfc9 100644 --- a/content-sample/index.md +++ b/content-sample/index.md @@ -1,6 +1,16 @@ --- Title: Welcome Description: Pico is a stupidly simple, blazing fast, flat file CMS. +social: + - title: Visit us on GitHub + url: https://github.com/picocms/Pico + icon: octocat + - title: Check us out on Twitter + url: https://twitter.com/gitpicocms + icon: birdy + - title: Join us on Freenode IRC Webchat + url: https://webchat.freenode.net/?channels=%23picocms + icon: chat --- ## Welcome to Pico diff --git a/lib/Pico.php b/lib/Pico.php index b2f04a6..11d3ade 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -911,7 +911,14 @@ class Pico if (preg_match($pattern, $rawContent, $rawMetaMatches) && isset($rawMetaMatches[3])) { $yamlParser = new \Symfony\Component\Yaml\Parser(); $meta = $yamlParser->parse($rawMetaMatches[3]); - $meta = ($meta !== null) ? array_change_key_case($meta, CASE_LOWER) : array(); + + if ($meta !== null) { + // the parser may return a string for non-YAML 1-liners + // assume that this string is the page title + $meta = is_array($meta) ? array_change_key_case($meta, CASE_LOWER) : array('title' => $meta); + } else { + $meta = array(); + } foreach ($headers as $fieldId => $fieldName) { $fieldName = strtolower($fieldName); diff --git a/themes/default/font/LICENSE.txt b/themes/default/font/LICENSE.txt new file mode 100644 index 0000000..bf29f26 --- /dev/null +++ b/themes/default/font/LICENSE.txt @@ -0,0 +1,22 @@ +Icon fonts generator + +## Fontello + + Copyright (C) 2011 by Vitaly Puzrin + + Author: Vitaly Puzrin + License: The MIT License + Homepage: http://fontello.com/ + + + +Font license info + +## Font Awesome + + Copyright (C) 2012 by Dave Gandy + + Author: Dave Gandy + License: SIL OFL 1.1 + Homepage: http://fortawesome.github.com/Font-Awesome/ + diff --git a/themes/default/font/fontello.eot b/themes/default/font/fontello.eot new file mode 100644 index 0000000..b3ae4d9 Binary files /dev/null and b/themes/default/font/fontello.eot differ diff --git a/themes/default/font/fontello.svg b/themes/default/font/fontello.svg new file mode 100644 index 0000000..6514c03 --- /dev/null +++ b/themes/default/font/fontello.svg @@ -0,0 +1,16 @@ + + + +Copyright (C) 2016 by original authors @ fontello.com + + + + + + + + + + + + \ No newline at end of file diff --git a/themes/default/font/fontello.ttf b/themes/default/font/fontello.ttf new file mode 100644 index 0000000..f9b65ca Binary files /dev/null and b/themes/default/font/fontello.ttf differ diff --git a/themes/default/font/fontello.woff b/themes/default/font/fontello.woff new file mode 100644 index 0000000..a2ef511 Binary files /dev/null and b/themes/default/font/fontello.woff differ diff --git a/themes/default/font/fontello.woff2 b/themes/default/font/fontello.woff2 new file mode 100644 index 0000000..9821cb2 Binary files /dev/null and b/themes/default/font/fontello.woff2 differ diff --git a/themes/default/fontello.css b/themes/default/fontello.css new file mode 100644 index 0000000..8fd6a40 --- /dev/null +++ b/themes/default/fontello.css @@ -0,0 +1,60 @@ +@font-face { + font-family: 'fontello'; + src: url('font/fontello.eot?13793670'); + src: url('font/fontello.eot?13793670#iefix') format('embedded-opentype'), + url('font/fontello.woff2?13793670') format('woff2'), + url('font/fontello.woff?13793670') format('woff'), + url('font/fontello.ttf?13793670') format('truetype'), + url('font/fontello.svg?13793670#fontello') format('svg'); + font-weight: normal; + font-style: normal; +} +/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ +/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ +/* +@media screen and (-webkit-min-device-pixel-ratio:0) { + @font-face { + font-family: 'fontello'; + src: url('../font/fontello.svg?13793670#fontello') format('svg'); + } +} +*/ + +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: "fontello"; + font-style: normal; + font-weight: normal; + speak: none; + + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: .2em; + text-align: center; + /* opacity: .8; */ + + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + + /* Animation center compensation - margins should be symmetric */ + /* remove if not needed */ + margin-left: .2em; + + /* you can be more comfortable with increased icons size */ + /* font-size: 120%; */ + + /* Font smoothing. That was taken from TWBS */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + /* Uncomment for 3D effect */ + /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ +} + +.icon-chat:before { content: '\e800'; } /* '' */ +.icon-birdy:before { content: '\f099'; } /* '' */ +.icon-octocat:before { content: '\f09b'; } /* '' */ diff --git a/themes/default/index.twig b/themes/default/index.twig index 9d7c691..8d6bc03 100644 --- a/themes/default/index.twig +++ b/themes/default/index.twig @@ -12,6 +12,7 @@ + @@ -41,6 +42,11 @@