PHP code example of terdelyi / phanstatic

1. Go to this page and download the library: Download terdelyi/phanstatic library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

terdelyi / phanstatic example snippets


use Terdelyi\Phanstatic\Models\Config;
use Terdelyi\Phanstatic\Models\CollectionConfig;

return new Config(
    baseUrl: (string) getenv('BASE_URL'),
    title: 'My super-fast static site',
    collections: [
        'posts' => new CollectionConfig(
            title: 'Posts',
            slug: 'posts',
            pageSize: 10
        ),
    ],
);

<link rel="stylesheet" href=" echo asset('css/site.css'); 

php ./vendor/bin/phanstatic build

php ./vendor/bin/phanstatic preview

php ./vendor/bin/phanstatic preview --dist

├── content
│   ├── assets
│   │   ├── images
│   │   ├── css
│   │   ├── js
│   ├── collections
│   │   ├── posts
│   │   │   ├── my-first-blog-post.md
│   ├── pages
│   │   ├── _partials
│   │   │   ├── header.php
│   │   │   ├── footer.php
│   │   ├── about.php
│   │   ├── index.php
│   ├── config.php
├── composer.json
├── composer.lock