The Front Desk
-News and musings from the LBRY team.
-diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 0e8ab0bc..e759a68b 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -58,9 +58,11 @@ class Controller case '/lbry-linux-latest.deb': return static::redirect('https://s3.amazonaws.com/files.lbry.io/linux/lbry_0.2.1_amd64.deb', 307); default: - if (preg_match('#^/blog($|/)#', $uri)) + $blogPattern = '#^/news(/|$)#'; + if (preg_match($blogPattern, $uri)) { - return BlogActions::execute($uri); + $slug = preg_replace($blogPattern, '', $uri); + return $slug ? BlogActions::executePost($slug) : BlogActions::executeIndex(); } $noSlashUri = ltrim($uri, '/'); if (View::exists('page/' . $noSlashUri)) diff --git a/controller/action/BlogActions.class.php b/controller/action/BlogActions.class.php index 10b9e3a6..c52f59f2 100644 --- a/controller/action/BlogActions.class.php +++ b/controller/action/BlogActions.class.php @@ -2,24 +2,16 @@ class BlogActions extends Actions { - public static function execute($uri) - { - $slug = preg_replace('#^/blog(/|$)#', '', $uri); - if ($slug) - { - return static::executePost($slug); - } - return static::executeHome(); - } - - public static function executeHome() + const URL_STEM = '/news'; + + public static function executeIndex() { $posts = Blog::getPosts(); usort($posts, function(Post $a, Post $b) { return strcasecmp($b->getDate()->format('Y-m-d'), $a->getDate()->format('Y-m-d')); }); $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; - return ['blog/home', [ + return ['blog/index', [ 'posts' => $posts, 'page' => $page ]]; @@ -36,4 +28,13 @@ class BlogActions extends Actions 'post' => $post ]]; } + + public static function prepareAuthor(array $vars) + { + $post = $vars['post']; + return [ + 'authorName' => $post->getAuthorName(), + 'authorBioHtml' => $post->getAuthorBioHtml() + ]; + } } diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 1bd56e82..424f0da6 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -17,12 +17,13 @@ class ContentActions extends Actions public static function executeGet() { - if (isset($_GET['email']) && $_GET['email'] && Session::get(Session::KEY_LIST_SUB_ERROR)) + $hasEmail = isset($_GET['email']) && $_GET['email']; + if ($hasEmail && Session::get(Session::KEY_LIST_SUB_ERROR)) { Controller::redirect('/get'); } return ['page/get', [ - 'isSubscribed' => $_GET['email'] || in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, [])) + 'isSubscribed' => $hasEmail || in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, [])) ]]; } // diff --git a/blog/Blog.class.php b/model/Blog.class.php similarity index 81% rename from blog/Blog.class.php rename to model/Blog.class.php index 39a7d64a..856bc327 100644 --- a/blog/Blog.class.php +++ b/model/Blog.class.php @@ -7,7 +7,7 @@ class Blog public static function getPosts() { $posts = []; - foreach(glob(ROOT_DIR.'/blog/posts/*.md') as $file) + foreach(static::getAllPostPaths() as $file) { $posts[] = Post::fromFile($file); } @@ -33,13 +33,18 @@ class Blog { if (!static::$slugMap) { - foreach(glob(ROOT_DIR.'/blog/posts/*.md') as $file) + foreach(static::getAllPostPaths() as $file) { static::$slugMap[static::getSlugFromFilename($file)] = $file; } } } + protected static function getAllPostPaths() + { + return glob(ROOT_DIR . '/view/posts/*.md'); + } + public static function getSlugMap() { static::initSlugMap(); diff --git a/blog/Post.class.php b/model/Post.class.php similarity index 52% rename from blog/Post.class.php rename to model/Post.class.php index 17d257a0..0ae94e25 100644 --- a/blog/Post.class.php +++ b/model/Post.class.php @@ -19,6 +19,11 @@ class Post $this->contentHtml = ParsedownExtra::instance()->text(trim($markdown)); } + public function getRelativeUrl() + { + return BlogActions::URL_STEM . '/' . $this->slug; + } + public function getSlug() { return $this->slug; @@ -57,4 +62,39 @@ class Post $key = array_search($this->getSlug(), $slugs); return $key === false || $key >= count($slugs)-1 ? null : Blog::getPost($slugs[$key+1]); } + + public function getAuthorName() + { + switch(strtolower($this->author)) + { + case 'jeremy': + return 'Jeremy Kauffman'; + case 'mike': + return 'Mike Vine'; + case 'jimmy': + return 'Jimmy Kiselak'; + case 'jack': + return 'Jack Robison'; + case 'lbry': + default: + return 'Samuel Bryan'; + } + } + + public function getAuthorBioHtml() + { + switch(strtolower($this->author)) + { + case 'jeremy': + return '
Jeremy is the creator of TopScore (usetopscore.com), LBRY (lbry.io), and that joke where the first two items in your list are serious while the third one is a run-on sentence.
'; + case 'mike': + case 'jimmy': + return '' . $this->getAuthorName() . ' is one of the founding members of LBRY.
'; + case 'jack': + return 'Jack was one of the first people to discover LBRY and took to it so fast he may understand more about it than anyone. He has Asperger\'s Syndrome and is actively involved in the autism community.
'; + case 'lbry': + default: + return 'Much of our writing is a collaboration between LBRY team members, so we use SamueL BRYan to share credit. Sam has become a friend... an imaginary friend... even though we\'re adults...
'; + } + } } \ No newline at end of file diff --git a/view/View.class.php b/view/View.class.php index ded5068f..e315a0de 100644 --- a/view/View.class.php +++ b/view/View.class.php @@ -62,7 +62,7 @@ class View protected static function getFullPath($template) { - return ROOT_DIR . '/view/' . $template . '.php'; + return ROOT_DIR . '/view/template/' . $template . '.php'; } public static function imagePath($image) diff --git a/view/blog/home.php b/view/blog/home.php deleted file mode 100644 index ff8246ef..00000000 --- a/view/blog/home.php +++ /dev/null @@ -1,21 +0,0 @@ - - false]) ?> -News and musings from the LBRY team.
-wonderfullife : { + title: "It’s a Wonderful Life", + description: "An angel helps a compassionate but despairingly frustrated businessman by showing what life would have been like if he never existed.", + thumbnail: "http://i.imgur.com/MW45x88.jpg", + license: "public domain", + price: 0, //free! + publisher: "A Fan Of George Bailey", //simplification + sources: { //extensible, variable list + lbry_hash :+ +`, + url : + } + }
Join our mailing list for updates about LBRY.
- -At the highest level, LBRY does something extraordinarily simple. LBRY creates an association between a unique name and a piece of digital content, such as a movie, book, or game. This is similar to the domain name system that you are most likely using to access this very post.
Michael Huemer is Professor of Philosophy and Ethics at the University of Colorado, where he has taught since 1998. He has published three single-author scholarly books (including Ethical Intuitionism), one edited anthology, and more than fifty academic articles in epistemology, ethics, political philosophy, and metaphysics. -
+Huemer's articles have appeared in such journals as the Philosophical Review, Mind, the Journal of Philosophy, Ethics, and others. His materials are used as readings in classrooms nationwide. He received a B.A. from UC Berkeley and a Ph.D. from Rutgers University.
+LBRY is seeking an extremely experienced technical advisor or advisor with a strong background in the publishing and media space. If you're that person or have a suggestion, let us know. -
+LBRY allows anyone to publish content to a location like this:
lbry://wonderfullife
Others can access this resource, either for free or for credits. Let's look at an example:
diff --git a/view/page/why.php b/view/template/page/why.php similarity index 100% rename from view/page/why.php rename to view/template/page/why.php index ed128cef..6a7725b7 100644 --- a/view/page/why.php +++ b/view/template/page/why.php @@ -3,7 +3,6 @@ false]) ?>Annual internet video traffic is approximately 500 exabytes (500,000,000,000 GB)1. diff --git a/view/social/sidebar.php b/view/template/social/sidebar.php similarity index 100% rename from view/social/sidebar.php rename to view/template/social/sidebar.php diff --git a/web/img/frontdesk.jpg b/web/img/frontdesk.jpg deleted file mode 100644 index 6fe4cbca..00000000 Binary files a/web/img/frontdesk.jpg and /dev/null differ diff --git a/web/img/lbry_UI.png b/web/img/lbry-ui.png similarity index 100% rename from web/img/lbry_UI.png rename to web/img/lbry-ui.png diff --git a/web/scss/_basic.scss b/web/scss/_basic.scss index 17359347..521ddeb4 100644 --- a/web/scss/_basic.scss +++ b/web/scss/_basic.scss @@ -10,8 +10,8 @@ html } body { - font-family: $bodyFont; - font-weight: 300; + font-family: $font-body; + font-weight: 400; line-height: 1.3333; min-height: 100%; position: relative; @@ -37,17 +37,24 @@ code { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, De h1, h2, h3, h4, h5, h6 { - font-family: $headerFont; - font-weight: 300; + font-family: $font-header; + font-weight: 500; } -h1, h2, h3 +h1, h2, h3, h4 { - margin-bottom: $spacing-vertical / 2; margin-top: $spacing-vertical * 1.5; + margin-bottom: $spacing-vertical / 2; + margin-top: $spacing-vertical / 2; +} +h1 { font-size: 2.4em; } +h2 { font-size: 2.0em; } +h3 { font-size: 1.75em; } +h4 { font-size: 1.4em; } +nav +{ + font-size: 1.2em; + font-family: $font-header; + font-weight: 400; } -h1 { font-size: 2.0em; } -h2 { font-size: 1.75em; } -h3 { font-size: 1.4em; } -h4 { font-size: 1.2em; margin-bottom: $spacing-vertical / 2; } sup, sub { vertical-align: baseline; position: relative; @@ -64,6 +71,7 @@ section } .hide { display: none; } +.spacer-half { margin-bottom: $spacing-vertical / 2; } .spacer1 { margin-bottom: $spacing-vertical; } .spacer2 { margin-bottom: $spacing-vertical * 2; } .text-center { text-align: center; } @@ -74,16 +82,7 @@ section .link-primary { - color: $color-primary; - text-decoration: underline; - .icon:first-child - { - padding-right: 5px; - } - .icon:last-child - { - padding-left: 5px; - } + @include anchor($color-primary); } a:hover img { @@ -123,7 +122,9 @@ a:hover img text-decoration: none; border: 0 none; text-align: center; - font-weight: 400; + font-family: $font-header; + font-size: 1.15em; + } .btn-primary { @@ -158,6 +159,11 @@ a:hover img @include clearfix(); } +.clearfix +{ + @include clearfix(); +} + .table-layout { td diff --git a/web/scss/_blog.scss b/web/scss/_blog.scss index fc15c89d..c7fd0544 100644 --- a/web/scss/_blog.scss +++ b/web/scss/_blog.scss @@ -1,71 +1,28 @@ @import "global"; -.blog-post { - .date { - margin-top: $spacing-vertical * 2; - } - h1 { - font-size: 2em; - margin-top: 0 !important; - } - p, li { - font-weight: 400; - } - img + p { - margin-top: $spacing-vertical; - } - - .prev-next { - margin-top: $spacing-vertical * 2; - margin-bottom: $spacing-vertical * 2; - - .prev-next-label { - font-weight: 700; - } - .next { - text-align: right; - } - } - - blockquote { - padding-left: 40px; - border-left: solid 8px #f2f2f2; - } - - .author { - background-color: #f2f2f2; - .content { - padding-top: $spacing-vertical * 2; - padding-bottom: $spacing-vertical * 2; - } - h2 { - font-weight: 400; - margin-top: 0; - text-transform: uppercase; - } - } -} - -.blog-header { - font-size: 2em; - h1 { - font-weight: 400; - &:after { - clear: right; - } - } -} - -.post-list { - font-family: $bodyFont; +.prev-next { + margin-top: $spacing-vertical * 2; margin-bottom: $spacing-vertical * 2; - div { - margin-bottom: $spacing-vertical; + + .prev-next-label { + font-weight: bold; } - a { - font-weight: 400; + .next { + text-align: right; } - span { - margin-left: 10px; +} + +.post-content +{ + max-width: $max-content-width - 200; + margin-left: auto; + margin-right: auto; + a[href] + { + @include anchor($color-primary); } +} +.post-author-spotlight +{ + h3 { text-transform: uppercase; margin-top: $spacing-vertical / 4 !important; } } \ No newline at end of file diff --git a/web/scss/_content.scss b/web/scss/_content.scss index 137ee75a..17790c3c 100644 --- a/web/scss/_content.scss +++ b/web/scss/_content.scss @@ -18,24 +18,11 @@ { max-width: 1400px; } - &.content-readable - { - max-width: $max-content-width - 200; - p - { - line-height: 29px; - } - a[href] - { - color: $color-primary; - text-decoration: underline; - } - } padding-left: 15px; padding-right: 15px; - h1, h2, h3, h4, h5, h6 + h1, h2, h3, h4 { &:not(:first-child) { @@ -65,6 +52,12 @@ } .link-primary { color: $color-primary; } + + blockquote + { + padding-left: 40px; + border-left: solid 8px #f2f2f2; + } } p @@ -101,10 +94,12 @@ ul { margin-bottom: $spacing-vertical * 1.5; + &:last-child { margin-bottom: $spacing-vertical / 2; } > li + li { margin-top: $spacing-vertical; } } ol { margin-bottom: $spacing-vertical * 1.5; + &:last-child { margin-bottom: $spacing-vertical / 2; } padding-left: 2em; counter-reset: li-counter; > li { diff --git a/web/scss/_cover.scss b/web/scss/_cover.scss index 0439b1b1..38e11f80 100644 --- a/web/scss/_cover.scss +++ b/web/scss/_cover.scss @@ -17,18 +17,14 @@ .cover-full { height: 100vh; - font-size: 1.2em; - .cover-title, .cover-subtitle - { - text-shadow: 0 0 6px rgba(0,0,0,0.8); - } + font-size: 1.4em; } @media (max-width: $mobile-width-threshold) { .cover { padding: $spacing-vertical $spacing-vertical * 2 / 3; } - .cover-title { font-size: 2.4em; margin-bottom: $spacing-vertical; } + .cover-title { font-size: 2.8em; margin-bottom: $spacing-vertical; } } @media (min-width: $mobile-width-threshold) { - .cover-title { font-size: 3.6em; } + .cover-title { font-size: 4.0em; } } @media (max-width: $max-content-width) and (min-width: $mobile-width-threshold) { .cover { padding: $spacing-vertical * 1.5 $spacing-vertical * 2; } @@ -77,6 +73,10 @@ @include linear-gradient(darken($color-light-alt, 5), lighten($color-light-alt, 5)); } +.cover-title, .cover-subtitle +{ + text-shadow: 0 0 6px rgba(0,0,0,0.8); +} .cover-title { line-height: 1.4; @@ -84,5 +84,5 @@ .cover-subtitle { margin: $spacing-vertical 0 $spacing-vertical; - font-size: 1.1em; + font-size: 1.2em; } \ No newline at end of file diff --git a/web/scss/_global.scss b/web/scss/_global.scss index e00074cc..caf2e458 100644 --- a/web/scss/_global.scss +++ b/web/scss/_global.scss @@ -8,14 +8,28 @@ $color-text-dark: #000; $color-money: #216C2A; $color-meta-light: #505050; -$font-size: 18px; +$font-size: 16px; $mobile-width-threshold: 801px; $max-content-width: 1000px; $max-text-width: 660px; -$headerFont: 'Raleway', sans-serif; -$bodyFont: 'Lato', sans-serif; +$font-header: 'Raleway', sans-serif; +$font-body: 'Merriweather', sans-serif; + +@mixin anchor($color) +{ + color: $color; + text-decoration: underline; + .icon:first-child + { + padding-right: 5px; + } + .icon:last-child + { + padding-left: 5px; + } +} @mixin clearfix() { @@ -69,6 +83,17 @@ $bodyFont: 'Lato', sans-serif; flex-direction: $direction; } +@mixin flex-wrap($wrap) { + -webkit-flex-wrap: $wrap; + flex-wrap: $wrap; +} + + +@mixin justify-content($location) { + -webkit-justify-content: $location; + justify-content: $location; +} + @mixin absolute-center() { @include display-flex(); @@ -80,8 +105,7 @@ $bodyFont: 'Lato', sans-serif; -webkit-box-pack: center; -moz-box-pack: center; -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; + @include justify-content(center); } @mixin linear-gradient($from-color, $to-color) { diff --git a/web/scss/_grid.scss b/web/scss/_grid.scss index cdaa4213..5a86cb5b 100644 --- a/web/scss/_grid.scss +++ b/web/scss/_grid.scss @@ -57,12 +57,12 @@ $gutter_fluid: 4; .column-fluid { @include display-flex(); - flex-wrap: wrap; + @include flex-wrap(wrap); > [class*="span"] { @include display-flex(); @include flex(1 0 auto); overflow: hidden; - justify-content: center; + @include justify-content(center); } } @@ -70,6 +70,11 @@ $gutter_fluid: 4; @include clearfix(); } +@media (min-width: $mobile-width-threshold) { + .pull-left { float: left; } + .pull-right { float: right; } +} + @media (max-width: $mobile-width-threshold) { .row-fluid, .tile-fluid, .column-fluid { width: 100%; diff --git a/web/scss/_header.scss b/web/scss/_header.scss index ecb3f4ce..cf7ad0c5 100644 --- a/web/scss/_header.scss +++ b/web/scss/_header.scss @@ -51,7 +51,7 @@ $color-nav-border: #ddd; a { &:hover { text-decoration: underline; } - // &.nav-active { font-weight: bold; } + &.nav-active { font-weight: bold; } } } diff --git a/web/scss/_hero.scss b/web/scss/_hero.scss index 611de5fc..d39a0257 100644 --- a/web/scss/_hero.scss +++ b/web/scss/_hero.scss @@ -6,19 +6,19 @@ color: white; padding-top: $spacing-vertical; padding-bottom: $spacing-vertical; + font-family: $font-header; blockquote { - font-family: $headerFont; border-left: 10px solid rgba(180, 180, 180, 0.3); padding: 0 15px; - font-size: 1.5em; + font-size: 1.8em; &.blockquote-large { max-width: 600px; display: block; margin-left: auto; margin-right: auto; - font-size: 2.0em; + font-size: 2.2em; } + cite { @@ -132,26 +132,22 @@ } h3 { - font-size: 1.25em; + font-size: 1.35em; margin-bottom: $spacing-vertical * .5; font-weight: bold; text-align: center; margin-top: $spacing-vertical * .5; } - p - { - font-size: 16px; - } } .hero-title { font-weight: bold; - font-size: 2.0em; + font-size: 2.2em; margin-bottom: $spacing-vertical * 2; } .hero-title-small { font-weight: bold; - font-size: 1.5em; + font-size: 1.6em; margin-bottom: $spacing-vertical; } \ No newline at end of file diff --git a/web/scss/_reset.scss b/web/scss/_reset.scss index 66d0b0f1..ad5ca8e4 100644 --- a/web/scss/_reset.scss +++ b/web/scss/_reset.scss @@ -41,4 +41,9 @@ a { color: inherit; text-decoration: none; +} +input, a, button, select +{ + -webkit-appearance: none; + border-radius: 0; } \ No newline at end of file diff --git a/web/scss/_sale.scss b/web/scss/_sale.scss index 5d839eb4..201242f1 100644 --- a/web/scss/_sale.scss +++ b/web/scss/_sale.scss @@ -27,6 +27,7 @@ .sale-call { text-align: center; + font-family: $font-header; margin-bottom: $spacing-vertical / 2; .sale-call-total-people {