generated from 8fold/github-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from 8fold/file-metadata-in-file-class
File metadata in file class
- Loading branch information
Showing
17 changed files
with
346 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JoshBruce\Site\Documents; | ||
|
||
use Eightfold\HTMLBuilder\Document; | ||
use Eightfold\HTMLBuilder\Element; | ||
|
||
use JoshBruce\Site\File; | ||
|
||
use JoshBruce\Site\Documents\HtmlDefault; | ||
|
||
use JoshBruce\Site\PageComponents\Navigation; | ||
|
||
use JoshBruce\Site\Content\Markdown; | ||
|
||
class FullNav | ||
{ | ||
public static function create(File $file): string | ||
{ | ||
$pageTitle = $file->pageTitle(); | ||
$html = ''; | ||
$description = ''; | ||
if ($file->isMarkdown()) { | ||
$markdown = Markdown::for( | ||
file: $file, | ||
in: $file->fileSystem() | ||
); | ||
$html = $markdown->html(); | ||
$description = $markdown->description(); | ||
} | ||
|
||
$html = Document::create( | ||
$pageTitle | ||
)->head( | ||
...HtmlDefault::baseHead($description) | ||
)->body( | ||
Element::main($html), | ||
Element::footer( | ||
Element::p( | ||
'Copyright © 2004–' . date('Y') . ' Joshua C. Bruce. ' . | ||
'All rights reserved.' | ||
) | ||
) | ||
)->build(); | ||
|
||
return $html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.