generated from boboko/starter
stoic settings and site meta and legal
This commit is contained in:
@@ -38,6 +38,18 @@ public function get(string $key, mixed $default = null): mixed
|
|||||||
return filled($this->data[$key] ?? null) ? $this->data[$key] : $default;
|
return filled($this->data[$key] ?? null) ? $this->data[$key] : $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Absolute og:image URL for a Stoic image field value (the page's own, else
|
||||||
|
* this file's default), or null. Image fields store a comma-separated list;
|
||||||
|
* only the first is used.
|
||||||
|
*/
|
||||||
|
public function ogImageUrl(?string $pageImage = null): ?string
|
||||||
|
{
|
||||||
|
$filename = trim(explode(',', $pageImage ?: (string) $this->get('og_image', ''))[0]);
|
||||||
|
|
||||||
|
return $filename === '' ? null : url(Stoic::image($filename, 'large'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only the networks that have a URL set, in display order.
|
* Only the networks that have a URL set, in display order.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
meta_description: ""
|
meta_description: "Your local 3Dealer of 3D printed, high-quality products. Geek culture, decoration, fun and skulls, and custom orders."
|
||||||
facebook_url: ""
|
og_image: ""
|
||||||
instagram_url: ""
|
facebook_url: "https://www.facebook.com/3Dealer.gr/"
|
||||||
tiktok_url: ""
|
instagram_url: "https://www.instagram.com/3dealer.gr/"
|
||||||
|
tiktok_url: "https://www.tiktok.com/@3dealer.gr"
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ schemas:
|
|||||||
- name: meta_description
|
- name: meta_description
|
||||||
label: "Default Meta Description (used when a page has none)"
|
label: "Default Meta Description (used when a page has none)"
|
||||||
ui: text
|
ui: text
|
||||||
|
- name: og_image
|
||||||
|
label: "Default Og Image (used when a page has none, ideally 1200×630)"
|
||||||
|
ui: image
|
||||||
- name: facebook_url
|
- name: facebook_url
|
||||||
label: Facebook URL
|
label: Facebook URL
|
||||||
ui: string
|
ui: string
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
@section('title', $page->meta_title)
|
@section('title', $page->meta_title)
|
||||||
@section('description', $page->meta_description)
|
@section('description', $page->meta_description)
|
||||||
|
@section('og_image', $page->og_image)
|
||||||
|
|
||||||
{{-- Organization structured data, home page only. Name from core's StoreDetails,
|
{{-- Organization structured data, home page only. Name from core's StoreDetails,
|
||||||
social profiles (sameAs) from Stoic settings.md. --}}
|
social profiles (sameAs) from Stoic settings.md. --}}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
{{-- Falls back to Stoic's default when a page sets none, or sets it to an
|
{{-- Falls back to Stoic's default when a page sets none, or sets it to an
|
||||||
empty meta_description (@yield's own default only covers "not set"). --}}
|
empty meta_description (@yield's own default only covers "not set"). --}}
|
||||||
<meta name="description" content="{{ trim($__env->yieldContent('description')) ?: $stoicSettings->get('meta_description', '') }}">
|
<meta name="description" content="{{ trim($__env->yieldContent('description')) ?: $stoicSettings->get('meta_description', '') }}">
|
||||||
|
{{-- A page's own Stoic og_image (via @section('og_image')), else the default from settings.md. --}}
|
||||||
|
@if ($ogImage = $stoicSettings->ogImageUrl(trim($__env->yieldContent('og_image'))))
|
||||||
|
<meta property="og:image" content="{{ $ogImage }}">
|
||||||
|
@endif
|
||||||
|
|
||||||
{{-- Reciprocal hreflang: self-reference + every alternate locale + x-default --}}
|
{{-- Reciprocal hreflang: self-reference + every alternate locale + x-default --}}
|
||||||
@isset($currentLocale)
|
@isset($currentLocale)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
@section('title', $page->meta_title ?: $page->name)
|
@section('title', $page->meta_title ?: $page->name)
|
||||||
@section('description', $page->meta_description)
|
@section('description', $page->meta_description)
|
||||||
|
@section('og_image', $page->og_image)
|
||||||
|
|
||||||
@if($page->noindex ?? false)
|
@if($page->noindex ?? false)
|
||||||
@push('seo')
|
@push('seo')
|
||||||
|
|||||||
Reference in New Issue
Block a user