Skip to content

Commit

Permalink
Bug fix where template wasn't found via URI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marty Wallace committed Mar 16, 2015
1 parent 4acbc90 commit bc125c3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion html/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% extends '_layouts/main.html' %}

{% block body %}
<div id="intro">
<div class="content text-center">
<p><img src="/textures/the-tempest.jpg" alt="Ivan Aivazovsky - The Tempest" title="Ivan Aivazovsky - The Tempest" /></p>

<h1>Success!</h1>
Expand Down
5 changes: 0 additions & 5 deletions sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ body {

.content {
padding: 40px 20px;
}

#intro {
padding: 40px 20px;
text-align: center;

img {
border-radius: 3px;
Expand Down
2 changes: 1 addition & 1 deletion server/tempest/Tempest/Tempest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function start()
{
// Let's peek at what templates are available in <code>/html/</code>. If we find one with a name that
// matches the request, let's use it!
$template = REQUEST_URI === '/' ? 'home' : preg_replace(Path::PATTERN_SLASHES, '-',REQUEST_URI);
$template = REQUEST_URI === '/' ? 'home' : trim(preg_replace(Path::PATTERN_SLASHES, '-',REQUEST_URI), '-');
$twigResponse = $this->twig->render($template . '.html');

if ($twigResponse !== null)
Expand Down

0 comments on commit bc125c3

Please sign in to comment.