Add (article): ai gen, front views

This commit is contained in:
2023-09-24 22:53:40 +08:00
parent 18705bd5e4
commit 322d680961
115 changed files with 9710 additions and 201 deletions

17
config/active.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Active class
|--------------------------------------------------------------------------
|
| Here you may set the class string to be returned when the provided routes
| or paths were identified as applicable for the current route.
|
*/
'class' => 'active text-primary',
];

View File

@@ -160,6 +160,7 @@
* Package Service Providers...
*/
Artesaos\SEOTools\Providers\SEOToolsServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
/*
* Application Service Providers...
@@ -169,6 +170,7 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\ViewServiceProvider::class,
])->toArray(),
/*
@@ -189,6 +191,9 @@
'JsonLd' => Artesaos\SEOTools\Facades\JsonLd::class,
'JsonLdMulti' => Artesaos\SEOTools\Facades\JsonLdMulti::class,
'SEO' => Artesaos\SEOTools\Facades\SEOTools::class,
'Image' => Intervention\Image\Facades\Image::class,
'Markdown' => GrahamCampbell\Markdown\Facades\Markdown::class,
])->toArray(),
];

14
config/dataforseo.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
return [
'login' => env('DATAFORSEO_LOGIN', 'login'),
'password' => env('DATAFORSEO_PASSWORD', 'password'),
'timeout' => 120,
'api_version' => '/v3/',
'url' => 'https://api.dataforseo.com',
];

55
config/feed.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
return [
'feeds' => [
'main' => [
/*
* Here you can specify which class and method will return
* the items that should appear in the feed. For example:
* [App\Model::class, 'getAllFeedItems']
*
* You can also pass an argument to that method. Note that their key must be the name of the parameter:
* [App\Model::class, 'getAllFeedItems', 'parameterName' => 'argument']
*/
'items' => \App\Models\Post::class.'@getFeedItems',
/*
* The feed will be available on this url.
*/
'url' => '/posts-feed',
'title' => 'Latest News from EchoSCoop',
'description' => 'Bite-sized scoop for world news.',
'language' => 'en-US',
/*
* The image to display for the feed. For Atom feeds, this is displayed as
* a banner/logo; for RSS and JSON feeds, it's displayed as an icon.
* An empty value omits the image attribute from the feed.
*/
'image' => '',
/*
* The format of the feed. Acceptable values are 'rss', 'atom', or 'json'.
*/
'format' => 'atom',
/*
* The view that will render the feed.
*/
'view' => 'feed::atom',
/*
* The mime type to be used in the <link> tag. Set to an empty string to automatically
* determine the correct value.
*/
'type' => '',
/*
* The content type for the feed response. Set to an empty string to automatically
* determine the correct value.
*/
'contentType' => '',
],
],
];

View File

@@ -56,6 +56,18 @@
'throw' => false,
],
'r2' => [
'driver' => 's3',
'key' => env('CLOUDFLARE_R2_ACCESS_KEY_ID'),
'secret' => env('CLOUDFLARE_R2_SECRET_ACCESS_KEY'),
'region' => env('CLOUDFLARE_R2_REGION'),
'bucket' => env('CLOUDFLARE_R2_BUCKET'),
'url' => env('CLOUDFLARE_R2_URL'),
'visibility' => 'public',
'endpoint' => env('CLOUDFLARE_R2_ENDPOINT'),
'use_path_style_endpoint' => env('CLOUDFLARE_R2_USE_PATH_STYLE_ENDPOINT', false),
'throw' => true,
],
],
/*

156
config/markdown.php Normal file
View File

@@ -0,0 +1,156 @@
<?php
declare(strict_types=1);
/*
* This file is part of Laravel Markdown.
*
* (c) Graham Campbell <hello@gjcampbell.co.uk>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Enable View Integration
|--------------------------------------------------------------------------
|
| This option specifies if the view integration is enabled so you can write
| markdown views and have them rendered as html. The following extensions
| are currently supported: ".md", ".md.php", and ".md.blade.php". You may
| disable this integration if it is conflicting with another package.
|
| Default: true
|
*/
'views' => true,
/*
|--------------------------------------------------------------------------
| CommonMark Extensions
|--------------------------------------------------------------------------
|
| This option specifies what extensions will be automatically enabled.
| Simply provide your extension class names here.
|
| Default: [
| League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension::class,
| League\CommonMark\Extension\Table\TableExtension::class,
| ]
|
*/
'extensions' => [
League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension::class,
League\CommonMark\Extension\Table\TableExtension::class,
],
/*
|--------------------------------------------------------------------------
| Renderer Configuration
|--------------------------------------------------------------------------
|
| This option specifies an array of options for rendering HTML.
|
| Default: [
| 'block_separator' => "\n",
| 'inner_separator' => "\n",
| 'soft_break' => "\n",
| ]
|
*/
'renderer' => [
'block_separator' => "\n",
'inner_separator' => "\n",
'soft_break' => "\n",
],
/*
|--------------------------------------------------------------------------
| Commonmark Configuration
|--------------------------------------------------------------------------
|
| This option specifies an array of options for commonmark.
|
| Default: [
| 'enable_em' => true,
| 'enable_strong' => true,
| 'use_asterisk' => true,
| 'use_underscore' => true,
| 'unordered_list_markers' => ['-', '+', '*'],
| ]
|
*/
'commonmark' => [
'enable_em' => true,
'enable_strong' => true,
'use_asterisk' => true,
'use_underscore' => true,
'unordered_list_markers' => ['-', '+', '*'],
],
/*
|--------------------------------------------------------------------------
| HTML Input
|--------------------------------------------------------------------------
|
| This option specifies how to handle untrusted HTML input.
|
| Default: 'strip'
|
*/
'html_input' => 'strip',
/*
|--------------------------------------------------------------------------
| Allow Unsafe Links
|--------------------------------------------------------------------------
|
| This option specifies whether to allow risky image URLs and links.
|
| Default: true
|
*/
'allow_unsafe_links' => true,
/*
|--------------------------------------------------------------------------
| Maximum Nesting Level
|--------------------------------------------------------------------------
|
| This option specifies the maximum permitted block nesting level.
|
| Default: PHP_INT_MAX
|
*/
'max_nesting_level' => PHP_INT_MAX,
/*
|--------------------------------------------------------------------------
| Slug Normalizer
|--------------------------------------------------------------------------
|
| This option specifies an array of options for slug normalization.
|
| Default: [
| 'max_length' => 255,
| 'unique' => 'document',
| ]
|
*/
'slug_normalizer' => [
'max_length' => 255,
'unique' => 'document',
],
];

9
config/platform/ai.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
return [
'openai' => [
'api_key' => env('OPENAI_API_KEY'),
],
];

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
<?php
return [
'news' => [
'news_serp' => [
'path' => '/datasets/news_serp/',
'driver' => 'r2',
'file_prefix' => 'news-serp-',
],
'images_serp' => [
'path' => '/datasets/images_serp/',
'driver' => 'r2',
'file_prefix' => 'images-serp-',
],
],
];

View File

@@ -30,6 +30,14 @@
'connections' => [
'default' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'sync' => [
'driver' => 'sync',
],

57
config/sitemap.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
use GuzzleHttp\RequestOptions;
use Spatie\Sitemap\Crawler\Profile;
return [
/*
* These options will be passed to GuzzleHttp\Client when it is created.
* For in-depth information on all options see the Guzzle docs:
*
* http://docs.guzzlephp.org/en/stable/request-options.html
*/
'guzzle_options' => [
/*
* Whether or not cookies are used in a request.
*/
RequestOptions::COOKIES => true,
/*
* The number of seconds to wait while trying to connect to a server.
* Use 0 to wait indefinitely.
*/
RequestOptions::CONNECT_TIMEOUT => 10,
/*
* The timeout of the request in seconds. Use 0 to wait indefinitely.
*/
RequestOptions::TIMEOUT => 10,
/*
* Describes the redirect behavior of a request.
*/
RequestOptions::ALLOW_REDIRECTS => false,
],
/*
* The sitemap generator can execute JavaScript on each page so it will
* discover links that are generated by your JS scripts. This feature
* is powered by headless Chrome.
*/
'execute_javascript' => false,
/*
* The package will make an educated guess as to where Google Chrome is installed.
* You can also manually pass its location here.
*/
'chrome_binary_path' => null,
/*
* The sitemap generator uses a CrawlProfile implementation to determine
* which urls should be crawled for the sitemap.
*/
'crawl_profile' => Profile::class,
];