diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 121b5420..f58138ee 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,7 +26,10 @@ public function boot(): void private function registerSharedViewVariables(): void { - View::share('electronGitHubVersion', GitHub::electron()->latestVersion()); + View::share('electronGitHubVersion', app()->environment('production') + ? GitHub::electron()->latestVersion() + : 'dev' + ); View::share('discordLink', 'https://discord.gg/X62tWNStZK'); View::share('bskyLink', 'https://bsky.app/profile/nativephp.bsky.social'); View::share('openCollectiveLink', 'https://opencollective.com/nativephp'); diff --git a/app/Support/GitHub.php b/app/Support/GitHub.php index d0aa6763..0006f3e9 100644 --- a/app/Support/GitHub.php +++ b/app/Support/GitHub.php @@ -2,6 +2,8 @@ namespace App\Support; +use App\Support\GitHub\Release; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Http; @@ -27,18 +29,25 @@ public static function laravel(): static public function latestVersion() { - $version = Cache::remember( + $release = Cache::remember( $this->getCacheKey('latest-version'), now()->addHour(), - function () { - return $this->fetchLatestVersion(); - } + fn () => $this->fetchLatestVersion() ); - return $version['name'] ?? 'Unknown'; + return $release?->name ?? 'Unknown'; } - private function fetchLatestVersion() + public function releases(): Collection + { + return Cache::remember( + $this->getCacheKey('releases'), + now()->addHour(), + fn () => $this->fetchReleases() + ) ?? collect(); + } + + private function fetchLatestVersion(): ?Release { // Make a request to GitHub $response = Http::get('https://api.github.com/repos/'.$this->package.'/releases/latest'); @@ -48,11 +57,24 @@ private function fetchLatestVersion() return null; } - return $response->json(); + return new Release($response->json()); } private function getCacheKey(string $string): string { return sprintf('%s-%s', $this->package, $string); } + + private function fetchReleases(): ?Collection + { + // Make a request to GitHub + $response = Http::get('https://api.github.com/repos/'.$this->package.'/releases'); + + // Check if the request was successful + if ($response->failed()) { + return collect(); + } + + return collect($response->json())->map(fn (array $release) => new Release($release)); + } } diff --git a/app/Support/GitHub/Release.php b/app/Support/GitHub/Release.php new file mode 100644 index 00000000..978571b4 --- /dev/null +++ b/app/Support/GitHub/Release.php @@ -0,0 +1,92 @@ +data[$name] ?? null; + } + + public function __isset(string $name): bool + { + return isset($this->data[$name]); + } + + public function getBodyForMarkdown(): string + { + $body = $this->body; + + // Convert any URLs to Markdown links + if ($this->convertLinks) { + $body = preg_replace( + '/https?:\/\/[^\s]+\/pull\/(\d+)/', + '[#$1]($0)', + $body + ); + + $body = preg_replace( + '/(https?:\/\/(?![^\s]+\/pull\/\d+)[^\s]+)/', + '[$1]($1)', + $body + ); + } + + // Change any @ tags to markdown links to GitHub + if ($this->withUserLinks) { + $body = preg_replace( + '/@([a-zA-Z0-9_]+)/', + '[@$1](https://github.com/$1)', + $body + ); + } + + return preg_replace('/^#/m', '##', $body); + } + + public function withoutUserLinks(bool $withoutUserLinks = true): static + { + $this->withUserLinks = ! $withoutUserLinks; + + return $this; + } + + public function withoutLinkConversion(bool $convertLinks = true): static + { + $this->convertLinks = ! $convertLinks; + + return $this; + } +} diff --git a/package-lock.json b/package-lock.json index caa051c7..b922d265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "devDependencies": { "@alpinejs/collapse": "^3.14.9", "@alpinejs/persist": "^3.14.9", + "@docsearch/js": "^3.9.0", "@fontsource/poppins": "^5.2.5", "@tailwindcss/typography": "^0.5.16", "alpinejs": "^3.14.9", @@ -22,6 +23,248 @@ "vite": "^4.5.9" } }, + "node_modules/@algolia/autocomplete-core": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.9.tgz", + "integrity": "sha512-O7BxrpLDPJWWHv/DLA9DRFWs+iY1uOJZkqUwjS5HSZAGcl0hIVCQ97LTLewiZmZ402JYUrun+8NqFP+hCknlbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/autocomplete-plugin-algolia-insights": "1.17.9", + "@algolia/autocomplete-shared": "1.17.9" + } + }, + "node_modules/@algolia/autocomplete-plugin-algolia-insights": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.9.tgz", + "integrity": "sha512-u1fEHkCbWF92DBeB/KHeMacsjsoI0wFhjZtlCq2ddZbAehshbZST6Hs0Avkc0s+4UyBGbMDnSuXHLuvRWK5iDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/autocomplete-shared": "1.17.9" + }, + "peerDependencies": { + "search-insights": ">= 1 < 3" + } + }, + "node_modules/@algolia/autocomplete-preset-algolia": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.9.tgz", + "integrity": "sha512-Na1OuceSJeg8j7ZWn5ssMu/Ax3amtOwk76u4h5J4eK2Nx2KB5qt0Z4cOapCsxot9VcEN11ADV5aUSlQF4RhGjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/autocomplete-shared": "1.17.9" + }, + "peerDependencies": { + "@algolia/client-search": ">= 4.9.1 < 6", + "algoliasearch": ">= 4.9.1 < 6" + } + }, + "node_modules/@algolia/autocomplete-shared": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.9.tgz", + "integrity": "sha512-iDf05JDQ7I0b7JEA/9IektxN/80a2MZ1ToohfmNS3rfeuQnIKI3IJlIafD0xu4StbtQTghx9T3Maa97ytkXenQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@algolia/client-search": ">= 4.9.1 < 6", + "algoliasearch": ">= 4.9.1 < 6" + } + }, + "node_modules/@algolia/client-abtesting": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.23.0.tgz", + "integrity": "sha512-AyZ+9CUgWXwaaJ2lSwOJSy+/w0MFBPFqLrjWYs/HEpYMzBuFfGNZ7gEM9a7h4j7jY8hSBARBl8qdvInmj5vOEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-analytics": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.23.0.tgz", + "integrity": "sha512-oeKCPwLBnTEPF/RWr0aaJnrfRDfFRLT5O7KV0OF1NmpEXvmzLmN7RwnwDKsNtPUHNfpJ6esP9xzkPEtJabrZ2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-common": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.23.0.tgz", + "integrity": "sha512-9jacdC44vXLSaYKNLkFpbU1J4BbBPi/N7uoPhcGO//8ubRuVzigH6+RfK5FbudmQlqFt0J5DGUCVeTlHtgyUeg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-insights": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.23.0.tgz", + "integrity": "sha512-/Gw5UitweRsnyb24Td4XhjXmsx8PxFzCI0oW6FZZvyr4kjzB9ECP2IjO+PdDq1A2fzDl/LXQ+u8ROudoVnXnQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-personalization": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.23.0.tgz", + "integrity": "sha512-ivrEZBoXfDatpqpifgHauydxHEe4udNqJ0gy7adR2KODeQ+39MQeaT10I24mu+eylIuiQKJRqORgEdLZycq2qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-query-suggestions": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.23.0.tgz", + "integrity": "sha512-DjSgJWqTcsnlXEKqDsU7Y2vB/W/VYLlr6UfkzJkMuKB554Ia7IJr4keP2AlHVjjbBG62IDpdh5OkEs/+fbWsOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/client-search": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.23.0.tgz", + "integrity": "sha512-XAYWUYUhEG4OIdo/N7H/OFFRD9fokfv3bBTky+4Y4/q07bxhnrGSUvcrU6JQ2jJTQyg6kv0ke1EIfiTO/Xxb+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/ingestion": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.23.0.tgz", + "integrity": "sha512-ULbykzzhhLVofCDU1m/CqSzTyKmjaxA/z1d6o6hgUuR6X7/dll9/G0lu0e4vmWIOItklWWrhU2V8sXD0YGBIHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/monitoring": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.23.0.tgz", + "integrity": "sha512-oB3wG7CgQJQr+uoijV7bWBphiSHkvGX43At8RGgkDyc7Aeabcp9ik5HgLC1YDgbHVOlQI+tce5HIbDCifzQCIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/recommend": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.23.0.tgz", + "integrity": "sha512-4PWvCV6VGhnCMAbv2zfQUAlc3ofMs6ovqKlC/xcp7tWaucYd//piHg9CcCM4S0p9OZznEGQMRYPt2uqbk6V9vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/requester-browser-xhr": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.23.0.tgz", + "integrity": "sha512-bacOsX41pnsupNB0k0Ny+1JDchQxIsZIcp69GKDBT0NgTHG8OayEO141eFalNmGil+GXPY0NUPRpx+5s4RdhGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/requester-fetch": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.23.0.tgz", + "integrity": "sha512-tVNFREexJWDrvc23evmRgAcb2KLZuVilOIB/rVnQCl0GDbqIWJuQ1lG22HKqvCEQFthHkgVFGLYE74wQ96768g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@algolia/requester-node-http": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.23.0.tgz", + "integrity": "sha512-XXHbq2heOZc9EFCc4z+uyHS9YRBygZbYQVsWjWZWx8hdAz+tkBX/jLHM9Xg+3zO0/v8JN6pcZzqYEVsdrLeNLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -49,6 +292,57 @@ "dev": true, "license": "MIT" }, + "node_modules/@docsearch/css": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.9.0.tgz", + "integrity": "sha512-cQbnVbq0rrBwNAKegIac/t6a8nWoUAn8frnkLFW6YARaRmAQr5/Eoe6Ln2fqkUCZ40KpdrKbpSAmgrkviOxuWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@docsearch/js": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.9.0.tgz", + "integrity": "sha512-4bKHcye6EkLgRE8ze0vcdshmEqxeiJM77M0JXjef7lrYZfSlMunrDOCqyLjiZyo1+c0BhUqA2QpFartIjuHIjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@docsearch/react": "3.9.0", + "preact": "^10.0.0" + } + }, + "node_modules/@docsearch/react": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.9.0.tgz", + "integrity": "sha512-mb5FOZYZIkRQ6s/NWnM98k879vu5pscWqTLubLFBO87igYYT4VzVazh4h5o/zCvTIZgEt3PvsCOMOswOUo9yHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/autocomplete-core": "1.17.9", + "@algolia/autocomplete-preset-algolia": "1.17.9", + "@docsearch/css": "3.9.0", + "algoliasearch": "^5.14.2" + }, + "peerDependencies": { + "@types/react": ">= 16.8.0 < 20.0.0", + "react": ">= 16.8.0 < 20.0.0", + "react-dom": ">= 16.8.0 < 20.0.0", + "search-insights": ">= 1 < 3" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "search-insights": { + "optional": true + } + } + }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", @@ -586,6 +880,31 @@ "dev": true, "license": "MIT" }, + "node_modules/algoliasearch": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.23.0.tgz", + "integrity": "sha512-7TCj+hLx6fZKppLL74lYGDEltSBNSu4vqRwgqeIKZ3VQ0q3aOrdEN0f1sDWcvU1b+psn2wnl7aHt9hWtYatUUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/client-abtesting": "5.23.0", + "@algolia/client-analytics": "5.23.0", + "@algolia/client-common": "5.23.0", + "@algolia/client-insights": "5.23.0", + "@algolia/client-personalization": "5.23.0", + "@algolia/client-query-suggestions": "5.23.0", + "@algolia/client-search": "5.23.0", + "@algolia/ingestion": "1.23.0", + "@algolia/monitoring": "1.23.0", + "@algolia/recommend": "5.23.0", + "@algolia/requester-browser-xhr": "5.23.0", + "@algolia/requester-fetch": "5.23.0", + "@algolia/requester-node-http": "5.23.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, "node_modules/alpinejs": { "version": "3.14.9", "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.14.9.tgz", @@ -1846,6 +2165,17 @@ "dev": true, "license": "MIT" }, + "node_modules/preact": { + "version": "10.26.4", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.26.4.tgz", + "integrity": "sha512-KJhO7LBFTjP71d83trW+Ilnjbo+ySsaAgCfXOXUlmGzJ4ygYPWmysm77yg4emwfmoz3b22yvH5IsVFHbhUaH5w==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prettier": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", @@ -2078,6 +2408,14 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/search-insights": { + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz", + "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index 1eb7e1ed..f5c3e6c5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "devDependencies": { "@alpinejs/collapse": "^3.14.9", "@alpinejs/persist": "^3.14.9", + "@docsearch/js": "^3.9.0", "@fontsource/poppins": "^5.2.5", "@tailwindcss/typography": "^0.5.16", "alpinejs": "^3.14.9", diff --git a/public/img/sponsors/beyondcode-dark.png b/public/img/sponsors/beyondcode-dark.png deleted file mode 100644 index 8c5ddce1..00000000 Binary files a/public/img/sponsors/beyondcode-dark.png and /dev/null differ diff --git a/public/img/sponsors/beyondcode-dark.webp b/public/img/sponsors/beyondcode-dark.webp new file mode 100644 index 00000000..826f40ff Binary files /dev/null and b/public/img/sponsors/beyondcode-dark.webp differ diff --git a/public/img/sponsors/beyondcode.png b/public/img/sponsors/beyondcode.png deleted file mode 100644 index 17b6dcbc..00000000 Binary files a/public/img/sponsors/beyondcode.png and /dev/null differ diff --git a/public/img/sponsors/beyondcode.webp b/public/img/sponsors/beyondcode.webp new file mode 100644 index 00000000..c83766d0 Binary files /dev/null and b/public/img/sponsors/beyondcode.webp differ diff --git a/public/img/sponsors/borah.png b/public/img/sponsors/borah.png deleted file mode 100644 index d232097b..00000000 Binary files a/public/img/sponsors/borah.png and /dev/null differ diff --git a/public/img/sponsors/borah.webp b/public/img/sponsors/borah.webp new file mode 100644 index 00000000..61fb4016 Binary files /dev/null and b/public/img/sponsors/borah.webp differ diff --git a/resources/css/app.css b/resources/css/app.css index d66f29b8..1c94dfe5 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -8,9 +8,50 @@ } } +/* Scrollbar width */ +::-webkit-scrollbar { + height: 8px; + width: 8px; +} + +/* Scrollbar track */ +::-webkit-scrollbar-track { + background: transparent; + border-radius: 4px; +} + +::-webkit-scrollbar-thumb { + background: transparent; +} + +/* Scrollbar thumb (the draggable part) */ +::-webkit-scrollbar-thumb { + border-radius: 999px; +} + +/* Light Theme */ +::-webkit-scrollbar-thumb { + @apply bg-gray-300/80; +} + +/* Scrollbar thumb on hover */ +::-webkit-scrollbar-thumb:hover { + @apply bg-gray-300; +} + +/* Dark Theme */ +.dark ::-webkit-scrollbar-thumb { + @apply bg-cloud/60; +} + +/* Scrollbar thumb on hover */ +.dark ::-webkit-scrollbar-thumb:hover { + @apply bg-cloud; +} + /* Whole menu */ nav ul { - @apply list-none text-xl md:text-sm; + @apply list-none text-sm; } /* Categories */ @@ -136,69 +177,3 @@ nav > ul > li > ul { .prose pre code.torchlight .summary-caret { @apply mr-4; } - -:root { - --docsearch-container-background: rgba(0, 0, 0, 0.5); - --docsearch-primary-color: #a78bfa; -} - -[id='docsearch'] { - width: 100%; - @apply md:w-auto; -} - -.DocSearch-Button { - @apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-gray-700/40 transition duration-300 ease-out dark:bg-black/30; -} - -.DocSearch-Button:hover { - box-shadow: none; - @apply bg-gray-100 ring-gray-300 dark:bg-black/50 dark:ring-gray-700/70; -} - -.DocSearch-Button:hover .DocSearch-Button-Placeholder { - @apply text-black dark:text-white; -} - -.DocSearch-Button .DocSearch-Search-Icon { - height: 0.87rem; - @apply text-gray-500 dark:text-white/60; -} - -@media (max-width: 768px) { - .DocSearch-Button-Keys, - .DocSearch-Button-Placeholder { - display: block; - } -} - -.DocSearch-Button-Placeholder { - @apply hidden pr-20 text-sm text-black/60 min-[520px]:block dark:text-white/60; -} - -.DocSearch-Button-Keys { - display: flex; - min-width: auto; - - @apply ml-1 mt-1 text-sm leading-none; -} - -.DocSearch-Button-Key { - background: none; - box-shadow: none; - width: auto; - - @apply mr-0.5 font-sans; -} - -.DocSearch-Modal { - @apply text-black; -} - -.DocSearch-Screen-Icon { - display: none; -} - -.DocSearch-Input { - @apply focus-visible:outline-none; -} diff --git a/resources/css/docsearch.css b/resources/css/docsearch.css new file mode 100644 index 00000000..fd54ccdb --- /dev/null +++ b/resources/css/docsearch.css @@ -0,0 +1,66 @@ +:root { + --docsearch-container-background: rgba(0, 0, 0, 0.5); + --docsearch-primary-color: #987af1; +} + +[id='docsearch'] { + width: 100%; + @apply md:w-auto; +} + +.DocSearch-Button { + @apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-gray-700/40 transition duration-300 ease-out dark:bg-black/30; +} + +.DocSearch-Button:hover { + box-shadow: none; + @apply bg-gray-100 ring-gray-300 dark:bg-black/50 dark:ring-gray-700/70; +} + +.DocSearch-Button:hover .DocSearch-Button-Placeholder { + @apply text-black dark:text-white; +} + +.DocSearch-Button .DocSearch-Search-Icon { + height: 0.87rem; + @apply text-gray-500 dark:text-white/60; +} + +@media (max-width: 768px) { + .DocSearch-Button-Keys, + .DocSearch-Button-Placeholder { + display: block; + } +} + +.DocSearch-Button-Placeholder { + @apply hidden pl-1 pr-1 text-sm text-black/60 min-[400px]:block min-[520px]:pr-20 dark:text-white/60; +} + +.DocSearch-Button-Keys { + @apply ml-1 mt-1 hidden min-w-[auto] text-sm leading-none min-[520px]:flex; +} + +.DocSearch-Button-Key { + background: none; + box-shadow: none; + width: auto; + + @apply mr-0.5 font-sans; +} + +.DocSearch-Modal { + @apply text-black; +} + +.DocSearch-Screen-Icon { + display: none; +} + +.DocSearch-Input { + @apply focus-visible:outline-none; +} + +.DocSearch-Form { + @apply rounded-lg; +} diff --git a/resources/images/marcel2023laraconus.webp b/resources/images/marcel2023laraconus.webp new file mode 100644 index 00000000..f4f00ece Binary files /dev/null and b/resources/images/marcel2023laraconus.webp differ diff --git a/resources/js/app.js b/resources/js/app.js index e0741da9..8fe0f668 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -4,6 +4,8 @@ import Alpine from 'alpinejs' import collapse from '@alpinejs/collapse' import persist from '@alpinejs/persist' import codeBlock from './alpine/codeBlock.js' +import docsearch from '@docsearch/js' +import '@docsearch/css' import.meta.glob(['../images/**', '../svg/**']) import { animate, @@ -57,3 +59,13 @@ Alpine.magic('refAll', (el) => { Alpine.plugin(collapse) Alpine.plugin(persist) Alpine.start() + +// Docsearch +docsearch({ + appId: 'ZNII9QZ8WI', + apiKey: '9be495a1aaf367b47c873d30a8e7ccf5', + indexName: 'nativephp', + insights: true, + container: '#docsearch', + debug: false, +}) diff --git a/resources/views/components/alert-beta.blade.php b/resources/views/components/alert-beta.blade.php index 08783af6..e7cbd9ff 100644 --- a/resources/views/components/alert-beta.blade.php +++ b/resources/views/components/alert-beta.blade.php @@ -1,11 +1,11 @@