Skip to content

Commit

Permalink
Improved homepage set up
Browse files Browse the repository at this point in the history
  • Loading branch information
philipobenito committed Apr 2, 2017
1 parent d1ce445 commit 9c8c5bd
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 111 deletions.
70 changes: 69 additions & 1 deletion docs/_layouts/homepage.html
Expand Up @@ -33,7 +33,75 @@ <h2>Our Packages:</h2>
</ul>
</section>

{{ content }}
<header>
<div class="inner-content">
<a href="http://thephpleague.com/" class="league">Presented by The League of Extraordinary Packages</a>
<h1>{{ site.data.project.title }}</h1>
<h2>{{ site.data.project.tagline }}</h2>
<p class="composer"><span>$ composer require league/container</span></p>
</div>
</header>

<main>
<div class="example">
<div class="inner-content">
<h1>Usage</h1>
{{ page.example | markdownify }}
</div>
</div>

<div class="highlights">
<div class="inner-content">
<div class="column one">
<h1>Highlights</h1>
<div class="description">
{{ page.description | markdownify }}
</div>
</div>
<div class="column two">
<ol>
{% for item in page.highlights %}
<li><p>{{ item }}</p></li>
{% endfor %}
</ol>
</div>
</div>
</div>

<div class="documentation">
<div class="inner-content">
<h1>Releases</h1>
{% for release in page.releases %}
<div class="version {{ release.type }}">
<h2>
{% if release.type == 'next' %}Upcoming{% endif %}
{% if release.type == 'current' %}Current Stable Release{% endif %}
{% if release.type == 'old' %}Older Release{% endif %}
{% if release.type == 'legacy' %}No Longer Supported{% endif %}
</h2>
<div class="content">
<p><code>{{ release.name }}</code></p>
<ul>
<li>Requires: <strong>{{ release.requires }}</strong></li>
<li>Latest: <strong>{{ release.release }}</strong></li>
<li>Supported Until: <strong>{{ release.support }}</strong></li>
</ul>
<p><a href="{{ release.url }}">Full Documentation</a></p>
</div>
</div>
{% endfor %}
<p class="footnote">Once a new major version is released, the previous stable release remains supported for six more months through patches and security fixes.</p>

</div>
</div>

<div class="questions">
<div class="inner-content">
<h1>Questions?</h1>
<p><strong>League\Csv</strong> was created by Phil Bennett. Find him on Twitter at <a href="https://twitter.com/philipobenito">@philipobenito</a>.</p>
</div>
</div>
</main>

<footer>
<span>&copy; Copyright <a href="http://thephpleague.com">The League of Extraordinary Packages</a>.</span>
Expand Down
153 changes: 43 additions & 110 deletions docs/index.md
@@ -1,113 +1,46 @@
---

This comment has been minimized.

Copy link
@philipobenito

philipobenito Apr 2, 2017

Author Member

@nyamsprod hope you don't mind but I liked the way you were doing docs on CSV so I've used it here. Couple of tweaks here you might be interested in.

This comment has been minimized.

Copy link
@nyamsprod

nyamsprod Apr 3, 2017

Member

@philipobenito great addition, when I have time I'll add your "markdown-ification" to my own projects.

This comment has been minimized.

Copy link
@nyamsprod

nyamsprod Apr 5, 2017

Member

@philipobenito instead of modifying the index.md I've added most of the data into the docs/_data/project.yml file. thephpleague/csv@d1d1c20 . The only remaining issue would be the example in the usage part which have to stay in the index.md.

This comment has been minimized.

Copy link
@philipobenito

philipobenito Apr 5, 2017

Author Member

I like it, if the usage code is the only content that's left, no reason that it can't be just the main content of index.md and it'll automatically be markdownified in the {{ content }} variable.

layout: homepage
releases:
- name: League\Container 3.x
type: next
requires: PHP >= 7.0.0
release: TBD
support: TBD
url: /3.x/
- name: League\Container 2.x
type: current
requires: PHP >= 5.4.0
release: 2.4.0 - 2017-03
support: TBD
url: /2.x/
- name: League\Container 1.x
type: legacy
requires: PHP >= 5.4.0
release: 1.3.2 - 2015-04
support: 2015-10
url: /1.x/
highlights:
- Simple API
- Interoperabiity. Container is an implementation of PSR-11.
- Speed. Because Container is simple, it is also very fast.
- Service Providers allow you to package code or configuration for packages that you reuse regularly.
- Inflectors allow you to manipulate objects resolved through the container based on the type.
description: |
Container is a simple but powerful dependency injection container that allows you to decouple components in your application in order to write clean and testable code.
It is framework agnostic as well as being very fast because of it's simple API.
example: |
~~~php
<?php
$container = new League\Container\Container;
// add a service to the container
$container->add('service', 'Acme\Service\SomeService');
// retrieve the service from the container
$service = $container->get('service');
var_dump($service instanceof Acme\Service\SomeService); // true
~~~
---

<header>
<div class="inner-content">
<a href="http://thephpleague.com/" class="league">
Presented by The League of Extraordinary Packages
</a>
<h1>{{ site.data.project.title }}</h1>
<h2>{{ site.data.project.tagline }}</h2>
<p class="composer"><span>$ composer require league/container</span></p>
</div>
</header>

<main>
<div class="example">
<div class="inner-content">
<h1>Usage</h1>

<div class="language-php highlighter-rouge"><pre class="highlight"><code><span class="cp">&lt;?php</span>

<span class="nv">$container</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">League\Container\Container</span><span class="p">;</span>

<span class="c1">// add a service to the container
</span><span class="nv">$container</span><span class="o">-&gt;</span><span class="na">add</span><span class="p">(</span><span class="s1">'service'</span><span class="p">,</span> <span class="s1">'Acme\Service\SomeService'</span><span class="p">);</span>

<span class="c1">// retrieve the service from the container
</span><span class="nv">$service</span> <span class="o">=</span> <span class="nv">$container</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">'service'</span><span class="p">);</span>

<span class="nb">var_dump</span><span class="p">(</span><span class="nv">$service</span> <span class="nx">instanceof</span> <span class="nx">Acme\Service\SomeService</span><span class="p">);</span> <span class="c1">// true
</span></code></pre>
</div>
</div>
</div>


<div class="highlights">
<div class="inner-content">
<div class="column one">
<h1>Highlights</h1>
<div class="description">
<p>Container is a simple but powerful dependency injection container that allows you to decouple components in your application in order to write clean and testable code.</p>
<p>It is framework agnostic as well as being very fast because of it's simple API.</p>
</div>
</div>
<div class="column two">
<ol>
<li><p>Simple API.</p></li>
<li><p>Interoperabiity. Container is an implementation of PSR-11.</p></li>
<li><p>Speed. Because Container is simple, it is also very fast.</p></li>
<li><p>Service Providers allow you to package code or configuration for packages that you reuse regularly.</p></li>
<li><p>Inflectors allow you to manipulate objects resolved through the container based on the type.</p></li>
</ol>
</div>
</div>
</div>

<div class="documentation">
<div class="inner-content">
<h1>Releases</h1>

<div class="version next">
<h2>Next/master</h2>
<div class="content">
<p><code>League\Container 3.x</code></p>
<ul>
<li>Requires: <strong>PHP >= 7.0.0</strong></li>
<li>Release Date: <strong>TBD</strong></li>
<li>Supported Until: <strong>TBD</strong></li>
</ul>
<p><a href="/3.x/">Full Documentation</a></p>
</div>
</div>

<div class="version current">
<h2>Current Stable Release</h2>
<div class="content">
<p><code>League\Container 2.x</code></p>
<ul>
<li>Requires: <strong>PHP >= 5.4.0</strong></li>
<li>Latest Release: <strong>2.4.0 - 2017-03</strong></li>
<li>Supported Until: <strong>TBD</strong></li>
</ul>
<p><a href="/2.x/">Full Documentation</a></p>
</div>
</div>

<div class="version legacy">
<h2>No longer Supported</h2>
<div class="content">
<p><code>League\Container 1.x</code></p>
<ul>
<li>Requires: <strong>PHP >= 5.4.0</strong></li>
<li>Final Release: <strong>1.3.2 - 2015-04</strong></li>
<li>Supported Until: <strong>2015-10</strong></li>
</ul>
<p><a href="/1.x/">Full Documentation</a></p>
</div>
</div>

<p class="footnote">Once a new major version is released, the previous stable release remains supported for six more months through patches and security fixes.</p>

</div>
</div>

<div class="questions">
<div class="inner-content">
<h1>Questions?</h1>
<p><strong>League\Csv</strong> was created by Phil Bennett. Find him on Twitter at <a href="https://twitter.com/philipobenito">@philipobenito</a>.</p>
</div>
</div>
</main>

0 comments on commit 9c8c5bd

Please sign in to comment.