diff --git a/config/advertising.php b/config/advertising.php new file mode 100644 index 00000000..12a62b03 --- /dev/null +++ b/config/advertising.php @@ -0,0 +1,8 @@ + [ + 'enabled' => env('HN_AD_ENABLED', true), + 'url' => env('HN_AD_URL', 'https://hardnerd.net/'), + ], +]; diff --git a/public/css/hn-article-ad.css b/public/css/hn-article-ad.css new file mode 100644 index 00000000..e556f66f --- /dev/null +++ b/public/css/hn-article-ad.css @@ -0,0 +1,14 @@ +.hn-article-ad { + position: relative; + min-width: 0; + aspect-ratio: 2.45; + margin: 20px 0; + overflow: hidden; + border: 1px solid #181b1e; + border-radius: 12px; + background: #181b1e; +} +.article-ad-group .hn-article-ad { margin: 0; } +.hn-image-ad__link { position: absolute; inset: 0; display: block; } +.hn-image-ad__link img { display: block; width: 100%; height: 100%; object-fit: cover; } +.hn-image-ad__link:focus-visible { outline: 3px solid #b4f047; outline-offset: -4px; } diff --git a/public/images/ads/hn-ad-site-style-20261028.png b/public/images/ads/hn-ad-site-style-20261028.png new file mode 100644 index 00000000..2e62a695 Binary files /dev/null and b/public/images/ads/hn-ad-site-style-20261028.png differ diff --git a/resources/views/components/hn-article-ad.blade.php b/resources/views/components/hn-article-ad.blade.php new file mode 100644 index 00000000..9db11aa3 --- /dev/null +++ b/resources/views/components/hn-article-ad.blade.php @@ -0,0 +1,12 @@ +@if (config('advertising.hn.enabled') && config('advertising.hn.url') && is_file(public_path('images/ads/hn-ad-site-style-20261028.png'))) + @once + @push('styles') + + @endpush + @endonce + +@endif diff --git a/resources/views/pages/articles/default/show.blade.php b/resources/views/pages/articles/default/show.blade.php old mode 100755 new mode 100644 index fb007c9b..8c74fc00 --- a/resources/views/pages/articles/default/show.blade.php +++ b/resources/views/pages/articles/default/show.blade.php @@ -77,6 +77,8 @@ + @include('components.hn-article-ad') +
@foreach($oArticle->oTags as $oTag)