Skip to content

Commit

Permalink
Adding a site_title to wardrobe config. Fixing rss feeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlbarnes committed Jun 17, 2013
1 parent 654b6dd commit ffa80fb
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/Wardrobe/Facades/Wardrobe.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Wardrobe {
protected $postsRepo;

/**
* Create a new Home controller instance.
* Create a new wardrobe facade instance.
*
* @param Wardrobe\PostRepositoryInterface $postsRepo
* @return void
Expand Down
10 changes: 10 additions & 0 deletions app/config/wardrobe.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
*/
'theme' => 'default',

/*
|--------------------------------------------------------------------------
| Site Title
|--------------------------------------------------------------------------
|
| Set this to your sites title
|
*/
'title' => 'My Site',

/*
|--------------------------------------------------------------------------
| Posts per page
Expand Down
12 changes: 12 additions & 0 deletions app/theme_helpers.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<?php

/**
* Site Title
*
* Helper that allows you to easily get the site title
*
* @return string
*/
function site_title()
{
return Config::get('wardrobe.title');
}

/**
* Theme Path
*
Expand Down
18 changes: 9 additions & 9 deletions public/themes/blocky/atom.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{ '<' }}?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>Your Site</title>
<link href="="http://site.com/atom.xml" rel="self"/>
<link href="="http://site.com/"/>
<title>{{ site_title() }}</title>
<link href="{{ Config::get('app.url') }}/atom.xml" rel="self"/>
<link href="{{ Config::get('app.url') }}"/>
<updated>{{ $updated }}</updated>
<id>/</id>
<author>
<name>Eric Barnes</name>
</author>
<id>{{ Config::get('app.url') }}/</id>

@foreach ($posts as $post)
<entry>
<title>{{ $post->title }}</title>
<link href="http://site.com/post/{{ $post->slug }}"/>
<link href="{{ Config::get('app.url') }}/post/{{ $post->slug }}"/>
<author>
<name>{{ site_title() }}</name>
</author>
<updated>{{ $post->atom_date }}</updated>
<id>="http://site.com/post/{{ $post->slug }}</id>
<id>{{ Config::get('app.url') }}/post/{{ $post->slug }}</id>
<content type="html">{{ $post->content }}</content>
</entry>
@endforeach
Expand Down
2 changes: 1 addition & 1 deletion public/themes/blocky/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div class="container">
<header>
<h1><a href="/">Blocky Theme</a></h1>
<h1><a href="/">{{ site_title() }}</a></h1>
<nav>
<ul>
<li><a href="/archive">Posts</a></li>
Expand Down
18 changes: 9 additions & 9 deletions public/themes/default/atom.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{ '<' }}?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>Your Site</title>
<link href="="http://site.com/atom.xml" rel="self"/>
<link href="="http://site.com/"/>
<title>{{ site_title() }}</title>
<link href="{{ Config::get('app.url') }}/atom.xml" rel="self"/>
<link href="{{ Config::get('app.url') }}"/>
<updated>{{ $updated }}</updated>
<id>/</id>
<author>
<name>Eric Barnes</name>
</author>
<id>{{ Config::get('app.url') }}/</id>

@foreach ($posts as $post)
<entry>
<title>{{ $post->title }}</title>
<link href="http://site.com/post/{{ $post->slug }}"/>
<link href="{{ Config::get('app.url') }}/post/{{ $post->slug }}"/>
<author>
<name>{{ site_title() }}</name>
</author>
<updated>{{ $post->atom_date }}</updated>
<id>="http://site.com/post/{{ $post->slug }}</id>
<id>{{ Config::get('app.url') }}/post/{{ $post->slug }}</id>
<content type="html">{{ $post->content }}</content>
</entry>
@endforeach
Expand Down
2 changes: 1 addition & 1 deletion public/themes/default/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<div class="container">
<header>
<h1><a href="/">Default Theme</a></h1>
<h1><a href="/">{{ site_title() }}</a></h1>
<nav>
<ul>
<li><a href="/archive">Posts</a></li>
Expand Down
18 changes: 9 additions & 9 deletions public/themes/simple/atom.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{{ '<' }}?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>Your Site</title>
<link href="="http://site.com/atom.xml" rel="self"/>
<link href="="http://site.com/"/>
<title>{{ site_title() }}</title>
<link href="{{ Config::get('app.url') }}/atom.xml" rel="self"/>
<link href="{{ Config::get('app.url') }}"/>
<updated>{{ $updated }}</updated>
<id>/</id>
<author>
<name>Eric Barnes</name>
</author>
<id>{{ Config::get('app.url') }}/</id>

@foreach ($posts as $post)
<entry>
<title>{{ $post->title }}</title>
<link href="http://site.com/post/{{ $post->slug }}"/>
<link href="{{ Config::get('app.url') }}/post/{{ $post->slug }}"/>
<author>
<name>{{ site_title() }}</name>
</author>
<updated>{{ $post->atom_date }}</updated>
<id>="http://site.com/post/{{ $post->slug }}</id>
<id>{{ Config::get('app.url') }}/post/{{ $post->slug }}</id>
<content type="html">{{ $post->content }}</content>
</entry>
@endforeach
Expand Down
2 changes: 1 addition & 1 deletion public/themes/simple/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<div class="container">
<header>
<h1><a href="/">Default Theme</a></h1>
<h1><a href="/">{{ site_title() }}</a></h1>
<nav>
<ul>
<li><a href="/archive">Posts</a></li>
Expand Down

0 comments on commit ffa80fb

Please sign in to comment.