Skip to content

Commit

Permalink
Merge branch 'main' into feature/route-based-build
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Commands/StaticBuildCommand.php
#	src/Crawler/StaticCrawlObserver.php
  • Loading branch information
david-d-h committed Oct 27, 2023
2 parents 3c2cf15 + 4433221 commit e2a85f7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Build a static website with Laravel on the backend

[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/laravel-static.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/laravel-static)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/vormkracht10/laravel-static/run-tests?label=tests)](https://github.com/vormkracht10/laravel-static/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/vormkracht10/laravel-static/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/vormkracht10/laravel-static/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/laravel-static.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/laravel-static)
[![Tests](https://github.com/vormkracht10/laravel-static/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/vormkracht10/laravel-static/actions/workflows/run-tests.yml)
[![PHPStan](https://github.com/vormkracht10/laravel-static/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/vormkracht10/laravel-static/actions/workflows/phpstan.yml)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/vormkracht10/laravel-static)
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/vormkracht10/laravel-static)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/laravel-static.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/laravel-static)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"require": {
"php": "^8.1",
"illuminate/contracts": "^9.0",
"laravel/helpers": "^1.6",
"spatie/crawler": "^7.1",
"spatie/laravel-package-tools": "^1.13.0",
"voku/html-min": "^4.5"
Expand Down
1 change: 1 addition & 0 deletions src/Commands/StaticBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function cacheWithCrawler(): void
'User-Agent' => 'LaravelStatic/1.0',
],
])
->acceptNofollowLinks()
->setCrawlObserver(new StaticCrawlObserver($this->components))
->setCrawlProfile($profile)
->setConcurrency($this->config->get('static.build.concurrency'))
Expand Down
4 changes: 2 additions & 2 deletions src/Middleware/PreventStaticResponseMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function handle(Request $request, Closure $next)

$route = Route::current();

$shouldHandle = in_array(
$hasStaticResponseMiddleware = in_array(
StaticResponse::class,
Route::gatherRouteMiddleware($route),
);

if (! $shouldHandle) {
if (! $hasStaticResponseMiddleware) {
return response(status: 200);
}

Expand Down

0 comments on commit e2a85f7

Please sign in to comment.