PHP code example of statamic-addon / static-publish

1. Go to this page and download the library: Download statamic-addon/static-publish 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/ */

    

statamic-addon / static-publish example snippets


Redaktør klikker Udgiv
  → static-publish:publish starter i baggrunden
  → statamic/ssg renderer hele sitet til filer
  → kontrol (én fejl stopper alt, live-sitet røres ikke)
  → wrangler deploy → Cloudflare

Besøgende sender en formular
  → POST /!/forms/{handle} på det statiske site
  → Workeren sender den videre med en hemmelig nøgle
  → POST /!/static-publish/forms/{handle} på CMS'et
  → Statamics FormController gemmer og sender mails
bash
php please static-publish:publish             # hele turen
php please static-publish:publish --no-deploy # generér og kontrollér, send ikke
php please static-publish:publish --if-due    # kun hvis en dato er blevet aktuel
php please static-publish:rollback <version>  # sæt en tidligere udgave live