The official Statamic 3 static site generator package

Overview

Statamic Static Site Generator

Generate static sites with Statamic 3.

Statamic 3.0+

Installation

Install the package using Composer:

composer require statamic/ssg

If you want or need to customize the way the site is generated, you can do so by publishing and modifying the config file with the following command:

php artisan vendor:publish --provider="Statamic\StaticSite\ServiceProvider"

The config file will be in config/statamic/ssg.php. This is optional and you can do it anytime.

Usage

Run the following command:

php please ssg:generate

Your site will be generated into a directory which you can deploy however you like. See Deployment Examples below for inspiration.

Multiple Workers

For improved performance, you may spread the page generation across multiple workers. This requires Spatie's Fork package. Then you may specify how many workers are to be used. You can use as many workers as you have CPU cores.

composer require spatie/fork
php please ssg:generate --workers=4

Routes

Routes will not automatically be generated. You can add any additional URLs you wish to be generated by adding them to the urls array in the config file.

'urls' => [
    '/this-route',
    '/that-route',
],

You can also exclude single routes, or route groups with wildcards. This will override anything in the urls config.

'exclude' => [
    '/secret-page',
    '/cheat-codes/*',
],

Dynamically adding routes

You may add URLs dynamically by providing a closure that returns an array to the addUrls method.

use Statamic\StaticSite\SSG;

class AppServiceProvider extends Provider
{
    public function boot()
    {
        SSG::addUrls(function () {
            return ['/one', '/two'];
        });
    }
}

Post-generation callback

You may optionally define extra steps to be executed after the site has been generated.

use Statamic\StaticSite\SSG;

class AppServiceProvider extends Provider
{
    public function boot()
    {
        SSG::after(function () {
            // eg. copy directory to some server
        });
    }
}

Triggering Command Failures

If you are using the SSG in a CI environment, you may want to prevent the command from succeeding if any pages aren't generated (e.g. to prevent deployment of an incomplete site).

By default, the command will finish and exit with a success code even if there were un-generated pages. You can tell configure the SSG to fail early on errors, or even on warnings.

'failures' => 'errors', // or 'warnings'

Deployment Examples

These examples assume your workflow will be to author content locally and not using the control panel in production.

Deploy to Netlify

Deployments are triggered by committing to Git and pushing to GitHub.

  • Create a site in your Netlify account
  • Link the site to your desired GitHub repository
  • Add build command php please ssg:generate (if you need to compile css/js, be sure to add that command too. e.g. php please ssg:generate && npm install && npm run prod).
  • Set publish directory storage/app/static

After your site has an APP_URL...

  • Set it as an environment variable. Add APP_URL https://thats-numberwang-47392.netlify.com

Finally, generate an APP_KEY to your .env file locally using php artisan key:generate and copy it's value, then...

  • Set it as an environment variable. Add APP_KEY [your app key value]

S3 Asset Containers

If you are storing your assets in an S3 bucket, the .envs used will need to be different to the defaults that come with Laravel, as they are reserved by Netlify. For example, you can amend them to the following:

# .env
AWS_S3_ACCESS_KEY_ID=
AWS_S3_SECRET_ACCESS_KEY=
AWS_S3_DEFAULT_REGION=
AWS_S3_BUCKET=
AWS_URL=

Be sure to also update these in your s3 disk configuration:

// config/filesystems.php
's3' => [
    'driver' => 's3',
    'key' => env('AWS_S3_ACCESS_KEY_ID'),
    'secret' => env('AWS_S3_SECRET_ACCESS_KEY'),
    'region' => env('AWS_S3_DEFAULT_REGION'),
    'bucket' => env('AWS_S3_BUCKET'),
    'url' => env('AWS_URL'),
],

Deploy to Vercel

Deployments are triggered by committing to Git and pushing to GitHub.

  • Create a new file called ./build.sh and paste the code snippet below.
  • Run chmod +x build.sh on your terminal to make sure the file can be executed when deploying.
  • Import a new site in your Vercel account
  • Link the site to your desired GitHub repository
  • Add build command ./build.sh
  • Set output directory to storage/app/static
  • Add environment variable in your project settings: APP_KEY <copy & paste from dev>

Code for build.sh

Add the following snippet to build.sh file to install PHP, Composer, and run the ssg:generate command:

#!/bin/sh

# Install PHP & WGET
yum install -y amazon-linux-extras
amazon-linux-extras enable php7.4
yum clean metadata
yum install php php-{common,curl,mbstring,gd,gettext,bcmath,json,xml,fpm,intl,zip,imap}
yum install wget

# INSTALL COMPOSER
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
    >&2 echo 'ERROR: Invalid installer checksum'
    rm composer-setup.php
    exit 1
fi

php composer-setup.php --quiet
rm composer-setup.php

# INSTALL COMPOSER DEPENDENCIES
php composer.phar install

# GENERATE APP KEY
php artisan key:generate

# BUILD STATIC SITE
php please ssg:generate

Deploy to Surge

Prerequisite: Install with npm install --global surge. Your first deployment will involve creating an account via command line.

  • Build with command php please ssg:generate
  • Deploy with surge storage/app/static

Deploy to Firebase hosting

Prerequisite: Follow the instructions to get started with Firebase hosting

  • Once hosting is set up, make sure the public config in your firebase.json is set to storage/app/static
  • (Optionally) Add a predeploy config to run php please ssg:generate
  • Run firebase deploy
Comments
  • Multisite SSG is taking an exponential amount of time to generate

    Multisite SSG is taking an exponential amount of time to generate

    I'm almost done working on an update to my website with more languages and I noticed SSG started taking an exponential amount of time to generate the site. At the moment I can get to 14 or 15 pages before it freezes. I also tried this on my linux desktop and had the same problem.

    Screenshot 2022-10-13 at 11 56 16

    I'm trying to figure out what's going on, the update itself didn't include much change except adding more translated content, using the language files more and the {{ trans }} tag, and using Statamic navigation... however I tried caching the nav tags and that didn't seem to help.

    If I only generate English files it seems fine:

    Screenshot 2022-10-13 at 12 08 03

    I thought it might be an antlers bug by using too many partials but even if I use an empty layout it still slows down.

    <!DOCTYPE html>
    <html lang="{{ locale }}" dir="{{ site:direction ?? 'ltr' }}">
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
        <!-- empty body -->
    </body>
    </html>
    

    And here's the result, which is the same... ๐Ÿ˜•

    Screenshot 2022-10-13 at 13 46 11

    opened by tao 23
  • Call to a member function absoluteUrl() on null

    Call to a member function absoluteUrl() on null

    It seems like since updating I'm having an issue with this absoluteUrl method:

    Gathering content to be generated...
    
       Error
    
      Call to a member function absoluteUrl() on null
    
      at vendor/statamic/cms/src/Routing/Routable.php:59
         55โ–•
         56โ–•     public function absoluteUrlWithoutRedirect()
         57โ–•     {
         58โ–•         $url = vsprintf('%s/%s', [
      โžœ  59โ–•             rtrim($this->site()->absoluteUrl() ?? '/', '/'),
         60โ–•             ltrim($this->uri(), '/'),
         61โ–•         ]);
         62โ–•
         63โ–•         return $url === '/' ? $url : rtrim($url, '/');
    
          +5 vendor frames
      6   [internal]:0
          Illuminate\Support\Collection::Illuminate\Support\Traits\{closure}(Object(Statamic\StaticSite\Page))
    
          +23 vendor frames
      30  please:37
          Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    

    If I do a quick modification to the function to test $this->site() is not null before calling ->absoluteUrl() then it seems to work not throw this error anymore.

       public function absoluteUrlWithoutRedirect()
       {
           $absoluteUrl = '/';
           if ($this->site()) { $absoluteUrl = $this->site()->absoluteUrl(); }
    
           $url = vsprintf('%s/%s', [
               rtrim($absoluteUrl, '/'),
               ltrim($this->uri(), '/'),
           ]);
    
           return $url === '/' ? $url : rtrim($url, '/');
       }
    

    But after over-coming the first one I'm also getting this error on random pages during generation... so $site is null is causing a larger issue in other classes too?

       Error
    
      Call to a member function handle() on null
    
      at vendor/statamic/ssg/src/Generator.php:355
        351โ–•     }
        352โ–•
        353โ–•     protected function updateCurrentSite($site)
        354โ–•     {
      โžœ 355โ–•         Site::setCurrent($site->handle());
        356โ–•         Cascade::withSite($site);
        357โ–•
        358โ–•         // Set the locale for dates, carbon, and for the translator.
        359โ–•         // This is what happens in Statamic's Localize middleware.
    
          +22 vendor frames
      23  please:37
    

    As well as this one at the end:

    [โœ”] Generated 2105 content files
    
       TypeError
    
      Cannot access offset of type string on string
    
      at vendor/statamic/ssg/src/Generator.php:270
        266โ–•         Partyline::line("\x1B[1A\x1B[2K[โœ”] Generated {$results->sum('count')} content files");
        267โ–•
        268โ–•         if ($results->sum('skips')) {
        269โ–•             $results->reduce(function ($carry, $item) {
      โžœ 270โ–•                 return $carry->merge($item['errors']);
        271โ–•             }, collect())->each(function ($error) {
        272โ–•                 Partyline::line($error);
        273โ–•             });
        274โ–•         }
    
          +18 vendor frames
      19  please:37
          Illuminate\Foundation\Console\Kernel::handle()
    
    opened by tao 12
  • Images not being generated

    Images not being generated

    This is a recent issue (like, has only been a problem in the last couple of weeks).

    Running php please ssg:generate isn't generating the image files for newly added content. Anything older than a couple of weeks ago is working fine, but anything added in the last couple of weeks fails to create.

    For clarity, the local "live" version of the site works fine, the static version is missing the new images.

    No idea where to start debugging this - any pointers/things I can try?

    opened by andylarkum 11
  • Multisite Non-localised content leaking through

    Multisite Non-localised content leaking through

    I have a multisite website set up with a number of sites, but only some of the content is localised. My homepage has an entries field, that displays in a table. On the live site, the entries that have not been localised do not show up, until we go into the dashboard and create a localised version. When I generate the SSG, however, the generated localised page shows the original locale version of those entries in the table, rather than not showing.

    Live version: image

    SSG Version: image

    Interestingly, if I remove one of the entries on a localised page, it disappears in the SSG, though the others still remain the original locale. Also, even if I have a localised version of an entry, that isn't used, and the original locale entries are shown instead.

    This is running on PHP8, Statamic 3.1.32, SSG 0.6.0 - not sure what other information is helpful!

    opened by adnweedon 8
  • Slow when using Glide with S3

    Slow when using Glide with S3

    This is not really unexpected since its gotta read the images from S3.

    But, I thought if I keep the glide cached images around, it would be fast. This isn't true because we create a separate Glide cache inside the ssg output directory.

    https://github.com/statamic/ssg/blob/aa9c1436924c9269eda42a27930c46398c301dbd/src/Generator.php#L101-L103

    Maybe there can be a "before" step where it copies the cached files over. I tried doing it manually, and it clears out the directory. Might be something that Flysystem does? Not sure.

    opened by jasonvarga 6
  • Multiple blueprints use using the same template with different fieds leak data

    Multiple blueprints use using the same template with different fieds leak data

    If multiple blueprints use the same template but don't have all the same fields, it is possible for data from one collection to leak into another.

    The result of this for me was data from one page showing up on another.

    The temp patch was to cross-add the missing types to the inverse pages and my problem was fixed

    opened by RussBrown00 6
  • Update Netlify setup docs

    Update Netlify setup docs

    When using PHP_VERSION: 7.2, I get the following error:

    mockery/mockery 1.4.2 requires php ^7.3 || ^8.0 -> your PHP version (7.2.32) does not satisfy that requirement.

    Switching to 7.4 fixes this.

    opened by simonhamp 6
  • Allow only recent content to be generated

    Allow only recent content to be generated

    This allows you to specify a time window to generate content, for example you may only want to generate collection content that was updated in the last 24 hours (nightly deploys) or if you want to generate content with a custom time window.

    This is useful for me as I can sync content to AWS S3 and it only syncs files that are new (without deleting old ones). This works well for my site because I have 8000+ journal entries going back to 1980s. To generate these with SSG takes 3+ hours, but with this new time window I can generate only the new updates in the last day (or longer) and sync them.

    php please ssg:generate --recent
    php please ssg:generate --recent --since
    php please ssg:generate --recent --since="2 weeks"
    php please ssg:generate --recent --since="1 month"
    php please ssg:generate --recent --since="1 month and 4 days"
    

    This will still generate pages in the default pages collection, and as merge($this->urls()) has been moved to after merging content, you can also force content with a specific url even if it hasn't been updated recently (may be useful for testing).

    For example, the ssg output if I use this would be:

    $ php please ssg:generate --recent --since="3 days"
    
    Generating collections updated in the last 3 days
    [โœ”] /
    [โœ”] /about
    [โœ”] /about/history
    [โœ”] /connect
    [โœ”] /copyright
    [โœ”] /journals
    [โœ”] /journals/2020/08/03    // new content
    [โœ”] /journals/2020/08/02    // new content
    [โœ”] /journals/2020/08/01    // new content
    [โœ”] /connect
    [โœ”] /news
    [โœ”] /news/racial-injustice   // content updated recently
    [โœ”] /library/interviews
    [โœ”] /library/interviews/qa-in-rome             // new content
    [โœ”] /library/interviews/the-pizza-revolution   // edited recently
    
    opened by tao 6
  • Antler stacks are broken

    Antler stacks are broken

    I have a {{ stack:scripts }} tag in my main layout and a few pages with:

    {{ push:scripts }}
    <script defer src="{{ mix src='js/parallax.js' }}"></script>
    {{ /push:scripts }}
    

    When my site is server rendered, stacks work as expected, I see a single <script> tag rendered in my layout. However when I run SSG the same page will end up with repeated script tags like this:

    <script defer src="/js/parallax.js"></script>
    <script defer src="/js/parallax.js"></script>
    <script defer src="/js/parallax.js"></script>
    

    It appears that the same stack is repeatedly pushed to on every page that SSG creates. I think the stacking context needs to be cleared before each new page is rendered.

    opened by imacrayon 5
  • Netlify: PHP Fatal error:  require(): Failed opening required '/opt/build/repo/vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/build/repo/please on line 18

    Netlify: PHP Fatal error: require(): Failed opening required '/opt/build/repo/vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/build/repo/please on line 18

    php please ssg:generate command working fine locally but failing in netlify deploy with the errors below. I was using Statamic 3.0 and it was working fine, but today I upgraded to 3.3 and getting errors.

    PHP Warning: require(/opt/build/repo/vendor/autoload.php): failed to open stream: No such file or directory in /opt/build/repo/please on line 18 PHP Fatal error: require(): Failed opening required '/opt/build/repo/vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/build/repo/please on line 18

    "statamic/cms": "^3.3", "statamic/ssg": "^1.0",

    opened by devfaysal 5
  • Make reusing Glide cache directory easier

    Make reusing Glide cache directory easier

    This PR helps improve the situation with these two issues https://github.com/statamic/ssg/issues/55 https://github.com/statamic/ssg/issues/56

    Most of my thinking is already written in #55 but I will outline it again. I have made reusing Glide cache directory easier by:

    1. Moving content generation step after files/dirs have been copied or symlinked.
    2. Allow to skip clearing SSG output directory via config option

    Both things give more freedom for developers to move/copy/symlink any content in the output directory. First one is useful if you are just using the ssg.php config file to copy the cache. The second one is useful if you are copying cache outside and before the ssg:generate step.

    There is no issue with Glide/Flysystem as Jason initially thought (phew!)

    I also added instructions on how to reuse cache easily on Netlify. I do this for one of my sites already and I saw about 66% decrease in build times. :rocket: I have a lot of Glide manipulations.

    opened by ncla 5
  • FR: Fieldtype to trigger generation

    FR: Fieldtype to trigger generation

    It would be nice if there could be the option for adding a button to trigger generation. Together with the SSG::after hook this should allow for some automatic deployment for example using netlify deploy. Ideally some visual feedback could be provided.

    opened by el-schneider 0
  • "Unable to read file from location" error, not generating pages

    When I generate my site locally, everything works fine.

    When Netlify does it, I get this error:

    11:14:18 AM: [โœ˜] / (Unable to read file from location: containers/assets/site/michael.png/a8387161c6052716c24530f8fef34a20.png.)
    11:14:18 AM: [โœ˜] /blog/how-to-lazy-load-google-analytics (Unable to read file from location: containers/assets/blog/google-analytics.png/666b57a1a7d9a1c90dc50b640ab820bf.png.)
    

    As a result, the pages where "michael.png" and "how-to-lazy-load-google-analytics" don't generate:

    11:14:18 AM: [!] 2/4 pages not generated

    Not sure what to do, I've been looking things up and tinkering here and there, but can't seem to find a fix.

    opened by michaelmannucci 0
  • Generation fails using {{ glide:asset_field }} tag pair, produces

    Generation fails using {{ glide:asset_field }} tag pair, produces "Unable to copy file from source:// to cache://" error

    Reproducible repository (branch: ssg-glide-cache-bug): https://github.com/ncla/statamic-bugs/tree/ssg-glide-cache-bug

    To reproduce, simply have an asset field, and have such templating:

    {{ glide:assets_field }}
            {{ height }}
            {{ width }}
    {{ /glide:assets_field }}
    

    Then run commands in such order:

    php please ssg:clear
    php please glide:clear
    php please ssg:generate
    

    Which will produce the following output:

    Static site destination directory cleared.
    [โœ”] Glide path cache cleared.
    [โœ”] Found 0 images.
    [โœ”] Deleted empty directories.
    Your Glide image cache is now so very, very empty.
    You may be able to speed up site generation significantly by installing spatie/fork and using multiple workers (requires PHP 8+).
    [โœ”] Gathered content to be generated
    [โœ”] Generated 2 content files
    [โœ˜] / (Unable to copy file from source://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png to cache://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png)
    [โœ”] /var/www/html/public/css copied to /var/www/html/storage/app/static/css
    [โœ”] /var/www/html/public/js copied to /var/www/html/storage/app/static/js
    
    Static site generated into /var/www/html/storage/app/static
    [!] 1/2 pages not generated
    

    If I remove try .. catch in Generate class over here https://github.com/statamic/ssg/blob/d5664b7b9aca4352d06ea4c5e2f27722a7d6e06c/src/Generator.php#L280-L291 I can retrieve helpful exceptions as otherwise they are not logged or outputted anywhere otherwise.

    From quick glance (looking at the exceptions posted lower) it seems the culprit might be the Glide cache recent changes that were implemented, as the failing code in Glide.php tag is here https://github.com/statamic/cms/blob/1ef7efc0de680cdc82655a20ac54cae11c579fe7/src/Tags/Glide.php#L112

    Attributes::from(GlideManager::cacheDisk()->getDriver(), $path);
    

    Using normal glide tag without pair like this..

    {{ glide:assets_field fit="max" }}

    ..does not trigger that part of the code, and does not fail the SSG generation.

    Stacktraces, three exceptions:

    [2022-08-12 17:38:19] local.ERROR: Unable to copy file from source://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png to cache://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png {"exception":"[object] (Statamic\\StaticSite\\NotGeneratedException(code: 0): Unable to copy file from source://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png to cache://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png at /var/www/html/vendor/statamic/ssg/src/Page.php:38)
    [stacktrace]
    #0 /var/www/html/vendor/statamic/ssg/src/Generator.php(281): Statamic\\StaticSite\\Page->generate()
    #1 /var/www/html/vendor/statamic/ssg/src/ConsecutiveTasks.php(12): Statamic\\StaticSite\\Generator->Statamic\\StaticSite\\{closure}()
    #2 /var/www/html/vendor/statamic/ssg/src/Generator.php(193): Statamic\\StaticSite\\ConsecutiveTasks->run()
    #3 /var/www/html/vendor/statamic/ssg/src/Generator.php(92): Statamic\\StaticSite\\Generator->createContentFiles()
    #4 /var/www/html/vendor/statamic/ssg/src/Commands/StaticSiteGenerate.php(62): Statamic\\StaticSite\\Generator->generate()
    #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Statamic\\StaticSite\\Commands\\StaticSiteGenerate->handle()
    #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
    #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
    #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
    #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call()
    #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(139): Illuminate\\Container\\Container->call()
    #11 /var/www/html/vendor/symfony/console/Command/Command.php(308): Illuminate\\Console\\Command->execute()
    #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(124): Symfony\\Component\\Console\\Command\\Command->run()
    #13 /var/www/html/vendor/symfony/console/Application.php(998): Illuminate\\Console\\Command->run()
    #14 /var/www/html/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
    #15 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
    #16 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
    #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
    #18 /var/www/html/please(37): Illuminate\\Foundation\\Console\\Kernel->handle()
    #19 {main}
    
    [previous exception] [object] (League\\Flysystem\\UnableToCopyFile(code: 0): Unable to copy file from source://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png to cache://containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png at /var/www/html/vendor/league/flysystem/src/UnableToCopyFile.php:37)
    [stacktrace]
    #0 /var/www/html/vendor/league/flysystem/src/MountManager.php(333): League\\Flysystem\\UnableToCopyFile::fromLocationTo()
    #1 /var/www/html/vendor/league/flysystem/src/MountManager.php(243): League\\Flysystem\\MountManager->copyAcrossFilesystem()
    #2 /var/www/html/vendor/statamic/cms/src/Imaging/Attributes.php(20): League\\Flysystem\\MountManager->copy()
    #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(337): Statamic\\Imaging\\Attributes->from()
    #4 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(112): Illuminate\\Support\\Facades\\Facade::__callStatic()
    #5 [internal function]: Statamic\\Tags\\Glide->Statamic\\Tags\\{closure}()
    #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(560): array_map()
    #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(719): Illuminate\\Support\\Arr::map()
    #8 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(121): Illuminate\\Support\\Collection->map()
    #9 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(37): Statamic\\Tags\\Glide->generate()
    #10 [internal function]: Statamic\\Tags\\Glide->__call()
    #11 /var/www/html/vendor/statamic/cms/src/View/Antlers/Engine.php(161): call_user_func()
    #12 [internal function]: Statamic\\View\\Antlers\\Engine::renderTag()
    #13 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(586): call_user_func_array()
    #14 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(179): Statamic\\View\\Antlers\\Parser->parseCallbackTags()
    #15 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(134): Statamic\\View\\Antlers\\Parser->parse()
    #16 /var/www/html/vendor/statamic/cms/src/View/Antlers/Engine.php(97): Statamic\\View\\Antlers\\Parser->parseView()
    #17 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(139): Statamic\\View\\Antlers\\Engine->get()
    #18 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
    #19 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
    #20 /var/www/html/vendor/statamic/cms/src/View/View.php(98): Illuminate\\View\\View->render()
    #21 /var/www/html/vendor/statamic/cms/src/Http/Responses/DataResponse.php(154): Statamic\\View\\View->render()
    #22 /var/www/html/vendor/statamic/cms/src/Http/Responses/DataResponse.php(45): Statamic\\Http\\Responses\\DataResponse->contents()
    #23 /var/www/html/vendor/statamic/cms/src/Entries/Entry.php(423): Statamic\\Http\\Responses\\DataResponse->toResponse()
    #24 /var/www/html/vendor/statamic/ssg/src/Page.php(45): Statamic\\Entries\\Entry->toResponse()
    #25 /var/www/html/vendor/statamic/ssg/src/Page.php(36): Statamic\\StaticSite\\Page->write()
    #26 /var/www/html/vendor/statamic/ssg/src/Generator.php(281): Statamic\\StaticSite\\Page->generate()
    #27 /var/www/html/vendor/statamic/ssg/src/ConsecutiveTasks.php(12): Statamic\\StaticSite\\Generator->Statamic\\StaticSite\\{closure}()
    #28 /var/www/html/vendor/statamic/ssg/src/Generator.php(193): Statamic\\StaticSite\\ConsecutiveTasks->run()
    #29 /var/www/html/vendor/statamic/ssg/src/Generator.php(92): Statamic\\StaticSite\\Generator->createContentFiles()
    #30 /var/www/html/vendor/statamic/ssg/src/Commands/StaticSiteGenerate.php(62): Statamic\\StaticSite\\Generator->generate()
    #31 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Statamic\\StaticSite\\Commands\\StaticSiteGenerate->handle()
    #32 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
    #33 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
    #34 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
    #35 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call()
    #36 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(139): Illuminate\\Container\\Container->call()
    #37 /var/www/html/vendor/symfony/console/Command/Command.php(308): Illuminate\\Console\\Command->execute()
    #38 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(124): Symfony\\Component\\Console\\Command\\Command->run()
    #39 /var/www/html/vendor/symfony/console/Application.php(998): Illuminate\\Console\\Command->run()
    #40 /var/www/html/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
    #41 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
    #42 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
    #43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
    #44 /var/www/html/please(37): Illuminate\\Foundation\\Console\\Kernel->handle()
    #45 {main}
    
    [previous exception] [object] (League\\Flysystem\\UnableToRetrieveMetadata(code: 0): Unable to retrieve the visibility for file at location: containers/assets/uuu.png/8aeb6030920f4be1c711736371e4b7b7.png.  at /var/www/html/vendor/league/flysystem/src/UnableToRetrieveMetadata.php:49)
    [stacktrace]
    #0 /var/www/html/vendor/league/flysystem/src/UnableToRetrieveMetadata.php(34): League\\Flysystem\\UnableToRetrieveMetadata::create()
    #1 /var/www/html/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(385): League\\Flysystem\\UnableToRetrieveMetadata::visibility()
    #2 /var/www/html/vendor/league/flysystem/src/Filesystem.php(147): League\\Flysystem\\Local\\LocalFilesystemAdapter->visibility()
    #3 /var/www/html/vendor/league/flysystem/src/MountManager.php(329): League\\Flysystem\\Filesystem->visibility()
    #4 /var/www/html/vendor/league/flysystem/src/MountManager.php(243): League\\Flysystem\\MountManager->copyAcrossFilesystem()
    #5 /var/www/html/vendor/statamic/cms/src/Imaging/Attributes.php(20): League\\Flysystem\\MountManager->copy()
    #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(337): Statamic\\Imaging\\Attributes->from()
    #7 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(112): Illuminate\\Support\\Facades\\Facade::__callStatic()
    #8 [internal function]: Statamic\\Tags\\Glide->Statamic\\Tags\\{closure}()
    #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(560): array_map()
    #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(719): Illuminate\\Support\\Arr::map()
    #11 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(121): Illuminate\\Support\\Collection->map()
    #12 /var/www/html/vendor/statamic/cms/src/Tags/Glide.php(37): Statamic\\Tags\\Glide->generate()
    #13 [internal function]: Statamic\\Tags\\Glide->__call()
    #14 /var/www/html/vendor/statamic/cms/src/View/Antlers/Engine.php(161): call_user_func()
    #15 [internal function]: Statamic\\View\\Antlers\\Engine::renderTag()
    #16 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(586): call_user_func_array()
    #17 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(179): Statamic\\View\\Antlers\\Parser->parseCallbackTags()
    #18 /var/www/html/vendor/statamic/cms/src/View/Antlers/Parser.php(134): Statamic\\View\\Antlers\\Parser->parse()
    #19 /var/www/html/vendor/statamic/cms/src/View/Antlers/Engine.php(97): Statamic\\View\\Antlers\\Parser->parseView()
    #20 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(139): Statamic\\View\\Antlers\\Engine->get()
    #21 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
    #22 /var/www/html/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
    #23 /var/www/html/vendor/statamic/cms/src/View/View.php(98): Illuminate\\View\\View->render()
    #24 /var/www/html/vendor/statamic/cms/src/Http/Responses/DataResponse.php(154): Statamic\\View\\View->render()
    #25 /var/www/html/vendor/statamic/cms/src/Http/Responses/DataResponse.php(45): Statamic\\Http\\Responses\\DataResponse->contents()
    #26 /var/www/html/vendor/statamic/cms/src/Entries/Entry.php(423): Statamic\\Http\\Responses\\DataResponse->toResponse()
    #27 /var/www/html/vendor/statamic/ssg/src/Page.php(45): Statamic\\Entries\\Entry->toResponse()
    #28 /var/www/html/vendor/statamic/ssg/src/Page.php(36): Statamic\\StaticSite\\Page->write()
    #29 /var/www/html/vendor/statamic/ssg/src/Generator.php(281): Statamic\\StaticSite\\Page->generate()
    #30 /var/www/html/vendor/statamic/ssg/src/ConsecutiveTasks.php(12): Statamic\\StaticSite\\Generator->Statamic\\StaticSite\\{closure}()
    #31 /var/www/html/vendor/statamic/ssg/src/Generator.php(193): Statamic\\StaticSite\\ConsecutiveTasks->run()
    #32 /var/www/html/vendor/statamic/ssg/src/Generator.php(92): Statamic\\StaticSite\\Generator->createContentFiles()
    #33 /var/www/html/vendor/statamic/ssg/src/Commands/StaticSiteGenerate.php(62): Statamic\\StaticSite\\Generator->generate()
    #34 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Statamic\\StaticSite\\Commands\\StaticSiteGenerate->handle()
    #35 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
    #36 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
    #37 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
    #38 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call()
    #39 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(139): Illuminate\\Container\\Container->call()
    #40 /var/www/html/vendor/symfony/console/Command/Command.php(308): Illuminate\\Console\\Command->execute()
    #41 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(124): Symfony\\Component\\Console\\Command\\Command->run()
    #42 /var/www/html/vendor/symfony/console/Application.php(998): Illuminate\\Console\\Command->run()
    #43 /var/www/html/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand()
    #44 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
    #45 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
    #46 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
    #47 /var/www/html/please(37): Illuminate\\Foundation\\Console\\Kernel->handle()
    #48 {main}
    "} 
    

    Support details:

    Environment
    Application Name: Statamic
    Laravel Version: 9.22.1
    PHP Version: 8.1.7
    Composer Version: 2.3.8
    Environment: local
    Debug Mode: ENABLED
    URL: responsive-alt-bug.test
    Maintenance Mode: OFF
    
    Cache
    Config: NOT CACHED
    Events: NOT CACHED
    Routes: NOT CACHED
    Views: NOT CACHED
    
    Drivers
    Broadcasting: log
    Cache: statamic
    Database: mysql
    Logs: stack / single
    Mail: smtp
    Queue: sync
    Session: file
    
    Statamic
    Addons: 1
    Antlers: regex
    Version: 3.3.28 Solo
    
    Statamic Addons
    statamic/ssg: 1.2.0
    

    This is separate, organized, continuation issue of https://github.com/statamic/ssg/issues/91 as it was getting a bit messy there.

    opened by ncla 4
  •  Call to a member function url() on null

    Call to a member function url() on null

    Running PHP 7.4.29 (cli) (built: Apr 14 2022 11:36:10) ( NTS )

    php please ssg:generate outputs the following:

    
    Gathering content to be generated...
    
       Error
    
      Call to a member function url() on null
    
      at vendor/statamic/ssg/src/Request.php:51
         47โ–•     }
         48โ–•
         49โ–•     public function getPathInfo(): string
         50โ–•     {
      โžœ  51โ–•         return $this->page->url();
         52โ–•     }
         53โ–•
         54โ–•     public function path()
         55โ–•     {
    
          +27 vendor frames
      28  [internal]:0
          Statamic\Stache\Indexes\Value::Statamic\Stache\Indexes\{closure}(Object(Statamic\Entries\Entry), "1845791e-ed19-4114-a585-fb2ae1905e9b")
    
          +7 vendor frames
      36  [internal]:0
          Statamic\Stache\Query\EntryQueryBuilder::Statamic\Stache\Query\{closure}("blog")
          
         ```
         
         
         Note:
         
         I have a `blog` collection and a `blog` page within the `pages` collection.
         
         
         
    opened by kyranb 4
  • getimagesize errors on site generate

    getimagesize errors on site generate

    Iโ€™m not sure where exactly the issue is here because I updated to Statamic 3.3 as well as SSG 1.0 at the same time, since it kind of all depended on each other.

    When I attempt to generate my site statically, a few pages generate and then I get a glide error. At first I thought it was social images, but itโ€™s not just social images. As far as Iโ€™ve been able to track down, the generator is for some reason trying to run โ€œgetimagesizeโ€ on versions of images that havenโ€™t yet been generated by glide. Iโ€™m not even sure why itโ€™s trying to do that here, and not sure why glide is even generating some of these images. Iโ€™m not actively using it in these cases (although I imagine itโ€™s in use in the background for the social images.

    I did figure out this much: if I visit the page with the image in question on my localhost, the image that was missing gets generated. I can go into storage/statamic/glide/containers and dig down to that folder and the image doesnโ€™t exist. But as soon as I load the page, it gets generated. So the SSG is expecting these to be generated, but theyโ€™re not getting generated unless I go visit the actual page, which creates a pretty big issue for the SSG.

    This happens even if I disable multiple workers, so itโ€™s not related to the other bug of occasional issues with multiple workers.

    [โœ˜] /blog/2020/01/15/the-year-of-the-mobile-edge (getimagesize(/Users/fitzage/Source/mexv3/storage/statamic/glide/containers/social/yotme-blog-post.jpg/2df2be5e837c23016d3700f17a23f082.jpg): Failed to open stream: No such file or directory)
    
    opened by fitzage 22
Releases(1.2.0)
Owner
Statamic
Build beautiful, easy to manage websites. The flat-first, open source, Laravel + git powered CMS.
Statamic
The official ibanapi.com PHP Package.

?? IBAN API validation using ibanapi.com for PHP The official node package for validating IBAN using the ibanapi.com public API for PHP This module of

null 7 Jul 11, 2022
This package is the official Laravel integration for Pirsch Analytics

Laravel Pirsch This package is the official Laravel integration for Pirsch Analytics. Installation Install this package. composer require pirsch-analy

Pirsch Analytics 13 Nov 10, 2022
Laravel package that converts your application into a static HTML website

phpReel Static Laravel Package phpReel Static is a simple Laravel Package created and used by phpReel that converts your Laravel application to a stat

phpReel 16 Jul 7, 2022
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.

Laravel Nova Search This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets. Requirements laravel-mix v6.0+ php 7.3+

Akki Khare 3 Jul 19, 2022
Package to optimize your site automatically which results in a 35%+ optimization

Laravel Page Speed Simple package to minify HTML output on demand which results in a 35%+ optimization. Laravel Page Speed was created by Renato Marin

Renato Marinho 2.2k Dec 28, 2022
Laravel wrapper for Sentry Official API

Laravel Sentry API Provides a simple laravel wrapper to some of the endpoints listed on (Official Sentry API)[https://docs.sentry.io/api/]. **Note: Th

Pedro Santiago 1 Nov 1, 2021
Official Mollie integration for Laravel Cashier

Subscription billing with Laravel Cashier for Mollie Laravel Cashier provides an expressive, fluent interface to subscriptions using Mollie's billing

Mollie 80 Dec 31, 2022
ergodnc (Ergonomic Desk & Coffee) is an open source Laravel project that's being built live on the official Laravel YouTube Channel

About This Project ergodnc (Ergonomic Desk & Coffee) is an open source Laravel project that's being built live on the official Laravel YouTube Channel

Mohamed Said 248 Dec 26, 2022
The list of all Algerian provinces and cities according to the official division in different formats: csv, xlsx, php, json, etc.

algeria-cities This repository contains the list of all the administrative provinces and cities in Algeria. The data is up-to-date according to the of

Ramtani Othmane 393 Jan 2, 2023
This is the source of the official Laravel website.

Laravel Website This is the source of the official Laravel website. Local Development If you want to work on this project on your local machine, you m

The Laravel Framework 471 Dec 31, 2022
Official repository from rasional.my.id

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Rangga Agastya 2 Mar 29, 2022
A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache.

Laravel OTP Introduction A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache. The ca

Lim Teck Wei 52 Sep 6, 2022
Caches responses as static files on disk for lightning fast page loads.

Laravel Page Cache This package allows you to easily cache responses as static files on disk for lightning fast page loads. Introduction Installation

Joseph Silber 1k Dec 16, 2022
Laravel Quran is static Eloquent model for Quran.

Laravel Quran ุจูุณู’ู…ู ูฑู„ู„ู‘ูฐู‡ู ุงู„ุฑูŽู‘ุญู’ู…ูฐู†ู ุงู„ุฑูŽู‘ุญููŠู’ู…ู Laravel Quran is static Eloquent model for Quran. The Quran has never changed and never will, bec

Devtical 13 Aug 17, 2022
HydePHP - Elegant and Powerful Static App Builder

HydePHP - Elegant and Powerful Static App Builder Make static websites, blogs, and documentation pages with the tools you already know and love. About

HydePHP 31 Dec 29, 2022
Allows Filament static assets (css, js) to be served directly from /public

Filament Static Asset Handling This package aims to solve improve the static asset handling of the amazing Laravel package Filament. By default Filame

Jamie Holly 8 Dec 6, 2022
Le module PrestaShop Dronicยฉ permet trรจs facilement d'ajouter ร  votre site Prestashop un configurateur de drone FPV !

Description Le module PrestaShop Dronicยฉ permet trรจs facilement d'ajouter ร  votre site Prestashop un configurateur de drone FPV ! Ce module utilise de

Theo 3 Nov 19, 2021
CRUD utilizando laravel, sendo um site para criaรงรฃo de eventos e festivais.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Bruno 2 Oct 20, 2021
Rickrolls people trying to break your site.

Laravel RickRoll Rickrolls people trying to break your site. This package is inspired by Liam Hammett's tweet. Getting started You can install the pac

Fรฉlix Dorn 72 Jul 18, 2022