Skip to content

Instantly share code, notes, and snippets.

@tnylea
Last active November 5, 2016 18:08
Show Gist options
  • Save tnylea/3e7b0a33eb2f532b77d95b941369c5d6 to your computer and use it in GitHub Desktop.
Save tnylea/3e7b0a33eb2f532b77d95b941369c5d6 to your computer and use it in GitHub Desktop.
Laravel Master File Head Information
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@if(isset($seo_title)){{ $seo_title . ' - Site Name' }}@else{{ 'Site Name - Default Site Headline' }}@endif</title>
<!-- only set meta description and keywords if exists -->
@if(isset($meta_description))
<meta name="description" content="{{ $meta_description }}">
@endif
@if(isset($meta_keywords))
<meta name="keywords" content="{{ $meta_keywords }}">
@endif
@if(isset($twitter_description))
<meta name="twitter:description" content="{{ $twitter_description }}">
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@twitter_user" />
@endif
@if(isset($og_title) && isset($og_image))
<meta property="og:title" content="{{ $og_title }}"/>
<meta property="og:url" content="{{ str_replace('http://', 'https://', rtrim(Request::url(), '/')) }}"/>
<meta property="og:image" content="{{ $og_image }}"/>
<meta property="og:type" content="article" />
@if(isset($og_image_width))
<meta property="og:image:width" content="{{ $og_image_width }}" />
@endif
@if(isset($og_image_height))
<meta property="og:image:height" content="{{ $og_image_height }}" />
@endif
@endif
<meta name="csrf-token" content="{{ csrf_token() }}" />
<link rel="shortcut icon" href="/assets/images/favicon.png" type="image/x-icon">
<!-- Canonical URL -->
@if(isset($canonical_url))
<link rel="canonical" href="{{ $canonical_url }}" />
@else
<!-- Canonical if you are on https:// -->
<link rel="canonical" href="{{ str_replace('http://', 'https://', rtrim(Request::url(), '/')) }}" />
<!-- Uncomment the one below for the non https version -->
<!-- link rel="canonical" href="{{ rtrim(Request::url(), '/') }}" /-->
@endif
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment