diff --git a/projects/templates/README.md b/projects/templates/README.md new file mode 100644 index 00000000000..c8f0389463a --- /dev/null +++ b/projects/templates/README.md @@ -0,0 +1,7 @@ +# HydePHP Page Templates + +A collection of page templates for use with HydePHP. + +Templates that are whole projects should be in their own repository but may be linked here. + +Contributions are very welcome! \ No newline at end of file diff --git a/projects/templates/dashboard.blade.php b/projects/templates/dashboard.blade.php new file mode 100644 index 00000000000..a4acced7e1a --- /dev/null +++ b/projects/templates/dashboard.blade.php @@ -0,0 +1,313 @@ +@php + use Hyde\Framework\Models\BladePage; + use Hyde\Framework\Models\MarkdownPage; + use Hyde\Framework\Models\DocumentationPage; + use Hyde\Framework\Models\MarkdownPost; + use Hyde\Framework\Services\CollectionService; + + $github = new class { + public bool $enabled; + + public function __construct() { + $this->enabled = (config('hyde.github_dashboard.enabled', false) === true) + && (config('hyde.github_dashboard.username') !== null) + && (config('hyde.github_dashboard.repository') !== null) + && (config('hyde.github_dashboard.branch') !== null); + } + + public function getLink(string $path): string { + $action = config('hyde.github_dashboard.action', 'view') === 'edit' ? 'edit' : 'blob'; + return sprintf("https://github.com/%s/%s/%s/%s/%s", + config('hyde.github_dashboard.username'), + config('hyde.github_dashboard.repository'), + $action, + config('hyde.github_dashboard.branch'), + $path + ); + } + + public function link(string $path): string { + return $this->enabled + ? ''.e($path).'' + : e($path); + } + }; +@endphp + +@extends('hyde::layouts.app') +@section('content') + @php($title = "Dashboard") + + + +
+
+

Project Dashboard

+

+ + Here you can get a quick overview of your project. + +

+

+ While this is useful when developing locally, + you may not want to use it when compiling + for production. +

+
+ +
+
+

Project Details

+
+ +
+

Installation Details

+ + + + + + + + + + + + + + + + + +
Project NameProject PathFramework VersionPHP Version
{{ config('hyde.name', Hyde::titleFromSlug(basename(Hyde::path()))) }}{{ Hyde::path() }}{{ Hyde::version() }}{{ PHP_VERSION }} ({{ PHP_SAPI }})
+ +

GitHub Integration

+ + + + + + + + + + + @if (config('hyde.github_dashboard.enabled', false)) + + + + @else + + @endif + + +
UsernameRepositoryBranch
+ + {{ config('hyde.github_dashboard.username', '') }} + + + + {{ config('hyde.github_dashboard.repository', '') }} + + + + {{ config('hyde.github_dashboard.branch', '') }} + + +

+ + GitHub Dashboard Integrations is not enabled. + +

+
+ + Show configuration guide. + +

+ The GitHub integration allows you to easily + open dashboard files in your GitHub repository. +
+ To enable it, you need to let Hyde know where + your GitHub repository is located.
+ The repository is assumed to be a top level installation of Hyde/Hyde. +
+ Add the following to your config/hyde.php file: +

+
'github_dashboard' => [
    'enabled' => true,
    'username' => 'octocat',
    'repository' => 'homepage',
    'branch' => 'main',
]
+
+
+
+
+ +
+
+

Your Content

+
+ +

Content Overview

+ + + + + + + + + + + + + + + + + +
Blade PagesMarkdown PagesDocumentation PagesBlog Posts
+ + {{ count(CollectionService::getBladePageList()) }} pages + + + + {{ count(CollectionService::getMarkdownPageList()) }} pages + + + + {{ count(CollectionService::getDocumentationPageList()) }} pages + + + + {{ count(CollectionService::getMarkdownPostList()) }} posts + +
+ +
+

+ Blade Pages + # +

+ + + + + + + + + @foreach (BladePage::all() as $page) + + + + + @endforeach + +
TitleSource File
+ + {{ Hyde::titleFromSlug($page->view) }} + + + {!! $github->link(BladePage::$sourceDirectory .'/'. $page->slug . BladePage::$fileExtension) !!} +
+
+ +
+

+ Markdown Pages + # +

+ + + + + + + + + @foreach (MarkdownPage::all() as $page) + + + + + @endforeach + +
TitleSource File
+ + {{ $page->title }} + + + {!! $github->link(MarkdownPage::$sourceDirectory .'/'. $page->slug . MarkdownPage::$fileExtension) !!} +
+
+ +
+

+ Documentation Pages + # +

+ + + + + + + + + @foreach (DocumentationPage::all() as $page) + + + + + @endforeach + +
TitleSource File
+ + {{ $page->title }} + + + {!! $github->link(DocumentationPage::$sourceDirectory .'/'. $page->slug . DocumentationPage::$fileExtension) !!} +
+
+ +
+

+ Blog Posts + # +

+ + + + + + + + + @foreach (MarkdownPost::all() as $post) + + + + + @endforeach + +
TitleSource File
+ + {{ $post->title }} + + + {!! $github->link(MarkdownPost::$sourceDirectory .'/'. $post->slug . MarkdownPost::$fileExtension) !!} +
+
+
+
+@endsection