Added support for custom meta tags
Added support for custom meta tags via a new config file. Custom meta tags will only be active if "CUSTOM_META_TAGS" is set to "true" in the config. Replaced "<html lang="en">" with "@include('layouts.lang')" meaning HTML lang can be changed in the new config, defaults to en if not active or not defined.
This commit is contained in:
parent
b97a5b3eaf
commit
ca86582157
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
$analytics =
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Analytics
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Add external analytics services to your LittleLink Custom instance by adding them below.
|
||||
| Everything you enter below will be added to the <head> tag of every page.
|
||||
| Formatting in plain HTML is expected.
|
||||
|
|
||||
*/
|
||||
|
||||
<<<EOD
|
||||
<!----------Insert your analytics code here:---------->
|
||||
|
||||
<!-- Global Site Tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKING_ID"></script>
|
||||
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'TRACKING_ID');
|
||||
</script>
|
||||
|
||||
<!--------------------------------------------------->
|
||||
EOD;;
|
||||
|
||||
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default source repository type
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Will only be active if "CUSTOM_META_TAGS" is set to "true" in the config.
|
||||
| These tags will only be applied to the home page or if a LittleLink page is set as the homepage in the config
|
||||
| (For example: HOME_URL="@admin").
|
||||
|
|
||||
| Empty entries will be ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
'lang' => 'en', // Sets <html lang="en">
|
||||
'title' => 'Title', // Overrides the default meta page title. Leave empty to use your page title as the title.
|
||||
'description' => 'This is a description', // Overrides the default meta page description. Leave empty to use your page description as the description.
|
||||
'robots' => 'index,follow',
|
||||
'viewport' => 'width=device-width, initial-scale=1',
|
||||
'canonical_url' => 'https://example.com/', // Tells search engines to index "https://example.com/" instead of "https://example.com/@admin", for example.
|
||||
'twitter_creator' => '@elonmusk', // Twitter @username. For example: "@elonmusk".
|
||||
'author' => 'Julian Prieber', // Your name.
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Additional settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Empty entries will be ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
// Overwrites default theme regardless of preference defined by the operating system, unless manually overwritten by user.
|
||||
'theme' => '', // Either "dark" or "light".
|
||||
|
||||
|
||||
// Overwrites default theme regardless of preference defined by the operating system, unless manually overwritten by user.
|
||||
// Overwrites default page title after the LittleLink name on LittleLink pages.
|
||||
// Example: "admin 🔗 LittleLink Custom"
|
||||
// ⤌------------------⤍
|
||||
// ⬑ What you can change with this setting.
|
||||
'littlelink_title' => '',
|
||||
|
||||
|
||||
|
||||
// Do not change here!
|
||||
'analytics' => $analytics, // Set on top of page.
|
||||
|
||||
];
|
|
@ -1,11 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
@if(env('CUSTOM_META_TAGS') == 'true' and Config::get('meta.title') != '')
|
||||
<title>{{ Config::get('meta.title') }}</title>
|
||||
@else
|
||||
<title>{{ config('app.name') }}</title>
|
||||
@endif
|
||||
|
||||
<?php $cleaner_input = strip_tags($message->home_message); ?>
|
||||
|
||||
@if(env('CUSTOM_META_TAGS') == 'true')
|
||||
@include('layouts.meta')
|
||||
@else
|
||||
<meta name="description" content="{{ $cleaner_input }}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@endif
|
||||
|
||||
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,600,800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ asset('littlelink/css/normalize.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('littlelink/css/brands.css') }}">
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!-- Analytics -->
|
||||
<?php
|
||||
$analyticsHTML = Config::get('meta.analytics');
|
||||
$analyticsHTML = preg_replace("~<!--(.*?)-->~s", "", $analyticsHTML);
|
||||
echo $analyticsHTML;
|
||||
?>
|
||||
<!-- /Analytics -->
|
|
@ -0,0 +1,5 @@
|
|||
@if(env('CUSTOM_META_TAGS') == 'true' and Config::get('meta.lang') != '')
|
||||
<html lang="{{ Config::get('meta.lang') }}">
|
||||
@else
|
||||
@include('layouts.lang')
|
||||
@endif
|
|
@ -0,0 +1,15 @@
|
|||
@if(Config::get('meta.description') != '')<meta name="description" content="{{ Config::get('meta.description') }}">
|
||||
@elseif(Route::currentRouteName() != 'home')<meta name="description" content="{{ $userinfo->littlelink_description }}">
|
||||
@else<meta name="description" content="{{ $cleaner_input }}">@endif
|
||||
|
||||
@if(Config::get('meta.author') != '')<meta name="author" content="{{ Config::get('meta.author') }}">
|
||||
@elseif(Route::currentRouteName() != 'home')<meta name="author" content="{{ $userinfo->name }}">@endif
|
||||
|
||||
@if(Config::get('meta.viewport') != '')<meta name="viewport" content="{{ Config::get('meta.viewport') }}"/>
|
||||
@else<meta name="viewport" content="width=device-width, initial-scale=1">@endif
|
||||
|
||||
@if(Config::get('meta.robots') != '')<meta name="robots" content="{{ Config::get('meta.robots') }}">@endif
|
||||
|
||||
@if(Config::get('meta.canonical_url') != '')<link rel="canonical" href="{{ Config::get('meta.canonical_url') }}">@endif
|
||||
|
||||
@if(Config::get('meta.twitter_creator') != '')<meta name="twitter:creator" content="{{ Config::get('meta.twitter_creator') }}">@endif
|
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
<head>
|
||||
<title>Studio ⚙️ {{ config('app.name') }}</title>
|
||||
<meta charset="utf-8">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
@if(env('HOME_URL') != '')
|
||||
@if(Config::get('meta.littlelink_title') != '' and env('HOME_URL') === '')
|
||||
<title>{{ $userinfo->name }} {{ Config::get('meta.littlelink_title') }}</title>
|
||||
@elseif(env('CUSTOM_META_TAGS') == 'true' and Config::get('meta.title') != '')
|
||||
<title>{{ Config::get('meta.title') }}</title>
|
||||
@elseif(env('HOME_URL') != '')
|
||||
<title>{{ $userinfo->name }}</title>
|
||||
@else
|
||||
<title>{{ $userinfo->name }} 🔗 {{ config('app.name') }} </title>
|
||||
@endif
|
||||
|
||||
@if(env('CUSTOM_META_TAGS') == 'true')
|
||||
@include('layouts.meta')
|
||||
@else
|
||||
<meta name="description" content="{{ $userinfo->littlelink_description }}">
|
||||
<meta name="author" content="{{ $userinfo->name }}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@endif
|
||||
|
||||
<!--#### BEGIN Meta Tags social media preview images ####-->
|
||||
<!-- This shows a preview for title, description and avatar image of users profiles if shared on social media sites -->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ config('app.name') }}</title>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@include('layouts.lang')
|
||||
@if(auth()->user()->role == 'admin')
|
||||
<head>
|
||||
<!-- begin dark mode detection -->
|
||||
|
|
Loading…
Reference in New Issue