mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
more quick start fixes, /learn clean up, and restore homepage
This commit is contained in:
parent
66c6c5c39c
commit
4dde4657d9
13 changed files with 160 additions and 78 deletions
|
@ -140,7 +140,8 @@ class Controller
|
|||
}
|
||||
}
|
||||
|
||||
$router->any('/get/lbry.{ext:c}', 'DownloadActions::executeGetRedirect');
|
||||
$router->any('/get/lbry.{ext:c}', 'DownloadActions::executeGetAppRedirect');
|
||||
$router->any('/get/lbrynet.{os:c}.zip', 'DownloadActions::executeGetDaemonRedirect');
|
||||
|
||||
$router->get([ContentActions::URL_NEWS . '/{slug:c}?', 'news'], 'ContentActions::executeNews');
|
||||
$router->get([ContentActions::URL_FAQ . '/{slug:c}?', 'faq'], 'ContentActions::executeFaq');
|
||||
|
|
|
@ -50,9 +50,11 @@ class DeveloperActions extends Actions
|
|||
|
||||
public static function prepareQuickstartInstallPartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'version' => 'foo'
|
||||
];
|
||||
return $vars + ['versions' => [
|
||||
Os::OS_LINUX => Github::getDaemonReleaseProperty(OS::OS_LINUX, 'tag_name'),
|
||||
Os::OS_OSX => Github::getDaemonReleaseProperty(OS::OS_OSX, 'tag_name'),
|
||||
Os::OS_WINDOWS => Github::getDaemonReleaseProperty(OS::OS_WINDOWS, 'tag_name'),
|
||||
]];
|
||||
}
|
||||
|
||||
public static function prepareFormNewDeveloperRewardPartial(array $vars)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class DownloadActions extends Actions
|
||||
{
|
||||
public static function executeGetRedirect(string $ext)
|
||||
public static function executeGetAppRedirect(string $ext)
|
||||
{
|
||||
$uri = null;
|
||||
switch ($ext)
|
||||
|
@ -23,6 +23,19 @@ class DownloadActions extends Actions
|
|||
return Controller::redirect($uri ?: '/get', 302);
|
||||
}
|
||||
|
||||
public static function executeGetDaemonRedirect(string $os)
|
||||
{
|
||||
$uri = null;
|
||||
$oses = Os::getAll();
|
||||
|
||||
if (isset($oses[$os]))
|
||||
{
|
||||
$uri = GitHub::getDaemonDownloadUrl($os);
|
||||
}
|
||||
|
||||
return Controller::redirect($uri ?: '/quickstart', 302);
|
||||
}
|
||||
|
||||
public static function executeGet()
|
||||
{
|
||||
$email = Request::getParam('e');
|
||||
|
|
19
lib/thirdparty/Github.class.php
vendored
19
lib/thirdparty/Github.class.php
vendored
|
@ -32,7 +32,7 @@ class Github
|
|||
return null;
|
||||
}
|
||||
|
||||
public static function getDaemonDownloadUrl($os, $cache = true)
|
||||
public static function getDaemonReleaseProperty($os, $property, $isAssetProperty = false, $cache = true)
|
||||
{
|
||||
if (!in_array($os, array_keys(OS::getAll())))
|
||||
{
|
||||
|
@ -44,17 +44,13 @@ class Github
|
|||
$releaseData = static::get('/repos/lbryio/lbry/releases/latest', $cache);
|
||||
foreach ($releaseData['assets'] as $asset)
|
||||
{
|
||||
echo '<pre>';
|
||||
print_r($asset);
|
||||
echo '</pre>';
|
||||
$ext = substr($asset['name'], -4);
|
||||
if (
|
||||
($os == OS::OS_LINUX && ($ext == '.deb' || in_array($asset['content_type'], ['application/x-debian-package', 'application/x-deb']))) ||
|
||||
($os == OS::OS_OSX && ($ext == '.dmg' || in_array($asset['content_type'], ['application/x-diskcopy', 'application/x-apple-diskimage']))) ||
|
||||
($os == OS::OS_WINDOWS && $ext == '.exe')
|
||||
($os == OS::OS_LINUX && stripos($asset['browser_download_url'], 'linux') !== false) ||
|
||||
($os == OS::OS_OSX && stripos($asset['browser_download_url'], 'macos') !== false) ||
|
||||
($os == OS::OS_WINDOWS && strpos($asset['browser_download_url'], 'windows') !== false)
|
||||
)
|
||||
{
|
||||
return $asset['browser_download_url'];
|
||||
return $isAssetProperty ? $asset[$property] : $releaseData[$property];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +61,11 @@ class Github
|
|||
return null;
|
||||
}
|
||||
|
||||
public static function getDaemonDownloadUrl($os, $cache = true)
|
||||
{
|
||||
return static::getDaemonReleaseProperty($os, 'browser_download_url', true);
|
||||
}
|
||||
|
||||
public static function get($endpoint, $cache = true)
|
||||
{
|
||||
$twoHoursInSeconds = 7200;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h3 id="api">The API</h3>
|
||||
<h3 id="api">API Basics</h3>
|
||||
<p>
|
||||
When running, the LBRY daemon provides a JSON-RPC server running at <code class="code-inline">http://localhost:5279/lbryapi</code>.
|
||||
</p>
|
||||
|
@ -25,10 +25,24 @@
|
|||
"thumbnail": "https:\/\/s3.amazonaws.com\/files.lbry.io\/logo.png"
|
||||
}
|
||||
]</span></code>
|
||||
<h3>First Download</h3>
|
||||
<p>Above, we called the method <code class="code-inline"><a href="<?php echo DeveloperActions::API_DOC_URL ?>#resolve_name" class="link-primary">resolve_name</a></code> for the URL <code class="code-inline">lbry://what</code>. This returned the metadata associated with the URL.</p>
|
||||
<p>Now let's download it. This time we're going to call the method <code class="code-inline">get</code> with the same parameters.</p>
|
||||
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"name":"what"} }'
|
||||
<span class="code-bash__response">["d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"]</span></code>
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
<span class="code-bash__comment">//some response fields omitted for brevity</span>
|
||||
"claim_id": "7b670f0034d0eb119c32acfe8b19ae6622dd218f", <span class="code-bash__comment">//a claim ID is persistent for a piece of content. It stays the same if the original publisher updates the entry.</span>
|
||||
"download_directory": "/home/kauffj/Downloads",
|
||||
"download_path": "/home/kauffj/Downloads/LBRY100.mp4",
|
||||
"file_name": "LBRY100.mp4",
|
||||
"metadata": { ... }, <span class="code-bash__comment">//same dictionary as above</span>
|
||||
"outpoint": "6e224057a9dfa3417bb3890da2c4b4e9d2471641185c6c8b33cb57d61365a4f0:1", <span class="code-bash__comment">//an outpoint is a frozen-in-time pointer to a specific piece of content. It changes if the content changes.</span>
|
||||
"total_bytes": 158433904,
|
||||
"written_bytes": 0 <span class="code-bash__comment">//will increase as the file downloads</span>
|
||||
}
|
||||
]</span></code>
|
||||
<p>This file will download in the background to the <code class="code-inline">download_directory</code> specified in the returned data. Subsequent calls to <code class="code-inline">get</code> or <code class="code-inline">file_list</code> will return the status.</p>
|
||||
<p>The LBRY API consists of about 50 calls, all related to discovering, distributing, and purchasing content. <a class="link-primary" href="/api">View the full API documentation</a>.</p>
|
||||
<p>You can also list all of the commands available by calling the <span class="code-plan">help</span> command.</p>
|
||||
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"help"}'
|
||||
|
|
|
@ -38,9 +38,21 @@
|
|||
<h3>Enjoy a Hollywood Film</h3>
|
||||
<p><a href="http://www.imdb.com/title/tt1995341/" class="link-primary">It's a Disaster</a> starring David Cross is just one of tens of thousands of great pieces of content available. Check it out!</p>
|
||||
<code class="code-bash"><span class="code-bash__prompt">$</span>curl 'http://localhost:5279/lbryapi' --data '{"method":"get","params":{"name":"itsadisaster"} }'
|
||||
<span class="code-bash__response">["d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b"]</span></code>
|
||||
<span class="code-bash__response">[
|
||||
{
|
||||
<span class="code-bash__comment">//some response fields omitted for brevity</span>
|
||||
"claim_id": "bd970a51249cba542a9acfb130147294a6326ee2",
|
||||
"download_directory": "/home/kauffj/Downloads",
|
||||
"download_path": "/home/kauffj/Downloads/It's A Disaster_Feature.mp4",
|
||||
"metadata": {
|
||||
"author": "Written and directed by Todd Berger",
|
||||
"content_type": "video/mp4",
|
||||
"description": "Four couples meet for Sunday brunch only to discover they are stuck in a house together as the world may be about to end."
|
||||
}
|
||||
}
|
||||
]</span></code>
|
||||
<h3>Try the UI</h3>
|
||||
<p>LBRY comes with a UI so that normal people can use it too. You can download it <a href="https://github.com/lbryio/lbry-app/releases" class="link-primary">here</a>.</p>
|
||||
<p>LBRY comes with a fully-featured UI so that normal people can use it too. You can download it <a href="https://github.com/lbryio/lbry-app/releases" class="link-primary">here</a>.</p>
|
||||
<h3 id="community">You Did It! What's Next?</h3>
|
||||
<p>
|
||||
Start building something awesome! LBRY works as a discovery and distribution backend for everything from films to CAD files.
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
<h3>Download</h3>
|
||||
<pre class="code-bash">
|
||||
<?php echo Github::getDaemonDownloadUrl(OS::OS_LINUX) ?>
|
||||
<?php echo Github::getDaemonDownloadUrl(OS::OS_WINDOWS) ?>
|
||||
<?php echo Github::getDaemonDownloadUrl(OS::OS_OSX) ?>
|
||||
</pre>
|
||||
<table class="quickstart__table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -14,9 +9,9 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a href="https://lbry.io/get/lbry.dmg" class="link-primary">Download .dmg</a></td>
|
||||
<td><a href="https://lbry.io/get/lbry.deb" class="link-primary">Download .deb</a></td>
|
||||
<td><a href="https://lbry.io/get/lbry.msi" class="link-primary">Download .msi</a></td>
|
||||
<td><a href="/get/lbrynet.<?php echo Os::OS_OSX ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_OSX] ?></a></td>
|
||||
<td><a href="/get/lbrynet.<?php echo Os::OS_LINUX ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_LINUX] ?></a></td>
|
||||
<td><a href="/get/lbrynet.<?php echo Os::OS_WINDOWS ?>.zip" class="link-primary">Download <?php echo $versions[OS::OS_WINDOWS] ?></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php foreach([
|
||||
'/get' => __('nav.get'),
|
||||
'/learn' => __('nav.learn'),
|
||||
'/news' => __('nav.news')
|
||||
'/learn' => __('nav.learn')
|
||||
] as $url => $label): ?>
|
||||
<div class="control-item">
|
||||
<a href="<?php echo $url ?>" <?php echo $selectedItem === $url ? 'class="nav-active"' : ''?>><?php echo $label ?></a>
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
<div class="bg-image-full" style="background-color: white" <?php //style="background-image: url(https://s3.amazonaws.com/files.lbry.io/cover-home2.jpg)" ?>></div>
|
||||
<div class="bg-image-full" style="background-image: url(https://s3.amazonaws.com/files.lbry.io/cover-home2.jpg)"></div>
|
||||
<?php Response::setMetaTitle(__('title.home')) ?>
|
||||
<?php Response::setMetaDescription(__('description.home')) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => false, 'isLogoOnly' => false]) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => true]) ?>
|
||||
<main class="column-fluid">
|
||||
<div class="span12">
|
||||
<div class="cover cover-light cover-center">
|
||||
<div class="content content-wide content-light" style="max-width: 800px">
|
||||
<div class="spacer2">
|
||||
<h1 class="cover-title cover-title-flat">Content Freedom</h1>
|
||||
<h2 class="cover-subtitle cover-title-flat">Watch, read or play what you choose. Earn 100% of the price you decide.</h2>
|
||||
<h3 class="cover-subtitle cover-title-flat">You control your data. You own the network. Indeed, <em>you</em> are the network.</h3>
|
||||
<h3 class="cover-subtitle cover-title-flat">Find Hollywood films, college lessons, amazing streamers and more on the first open, global, and distributed digital bazaar.</h3>
|
||||
<div class="cover cover-dark">
|
||||
<div class="content content-wide content-dark">
|
||||
<div class="text-center">
|
||||
<h1 class="cover-title">{{global.tagline}}</h1>
|
||||
<h2 class="cover-subtitle" style="max-width: 600px; margin-left: auto; margin-right: auto">{{global.sentence}}</h2>
|
||||
</div>
|
||||
<div class="control-group spacer2 text-center">
|
||||
<div class="control-item">
|
||||
<a href="/get" class="btn-primary btn-large">Join LBRY</a>
|
||||
<a href="/get" class="btn-primary">{{global.get}}</a>
|
||||
</div>
|
||||
<div class="control-item">
|
||||
<a href="/learn" class="btn-link btn-large">{{global.learn}}</a>
|
||||
<a href="/learn" class="btn-alt">{{global.learn}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="video" style="margin-bottom: 80px">
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/DjouYBEkQPY" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<?php /*
|
||||
<div class="content content-dark">
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
|
@ -37,9 +37,8 @@
|
|||
<div class="span4 text-center">
|
||||
<a width="300" class="twitter-timeline" href="https://twitter.com/LBRYio" data-widget-id="671104143034073088">{{social.tweets}}</a>
|
||||
</div>
|
||||
</div> */ ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer', ['isDark' => false]) ?>
|
||||
</main>
|
49
view/template/page/home2.php
Normal file
49
view/template/page/home2.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
<div class="bg-image-full" style="background-color: white" <?php //style="background-image: url(https://s3.amazonaws.com/files.lbry.io/cover-home2.jpg)" ?>></div>
|
||||
<?php Response::setMetaTitle(__('title.home')) ?>
|
||||
<?php Response::setMetaDescription(__('description.home')) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => false, 'isLogoOnly' => false]) ?>
|
||||
<main class="column-fluid">
|
||||
<div class="span12">
|
||||
<div class="cover cover-light cover-center">
|
||||
<div class="content content-wide content-light" style="max-width: 800px">
|
||||
<div class="spacer2">
|
||||
<h1 class="cover-title cover-title-flat">Content Freedom</h1>
|
||||
<h2 class="cover-subtitle cover-title-flat">Watch, read or play what you choose. Earn 100% of the price you decide.</h2>
|
||||
<h3 class="cover-subtitle cover-title-flat">You control your data. You own the network. Indeed, you <em>are</em> the network.</h3>
|
||||
<h3 class="cover-subtitle cover-title-flat">Find Hollywood films, college lessons, amazing streamers and more on the first open, global, and community-controlled digital bazaar.</h3>
|
||||
</div>
|
||||
<div class="control-group spacer2 text-center">
|
||||
<div class="control-item">
|
||||
<a href="/get" class="btn-primary btn-large">Join LBRY</a>
|
||||
</div>
|
||||
<div class="control-item">
|
||||
<a href="/learn" class="btn-link btn-large">{{global.learn}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="video" style="margin: 48px 0">
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/DjouYBEkQPY" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
<?php /*
|
||||
<div class="content content-dark">
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<h3><?php echo __('email.updates') ?></h3>
|
||||
<?php echo View::render('mail/_subscribeForm', ['submitLabel' => __('email.go'), 'btnClass' => 'btn-alt']) ?>
|
||||
</div>
|
||||
<div class="span4 text-center">
|
||||
<div class="fb-page" data-href="https://www.facebook.com/lbryio" data-height="300" data-small-header="false" data-width="300"
|
||||
data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true">
|
||||
<div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/lbryio"><a href="https://www.facebook.com/lbryio">LBRY</a></blockquote></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4 text-center">
|
||||
<a width="300" class="twitter-timeline" href="https://twitter.com/LBRYio" data-widget-id="671104143034073088">{{social.tweets}}</a>
|
||||
</div>
|
||||
</div> */ ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer', ['isDark' => false]) ?>
|
|
@ -17,45 +17,39 @@
|
|||
<a href="/what" class="btn-alt"><?php echo __('learn.essay') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<div class="span4">
|
||||
<div class="cover cover-light-alt cover-light-alt-grad">
|
||||
<div class=" content content-light content-tile">
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<h3>{{learn.explore}}</h3>
|
||||
<div class="spacer1">
|
||||
<a href="/faq" class="link-primary">{{page.faq.header}}</a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="http://explorer.lbry.io" class="link-primary">{{learn.explorer}}</a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="/faq/exchanges" class="link-primary">{{learn.exchange_faq}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<h3>{{learn.nerd}}</h3>
|
||||
<p>LBRY is 100% open source in the <a class="link-primary" href="https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">Bazaar tradition</a>.</p>
|
||||
<?php echo View::render('social/_listDev') ?>
|
||||
</div>
|
||||
<div class="content content-light content-tile">
|
||||
<h3>{{learn.explore}}</h3>
|
||||
<div class="spacer1">
|
||||
<a href="/news" class="link-primary">Latest News</a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="/faq" class="link-primary">{{page.faq.header}}</a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="http://explorer.lbry.io" class="link-primary">{{learn.explorer}}</a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="/team" class="link-primary">About the Team</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<div class="span4">
|
||||
<div class="cover cover-light">
|
||||
<div class="content content-light content-tile">
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<h3><?php echo __('page.team.header') ?></h3>
|
||||
<p><?php echo __('learn.rebels') ?></p>
|
||||
<a href="/team" class="btn-alt"><?php echo __('learn.team') ?></a>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<h3>{{learn.join}}</h3>
|
||||
<?php echo View::render('social/_list') ?>
|
||||
</div>
|
||||
</div>
|
||||
<h3>{{learn.nerd}}</h3>
|
||||
<p>LBRY is 100% open source in the <a class="link-primary" href="https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">Bazaar tradition</a>.</p>
|
||||
<?php echo View::render('social/_listDev') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="cover cover-dark cover-dark-grad">
|
||||
<div class="content content-dark content-tile">
|
||||
<h3>{{learn.join}}</h3>
|
||||
<?php echo View::render('social/_list') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<div class="spacer1">
|
||||
<a href="https://slack.lbry.io" class="link-primary"><span class="icon-slack icon-fw"></span><span class="btn-label">Slack</span></a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="https://twitter.com/lbryio" class="link-primary"><span class="icon-twitter icon-fw"></span><span class="btn-label">Twitter</span></a>
|
||||
</div>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
</div>
|
||||
*/ ?>
|
||||
<div class="spacer1">
|
||||
<a href="/quickstart" class="link-primary"><span class="icon-code icon-fw"></span><span class="btn-label">Quickstart</span></a>
|
||||
<a href="/quickstart" class="link-primary"><span class="icon-fast-forward icon-fw"></span><span class="btn-label">Quickstart</span></a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="https://github.com/lbryio" class="link-primary"><span class="icon-github icon-fw"></span><span class="btn-label">{{social.github}}</span></a>
|
||||
<a href="/api" class="link-primary"><span class="icon-code icon-fw"></span><span class="btn-label">The API</span></a>
|
||||
</div>
|
||||
<div class="spacer1">
|
||||
<a href="http://slack.lbry.io" class="link-primary"><span class="icon-slack icon-fw"></span><span class="btn-label">{{social.slack}}</span></a>
|
||||
<a href="https://github.com/lbryio" class="link-primary"><span class="icon-code-fork icon-fw"></span><span class="btn-label">Source Code</span></a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue