Skip to content

Commit

Permalink
chore: add support to Open Graph
Browse files Browse the repository at this point in the history
Ref: https://opengraph.dev

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Aug 1, 2024
1 parent c0b53d2 commit 819dba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions source/_layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
<title>{{ $page->title }}</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
@if (!empty($og_image))
<meta property="og:image" content="{{ $og_image }}"/>
@else
<meta property="og:image" content="{{ $page->baseUrl }}assets/images/coop.png"/>
@endif
<meta property="og:url" content="{{ $page->getUrl() }}">
<meta property="og:type" content="website">
<meta property="og:title" content="LibreCode">
<meta property="og:description" content="{{ $page->description }}">

<link rel="canonical" href="{{ $page->getUrl() }}">
<meta name="description" content="{{ $page->description }}">

Expand Down
2 changes: 1 addition & 1 deletion source/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@extends('_layouts.main')
@extends('_layouts.main', ['og_image' => $page->baseUrl . 'assets/images/coop.png'])

@section('body')
<!--==========================
Expand Down

0 comments on commit 819dba5

Please sign in to comment.