Skip to content
abenevaut edited this page Dec 6, 2024 · 5 revisions

laravel-one documentation

Laravel-one, is a tool to generate static webpages based on Blade Templates.

Install

From latest release

Laravel-one binary is available on release page

curl -L -o laravel-one https://github.com/abenevaut/laravel-one/releases/latest/download/laravel-one
chmod +x laravel-one

A hash file is available to check the integrity of the binary.

curl -L -o laravel-one https://github.com/abenevaut/laravel-one/releases/latest/download/laravel-one.sha512sum
sha512sum -c laravel-one.sha512sum

From composer

Or, you can install the tool locally or globally with composer, depending on your usage.

composer require abenevaut/laravel-one
composer global require abenevaut/laravel-one

Usage

To create a new project, you have to create the following directories & files:

Note: A bootstrap theme exists to help you to start.

  • content: Directory containing all your yaml files that contains the content of your pages
  • theme: Directory containing all your blade templates, all yaml content will be shared with templates

To create a page, you have to create a new content content/index.yml file with the following basic content:

Note: content filename will define the HTML filename, index.yml => index.html, same for subdirectories.

view: the-blade-template-to-use

key_example: "value"

To display your content, you have to create a new blade template theme/the-blade-template-to-use.blade.php file with the following basic content:

{{ $key_example }}

Content translation

  • add content/lang directory and another directory peer language like content/lang/en
  • the language namespace is content, call translation {{ \Illuminate\Support\Facades\Lang::get($readme, [], 'en') }}

Markdown content

<x-markdown>{{ $readme }}</x-markdown>

Generate the static website:

laravel-one generate https://my-website.com

All generated files are in the dist directory. A sitemap.xml file is also generated.

Clone this wiki locally