Skip to content

Commit

Permalink
LastModifiedServiceProvider: Return a Carbon instance.
Browse files Browse the repository at this point in the history
base.blade: Use app()->getLocale for a bugfix for this issue: laravel/framework#19405
Also check the environment and only add site verification meta if in production.
footer-error.blade: If running in production use HTTPS on the image URL, otherwise don't.
Also intval the year when comparing it to 2017.
Format the Carbon instance,
footer.blade: Only render social media widget buttons if in production mode.
Also intval year before comparing and format the Carbon instance.
index.blade: Bring OpenGraph title in line iwth website title.
Intval the year when comparing it to 2017.
Add sameAs meta for my social media pages.
Add a WebSite schema.
Only include the social media JavaScript if in production.
about.blade: Remove extra closing p tag.
resume.blade: Only use HTTPS if in production mode on profile image.
  • Loading branch information
brandon14 committed Jun 17, 2017
1 parent 84da073 commit 572b48d
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 15 deletions.
5 changes: 3 additions & 2 deletions app/Providers/LastModifiedServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Providers;

use Carbon\Carbon;
use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
use Illuminate\Support\ServiceProvider;
Expand Down Expand Up @@ -37,7 +38,7 @@ public function register()
/**
* Function to get the last modified file time for the web application directory.
*
* @return string
* @return \Carbon\Carbon
*/
protected function getLastModifiedDate()
{
Expand All @@ -53,6 +54,6 @@ protected function getLastModifiedDate()
}
}

return date('F jS, Y', $timeStamp).' at '.date('h:i:s A T', $timeStamp);
return Carbon::createFromTimestamp($timeStamp);
}
}
4 changes: 3 additions & 1 deletion resources/views/base.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ config('app.locale') }}" @yield('prefix', '')>
<html lang="{{ app()->getLocale() }}" @yield('prefix', '')>
<head>
<!-- General meta-data -->
<meta charset="utf-8" />
Expand All @@ -11,6 +11,7 @@

@yield('social-media-meta', '')

@if(config('app.env') === 'production')
<!-- Google site verification -->
<meta name="google-site-verification" content="IgeOtYawyBKAdF-WPySo9h_O2AL489RQlUxE4XFRqAE" />

Expand All @@ -19,6 +20,7 @@

<!-- Pinterest site verification -->
<meta name="p:domain_verify" content="b5787839fd0a4aa494bd04b4bc379e09" />
@endif

<title>@yield('title', config('app.name'))</title>

Expand Down
6 changes: 3 additions & 3 deletions resources/views/components/footer-error.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="row">
<div class="col-md-6 footer-left">
<div class="footer-icon">
<img class="profile" src="{{ asset('images/profile-small.png', true) }}" alt="Profile Image" />&nbsp;brandonclothier.me
<img class="profile" src="{{ config('app.env') === 'production' ? asset('images/profile-small.png', true) : asset('images/profile-small.png') }}" alt="Profile Image" />&nbsp;brandonclothier.me
</div>
</div>
<div class="col-md-6 footer-right">
Expand Down Expand Up @@ -39,8 +39,8 @@
<!-- End email links -->
</div>
<div id="copyright" class="copyright">
Copyright &copy; 2017{{ date('Y') > 2017 ? '-'.date('Y') : '' }} Brandon Clothier
<br/>Website last updated {{ app('lastModified') }}
Copyright &copy; 2017{{ intval(date('Y')) > 2017 ? '-'.date('Y') : '' }} Brandon Clothier
<br/>Website last updated {{ app('lastModified')->format('F jS, Y \a\t h:i:s A T') }}
</div>
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions resources/views/components/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<div class="row">
<div class="col-md-6 footer-left">
<div class="footer-icon">
<img class="profile" src="{{ asset('images/profile-small.png', true) }}" alt="Profile Image" />&nbsp;brandonclothier.me
<img class="profile" src="{{ config('app.env') === 'production' ? asset('images/profile-small.png', true) : asset('images/profile-small.png') }}" alt="Profile Image" />&nbsp;brandonclothier.me
</div>
@if(config('app.env') === 'production')
<div class="facebook-twitter-holder">
<!-- Facebook share button -->
<div class="fb-share-button" data-href="https://brandonclothier.me/" data-layout="button_count"
Expand All @@ -23,6 +24,7 @@
<a data-pin-do="buttonBookmark" data-pin-save="true" href="https://www.pinterest.com/pin/create/button/"></a>
</div>
</div>
@endif
</div>
<div class="col-md-6 footer-right">
<div class="social-buttons">
Expand Down Expand Up @@ -55,8 +57,8 @@
<!-- End email links -->
</div>
<div id="copyright" class="copyright">
Copyright &copy; 2017{{ date('Y') > 2017 ? '-'.date('Y') : '' }} Brandon Clothier
<br/>Website last updated {{ app('lastModified') }}
Copyright &copy; 2017{{ intval(date('Y')) > 2017 ? '-'.date('Y') : '' }} Brandon Clothier
<br/>Website last updated {{ app('lastModified')->format('F jS, Y \a\t h:i:s A T') }}
</div>
</div>
</div>
Expand Down
27 changes: 23 additions & 4 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- Facebook OpenGraph meta -->
<meta property="og:url" content="https://brandonclothier.me" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Brandon Clothier" />
<meta property="og:title" content="Brandon Clothier | Resume Website" />
<meta property="og:description" content="The official website resume website of Brandon Clothier." />
<meta property="og:image" content="https://brandonclothier.me/images/logo-large.png" />

Expand All @@ -39,8 +39,8 @@
<meta name="DC.subject" content="Resume, Personal Website">
<meta name="DC.language" content="{{ config('app.locale') }}">
<meta name="DC.publisher" content="Brandon Clothier">
<meta name="DC.contibutor" content="Brandon Clothier">
<meta name="DC.coverage" content="Kentucky, USA 2017{{ date('Y') > 2017 ? '-'.date('Y') : '' }}">
<meta name="DC.contributor" content="Brandon Clothier">
<meta name="DC.coverage" content="Kentucky, USA 2017{{ intval(date('Y')) > 2017 ? '-'.date('Y') : '' }}">

<!-- G+ author link -->
<link rel="author" href="https://plus.google.com/u/0/+BrandonClothier"/>
Expand All @@ -55,6 +55,23 @@
"email": "mailto:[email protected]",
"jobTitle": "Web Developer",
"image": "https://brandonclothier.me/images/profile-small.png",
"url": "https://brandonclothier.me",
"sameAs": [
"https://www.facebook.com/brandon14125",
"https://plus.google.com/+BrandonClothier",
"https://www.instagram.com/b_randon14",
"https://twitter.com/inhal3exh4le",
"https://brandon14125.tumblr.com/",
"https://www.linkedin.com/in/brandon-clothier-16190b123"
]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "brandonclothier.me",
"alternateName": "The official resume website of Brandon Clothier.",
"url": "https://brandonclothier.me"
}
</script>
Expand All @@ -74,6 +91,8 @@
@includeIf('components.footer')
@includeIf('components.app-js')
@includeIf('components.ie10-viewport-js')
@includeIf('components.social-media-js')
@if(config('app.env') === 'production')
@includeIf('components.social-media-js')
@endif
</body>
@endsection
1 change: 0 additions & 1 deletion resources/views/sections/about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<li>Modern software design patterns such as MVC and dependency injection</li>
<li>SOLID principles</li>
</ul>
</p>
</div>
</div>
<!-- End row -->
Expand Down
2 changes: 1 addition & 1 deletion resources/views/sections/resume.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="sidebar-wrapper">
<!-- Profile container -->
<div class="profile-container">
<img class="profile" src="{{ asset('images/profile-small.png', true) }}" alt="Profile Image" />
<img class="profile" src="{{ config('app.env') === 'production' ? asset('images/profile-small.png', true) : asset('images/profile-small.png') }}" alt="Profile Image" />
<h1 class="name">Brandon Clothier</h1>
<h3 class="tagline">Web Developer</h3>
</div>
Expand Down

0 comments on commit 572b48d

Please sign in to comment.