diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index c0ac569b..4a9892ff 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -75,7 +75,11 @@ class ContentActions extends Actions $zip = new ZipArchive(); $zip->open($zipPath, ZipArchive::OVERWRITE); - $zip->addFile(ROOT_DIR . '/posts/press.md', 'intro.txt'); + //file_get_contents fails on servers without proper SSL, so use live site always for now + $html = file_get_contents('https://lbry.io/press-kit'); +// $html = file_get_contents('https://' . $_SERVER['HTTP_HOST'] . '/press-kit')); + + $zip->addFromString('press.html', $html); foreach(glob(ROOT_DIR . '/web/img/press/*') as $productImgPath) { @@ -86,7 +90,7 @@ class ContentActions extends Actions foreach(glob(ROOT_DIR . '/posts/bio/*.md') as $bioPath) { - list($metadata, $bioHtml) = static::parseMarkdown($bioPath); + list($metadata, $bioHtml) = View::parseMarkdown($bioPath); $zip->addFile($bioPath, '/team_bios/' . $metadata['name'] . ' - ' . $metadata['role'] . '.txt'); } @@ -113,19 +117,11 @@ class ContentActions extends Actions ]]; } - protected static function parseMarkdown($path) - { - list($ignored, $frontMatter, $markdown) = explode('---', file_get_contents($path), 3); - $metadata = Spyc::YAMLLoadString(trim($frontMatter)); - $html = ParsedownExtra::instance()->text(trim($markdown)); - return [$metadata, $html]; - } - public static function prepareBioPartial(array $vars) { $person = $vars['person']; - $path = ROOT_DIR . '/posts/bio/' . $person . '.md'; - list($metadata, $bioHtml) = static::parseMarkdown($path); + $path = 'bio/' . $person . '.md'; + list($metadata, $bioHtml) = View::parseMarkdown($path); return $metadata + [ 'imgSrc' => '/img/team/' . $person . '-644x450.jpg', 'bioHtml' => $bioHtml, diff --git a/posts/press-kit.md b/posts/press-kit.md new file mode 100644 index 00000000..883366db --- /dev/null +++ b/posts/press-kit.md @@ -0,0 +1,32 @@ +###Press & Media Inquiries + +Mike Vine, LBRY Evangelist
+[mike@lbry.io](mailto:mike@lbry.io) • [917-719-6333](tel:9177196333) + +###Company Profile + +LBRY’s goal: Every film, song, book & game ever made – accessible anywhere. + +LBRY uses blockchain technology to provide a new way for people to publish and share content with each other – with no corporate middleman. It is a decentralized, censorship-resistant, open-source, peer-to-peer information marketplace and discovery protocol. LBRY was incorporated in 2015 by Jeremy Kauffman, and the team has expanded steadily since then. An alpha client was released in late October 2015, and an invite-only beta client will be released imminently. LBRY is powered by its own cryptocoin, LBRY Credits (similar to Bitcoin), which began being mined on June 27th, 2016. + +###FAQ + +- [LBRY in 100 Seconds (Video)](https://www.youtube.com/watch?v=qkUA0vTWM7g) +- [How Does LBRY Work, Exactly?](https://lbry.io/news/introducing-lbry-the-bitcoin-of-content) +- [Why Doesn't LBRY Just Use Bitcoin?](https://lbry.io/news/why-doesnt-lbry-just-use-bitcoin) + +### Media Mentions + +- [LBRY and decentralised apps - an interview with Jeremy Kauffman](http://goodtechnologyproject.org/blog/2016/02/07/lbry-and-decentralised-apps-an-interview-with-jeremy-kauffman/), **Good Technology Project, February 2016]** +- [The Appcoin Revolution: Interview with Mike Vine of LBRY](http://cointelegraph.com/news/the-appcoin-revolution-interview-with-mike-vine-of-lbry), **CoinTelegraph, February 2016** +- [Alexandria vs LBRY - Which will be the file sharing application of the next generation?](http://bravenewcoin.com/news/alexandria-vs-lbry-which-will-be-the-file-sharing-application-of-the-next-generation/), **BraveNewCoin, December 2015** +- [LBRY: The Lovechild of Bitcoin, BitTorrent & Storj](http://cointelegraph.com/news/lbry-the-lovechild-of-bitcoin-bittorrent-storj), **CoinTelegraph, October 2015** +- [This New Hampshire Startup's Plan to Fight Netflix is Equal Parts BitTorrent and Bitcoin](http://bostinno.streetwise.co/2015/09/18/bitcoin-startups-lbry-combines-bittorrent-and-bitcoin-to-fight-netflix/), **Bostinno, September 2015** + +### Contact & Social Media + +- Web: [https://lbry.io/](https://lbry.io/) +- Facebook: [https://www.facebook.com/lbryio](https://www.facebook.com/lbryio) +- Twitter: [https://twitter.com/lbryio](https://twitter.com/lbryio) +- Reddit: [https://www.reddit.com/r/lbry](https://www.reddit.com/r/lbry) +- Mailing List: [https://lbry.io/join-list](https://lbry.io/join-list) - **Sign up to follow along as we build LBRY** diff --git a/posts/press.md b/posts/press.md deleted file mode 100644 index cdac2a0c..00000000 --- a/posts/press.md +++ /dev/null @@ -1 +0,0 @@ -LBRY is a new method for people to publish, share and purchase content with one another online. \ No newline at end of file diff --git a/view/View.class.php b/view/View.class.php index 7c1aa703..f912e714 100644 --- a/view/View.class.php +++ b/view/View.class.php @@ -19,6 +19,11 @@ class View public static function render($template, array $vars = []) { + if (static::isMarkdown($template)) + { + return static::markdownToHtml(static::getFullPath($template)); + } + if (!static::exists($template) || substr_count($template, '/') !== 1) { throw new InvalidArgumentException(sprintf('The template "%s" does not exist or is unreadable.', $template)); @@ -53,13 +58,32 @@ class View return ob_get_clean(); } + public static function markdownToHtml($path) + { + return ParsedownExtra::instance()->text(trim(file_get_contents($path))); + } + public static function exists($template) { return is_readable(static::getFullPath($template)); } + protected static function isMarkdown($nameOrPath) + { + return strlen($nameOrPath) > 3 && substr($nameOrPath, -3) == '.md'; + } + protected static function getFullPath($template) { + if ($template && $template[0] == '/') + { + return $template; + } + if (static::isMarkdown($template)) + { + return ROOT_DIR . '/posts/' . $template; + } + return ROOT_DIR . '/view/template/' . $template . '.php'; } @@ -88,6 +112,15 @@ class View return static::$metaImg ?: '//lbry.io/img/lbry-dark-1600x528.png'; } + public static function parseMarkdown($template) + { + $path = static::getFullPath($template); + list($ignored, $frontMatter, $markdown) = explode('---', file_get_contents($path), 3); + $metadata = Spyc::YAMLLoadString(trim($frontMatter)); + $html = ParsedownExtra::instance()->text(trim($markdown)); + return [$metadata, $html]; + } + public static function compileCss() { $scssCompiler = new \Leafo\ScssPhp\Compiler(); diff --git a/view/template/page/press-kit.php b/view/template/page/press-kit.php index 3971aea2..effb110e 100644 --- a/view/template/page/press-kit.php +++ b/view/template/page/press-kit.php @@ -2,33 +2,68 @@ false]) ?>
-
+

LBRY Press Kit

Information and media for those who want to write or report on LBRY. Any information or media on this page or in our kit can be re-used or otherwise published without attribution.

-
-

Download Kit

- Download ZIP -
-
-

What is LBRY?

- text(trim(file_get_contents(ROOT_DIR . '/posts/press.md'))) ?> -
-
-

Logos and Product Images

-
- -
-
- -

- -
+

Download Kit

+ Download ZIP + + + +

Logos and Product Images

+
+ +
+
+ +

+
- -
-
+
+ +
+ +

Founding Team

+ + +
+
+ <?php echo $metadata['name'] ?> +
+
+

+ + + + +

+
+
+ +
+
+
+ +

Advisory Team

+ + +
+
+ <?php echo $metadata['name'] ?> +
+
+

+ +

+
+
+ +
+
+
+
\ No newline at end of file diff --git a/web/scss/_basic.scss b/web/scss/_basic.scss index 471e515d..bf779974 100644 --- a/web/scss/_basic.scss +++ b/web/scss/_basic.scss @@ -78,7 +78,7 @@ section .align-left { float: left; } .align-right { float: right; } -.link-primary, .markdown a[href] +.link-primary, .markdown a[href]:not([class]) { @include anchor($color-primary); }