StaticPageBuilder
in package
Compile a Laravel route into static HTML
Tags
Table of Contents
- $pageCollection : Collection
- The Collection of Pages to compile.
- __construct() : mixed
- Construct the Builder.
- buildPage() : void
- Compile the page and store it to file.
- copyAssets() : int
- Copy all the media files from the sourcePath/media directory to the buildPath/media directory.
- curlBuilder() : string
- Get the HTML using Curl. (Recommended)
- ensureDirectoryExists() : void
- Check if the build directories exists, otherwise create them.
- getContentsBuilder() : string
- Get HTML using file_get_contents (Not Recommended)
- getPageCollection() : Collection
- Get the Collection of pages using the MarkdownPageCollection interface.
- mergeStylesheets() : void
- Merge the app.css and custom.css
- startBuildLoop() : int
- Start the Build Loop.
Properties
$pageCollection
The Collection of Pages to compile.
protected
Collection
$pageCollection
Tags
Methods
__construct()
Construct the Builder.
public
__construct() : mixed
Tags
Return values
mixed —buildPage()
Compile the page and store it to file.
private
buildPage(string $slug[, string $builder = 'curl' ]) : void
Parameters
- $slug : string
-
of the page to compile
- $builder : string = 'curl'
-
which builder should be used?
Tags
Return values
void —copyAssets()
Copy all the media files from the sourcePath/media directory to the buildPath/media directory.
private
copyAssets() : int
Return values
int —$count of files copied
curlBuilder()
Get the HTML using Curl. (Recommended)
private
curlBuilder(string $url) : string
Parameters
- $url : string
Return values
string —$html
ensureDirectoryExists()
Check if the build directories exists, otherwise create them.
private
ensureDirectoryExists() : void
Return values
void —getContentsBuilder()
Get HTML using file_get_contents (Not Recommended)
private
getContentsBuilder(string $url) : string
Has issue with JavaScript needed to render the sidebar, and is thus not recommended for use. Use Curl instead.
Parameters
- $url : string
Return values
string —$html
getPageCollection()
Get the Collection of pages using the MarkdownPageCollection interface.
private
getPageCollection() : Collection
Tags
Return values
Collection —$pageCollection
mergeStylesheets()
Merge the app.css and custom.css
private
mergeStylesheets() : void
Return values
void —startBuildLoop()
Start the Build Loop.
private
startBuildLoop() : int
The loop which iterates through all the pages in the pageCollection and subsequently builds the pages.
Tags
Return values
int —$count of files built