Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Laravel 9.x #40

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ed3e7e2
Update PHP and Markdown.
nonoesp May 7, 2022
ed8b292
Update spatie/laravel-searchable.
nonoesp May 7, 2022
f269ea6
Update graham-campbell/markdown to 14.0-dev.
nonoesp May 7, 2022
34560f9
Update packages.
nonoesp May 7, 2022
4e1fe30
Update packages.
nonoesp May 7, 2022
235cc9a
Update packages.
nonoesp May 7, 2022
14d359a
Update packages.
nonoesp May 7, 2022
3685a2a
Update packages.
nonoesp May 7, 2022
96cfe78
Update CommonMark 2.x syntax.
nonoesp May 7, 2022
2a3484c
Upgrade Dropbox/Spaces service providers.
nonoesp May 7, 2022
727bdf4
Upgrade Dropbox/Spaces service providers.
nonoesp May 7, 2022
e3fb3d3
Cleanup email notifications.
nonoesp Jun 14, 2022
0e9f649
Update README.md. Add color scheme logos.
nonoesp Jul 11, 2022
df816fc
Update README.md.
nonoesp Jul 11, 2022
b37a3ba
Downsize Folio GIFs.
nonoesp Jul 11, 2022
c0575ce
Merge branch 'master' into 9.x
nonoesp Jul 11, 2022
787f4bc
Update README.md and GIFs.
nonoesp Jul 11, 2022
d81a40a
Update README.md.
nonoesp Jul 11, 2022
de69322
Display name of default template.
nonoesp Jul 12, 2022
f623692
Format default template label.
nonoesp Jul 12, 2022
b7633ed
Use original source of laravel-spam-detector.
nonoesp Jul 12, 2022
64b44cd
Remove laravel-spam-detector exception from README.md.
nonoesp Jul 12, 2022
32654d3
Allow explicit og-url in base-v2 template.
nonoesp Jul 13, 2022
7358ace
Restore laravelium/feed package.
nonoesp Jul 14, 2022
d7dd25c
Switch to macpaw/feed.
nonoesp Jul 14, 2022
85ece81
Switch to macpaw/feed.
nonoesp Jul 14, 2022
048c9e3
Add macpac/feed to README.md.
nonoesp Jul 15, 2022
6c5a550
Remove SpacesServiceProvider.
nonoesp Jul 19, 2022
6bcc18e
Cleanup.
nonoesp Jul 19, 2022
bfa1b04
List non-image uploaded files separately.
nonoesp Jul 19, 2022
bdebcc7
Default item's open graph image to site's og image.
nonoesp Jul 19, 2022
bb5254f
Support item domains in Sitemap.
nonoesp Nov 8, 2022
49463d5
Add support for dark mode favicon.
nonoesp Nov 8, 2022
f15094e
Fix legacy footer credits view error.
nonoesp Nov 8, 2022
ad1d999
Purge images from imgix when replacing.
nonoesp Dec 13, 2022
4bf3da7
Adjust c-footer-v2 vertical padding and margin.
nonoesp Jan 16, 2023
32d9840
Make credits year dynamic.
nonoesp Jan 16, 2023
0b34b2e
Add CommonMark Mark (==) extension.
nonoesp Mar 17, 2023
fe75f8a
makeCollection returns an empty collection not an empty list.
nonoesp Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<img src="assets/[email protected]?reload2" alt="Folio for Laravel logo." width="200px">
<p>
<img src="assets/[email protected]#gh-dark-mode-only" alt="Folio for Laravel logo." width="138">
<img src="assets/[email protected]#gh-light-mode-only" alt="Folio for Laravel logo." width="138">
</p>

A customizable Laravel content-management system. (Currently in beta.)
A customizable Laravel content-management system.

## Live Examples
You can see it working at [Nono.MA](https://nono.ma), [Getting Simple](https://gettingsimple.com), [Burns.art](https://burns.art), [RCA Media Studies](https://ms.rca-architecture.com), or [Luis Ruiz Padrón](https://luisruiz.es).

[Nono.MA](https://nono.ma) | [Getting Simple](https://gettingsimple.com) | [Lourdes.AC](https://lourdes.ac) | [AR-MA](https://ar-ma.net) | [Getting Architecture Done](http://gettingarchitecturedone.com/writing) | [Nacho.MA](https://nacho.ma) | [Burns.art](https://burns.art) | [RCA Media Studies](https://ms.rca-architecture.com) | [Luis Ruiz Padrón](https://luisruiz.es)
## Installation · Laravel 9.x

## Installation · Laravel 8.x

- Add alternate VCS repos for packages without Laravel 8 support to `composer.json`.
- Add alternate VCS repos for packages without Laravel 9.x support to `composer.json`.

```json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/nonoesp/laravel-imgix"
}
},
{
"type": "vcs",
"url": "https://github.com/macpaw/laravel-feed"
}
],
```

Expand Down Expand Up @@ -71,19 +76,19 @@ php artisan vendor:publish --provider="Nonoesp\Folio\FolioServiceProvider" --tag
## Other

- Subscriber email notifications can be configured in `folio.subscribers` and setting up Amazon SES in `services.ses`.
- Backups can be configured by adding disks to `backup.destination.disks` (having those disks configured in `filesystems`, say [Dropbox](https://www.dropbox.com/developers/apps), Digital Ocean, or S3).
- Backups can be configured by adding disks to `backup.destination.disks` (having those disks configured in `filesystems`, say [Dropbox](https://www.dropbox.com/developers/apps), DigitalOcean, or AWS S3).

## License

Folio is licensed under the [MIT license](http://opensource.org/licenses/MIT).

## Me

Hi. I'm [Nono Martínez Alonso](https://nono.ma/about) (Nono.MA), a computational designer with a penchant for simplicity.
Hi. I'm [Nono Martínez Alonso](https://nono.ma/about) (Nono.MA), a creative technologist with a penchant for simplicity.

I host [Getting Simple](https://gettingsimple.com)a podcast about how you can live a meaningful, creative, simple life—[sketch](https://sketch.nono.ma) things that call my attention, [write](https://gettingsimple.com/writing) about enjoying a slower life, and recently started [live streaming and recording videos](https://youtube.com/NonoMartinezAlonso) on machine learning, life hacking, and more.
I host [Getting Simple](https://gettingsimple.com)a podcast about simple living, lifestyle design, technology, and culture — [sketch](https://sketch.nono.ma) things that call my attention, [write](https://gettingsimple.com/writing) about enjoying a slower life, and record creative coding and machine intelligence [live streams](https://youtube.com/NonoMartinezAlonso) on YouTube.

[Join the Discord community](https://nono.ma/discord).
[Join us on Discord](https://nono.ma/discord). 🗣

If you find Folio useful in any way, reach out on Twitter at [@nonoesp](https://twitter.com/nonoesp). Cheers!

Expand All @@ -97,3 +102,4 @@ If you find Folio useful in any way, reach out on Twitter at [@nonoesp](https://
✍🏻 [Blog](https://nono.ma)
🐦 [Twitter](https://twitter.com/nonoesp)
📸 [Instagram](https://instagram.com/nonoesp)
📸 [YouTube](https://youtube.com/NonoMartinezAlonso)
Binary file added assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/[email protected]
Binary file not shown.
38 changes: 21 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,49 @@
{
"type": "vcs",
"url": "https://github.com/nonoesp/laravel-imgix"
},
{
"type": "vcs",
"url": "https://github.com/macpaw/laravel-feed"
}
],
],
"autoload": {
"psr-4": {
"Nonoesp\\Folio\\": "src"
}
},
"minimum-stability": "dev",
"require": {
"php": "^8.0.1|^7.3.0",
"illuminate/support": "^8.0",
"php": "^8.0.2",
"illuminate/support": "^9.11.0",
"aws/aws-sdk-php": "~3.0",
"graham-campbell/markdown": "^13.0.0",
"macpaw/feed": "^9.0.0",
"graham-campbell/markdown": "^14.0-dev",
"jenssegers/date": "^4.0.0",
"laravelcollective/html": "^6.0",
"laravelium/feed": "^8.0.0",
"league/flysystem-aws-s3-v3": "^1.0@dev",
"league/flysystem-aws-s3-v3": "^3.x-dev",
"michelf/php-markdown": "^1.9",
"mtownsend/read-time": "^2.0.0",
"spatie/eloquent-sortable": "^3.8",
"spatie/laravel-translatable": "^4.3",
"spatie/eloquent-sortable": "^4.0.1",
"spatie/laravel-translatable": "^6.0.0",
"spatie/regex": "^1.4",
"spatie/laravel-feed": "^4.0",
"spatie/dropbox-api": "^1.12",
"spatie/laravel-sitemap": "^5.7",
"spatie/flysystem-dropbox": "^1.2",
"spatie/laravel-backup": "^6.8",
"spatie/laravel-searchable": "dev-main",
"spatie/laravel-sitemap": "^6.1",
"spatie/flysystem-dropbox": "^2.0.6",
"spatie/laravel-backup": "^8.1.2",
"spatie/laravel-searchable": "^1.11.0",
"spatie/laravel-newsletter": "^4.8",
"rap2hpoutre/laravel-log-viewer": "^1.4",
"rap2hpoutre/laravel-log-viewer": "^2.2",
"rtconner/laravel-tagging": "~4.0",
"symfony/intl": "^5.0",
"hashids/hashids": "^4.0.0",
"nasyrov/laravel-imgix": "8.x-dev",
"nasyrov/laravel-imgix": "9.x-dev",
"mpociot/versionable": "^4.0.0",
"laravel/ui": "^3.0",
"spatie/laravel-honeypot": "^4.0",
"johannebert/laravel-spam-protector": "^6.1"
"johannebert/laravel-spam-protector": "dev-master",
"wnx/commonmark-mark-extension": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
Expand All @@ -58,8 +63,7 @@
"laravel": {
"providers": [
"Nonoesp\\Folio\\FolioServiceProvider",
"Nonoesp\\Folio\\Providers\\DropboxServiceProvider",
"Nonoesp\\Folio\\Providers\\SpacesServiceProvider"
"Nonoesp\\Folio\\Providers\\DropboxServiceProvider"
],
"aliases": {
"Folio": "Nonoesp\\Folio\\Facades\\Folio",
Expand Down
58 changes: 48 additions & 10 deletions resources/views/admin/upload/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
$images = [];
$videos = [];
$animations = [];
$otherFiles = [];
@endphp

@foreach($filenames as $filename)
Expand All @@ -44,19 +45,22 @@

$isVideo = in_array($extension, ['mp4', 'mov', 'webm']);
$isAnimation = in_array($extension, ['gif']);
$isImage = in_array($extension, ['jpeg', 'jpg', 'svg', 'png', 'tiff', 'bmp', 'webp']);

if ($isVideo) {
// Videos
array_push($videos, $filename);
continue;
} else if ($isAnimation) {
// Animations
array_push($animations, $filename);
continue;
} else if ($isImage) {
// Images
array_push($images, $filename);
} else {
// Other files
array_push($otherFiles, $filename);
}

// Images
array_push($images, $filename);
@endphp
@endforeach

Expand Down Expand Up @@ -98,7 +102,7 @@
<br/>
{{ $basename }}
·
<a class="o-image-upload__delete js--delete-image" data-url="/{{ Folio::adminPath().'upload/delete/'.$basename }}">╳</a>
<a class="o-image-upload__delete js--delete-image u-cursor-pointer" data-url="/{{ Folio::adminPath().'upload/delete/'.$basename }}">╳</a>
</p>
</div>
@endforeach
Expand Down Expand Up @@ -156,7 +160,7 @@
@endif



{{-- Videos --}}

@if(count($videos))

Expand All @@ -176,15 +180,13 @@
// Construct file path
// $filePath = Folio::upload($basename);

$image = Folio::uploadUrl($basename);
$video = Folio::uploadUrl($basename);
// $image = config('folio.imgix') ? imgix($filePath) : Folio::mediaUrl($filePath);
@endphp

<div class="[ grid__item one-whole ]">
<p>
<a href="{{ $image }}" target="_blank">
{{ $basename }}
</a>
<a href="{{ $video }}" target="_blank">{{ $basename }}</a>
·
<a
class="js--delete-image u-cursor-pointer"
Expand All @@ -200,6 +202,42 @@ class="js--delete-image u-cursor-pointer"

@endif

{{-- Other files --}}

@if(count($otherFiles))

<div class="admin-form grid">

<div class="grid__item one-whole u-mar-b-3x u-mar-t-3x u-font-size--g">
<strong>Files</strong>
</div>

@foreach($otherFiles as $filename)
@php
$basename = basename($filename);
$extension = explode('.', $basename);
$extension = $extension[count($extension) - 1];
$file = Folio::uploadUrl($basename);
@endphp

<div class="[ grid__item one-whole ]">
<p>
<a href="{{ $file }}" target="_blank">{{ $basename }}</a>
·
<a
class="js--delete-image u-cursor-pointer"
data-url="/{{ Folio::adminPath("upload/delete/$basename") }}"
>
</a>
</p>
</div>
@endforeach

</div>

@endif

</div>

@if(!count($images) && !count($videos))
Expand Down
3 changes: 2 additions & 1 deletion resources/views/layout-v2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<title>{{ $title }}</title>
<link rel="stylesheet" type="text/css" href="{{ $css }}">
<link rel="icon" type="image/png" href="{{ $favicon }}" />
<link rel="icon" type="image/png" href="{{ $favicon }}" media="(prefers-color-scheme: light)" />
<link rel="icon" type="image/png" href="{{ str_replace('.png', '@dark.png', $favicon) }}" media="(prefers-color-scheme: dark)" />
<link rel="alternate" type="application/atom+xml" href="/{{ $rss }}" />
<link rel="canonical" href="{{ $canonical }}" />
<meta name="csrf-token" content="{{ csrf_token() }}">
Expand Down
15 changes: 14 additions & 1 deletion resources/views/legacy/partial/c-footer__credits.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if(!isset($text)) {
$footer = config('folio.footer');
$text = null;
if($footer['credits_text']) {
if ($footer && array_key_exists('credits_text', $footer)) {
$text = $footer['credits_text'];
}
}
Expand All @@ -15,6 +15,19 @@
<p>
@if($text)

@php
$text = str_replace(
[
'{year}',
'{footer-text}',
],
[
Item::formatDate(Date::now(), 'Y'),
trans('folio.footer-text'),
],
$text);
@endphp

{!! $text !!}

@else
Expand Down
2 changes: 1 addition & 1 deletion resources/views/legacy/template/_base-v2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
$og_description = $item->stringProperty('meta-description', $og_description);
}
$og_type = 'article';
$og_url = $item->permalink();
$og_url = $og_url ?? $item->permalink();
$apple_touch_icon = $item->stringProperty('apple-touch-icon');
?>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/partial/c-footer-v2.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$subscribe_hidden = $subscribe_hidden ?? config('folio.subscribe.hidden');
@endphp

<footer class="{{ $class}} {{ $classes }} [ u-pad-b-4x u-mar-t-6x ]">
<footer class="{{ $class}} {{ $classes }} [ u-pad-b-3x u-mar-t-4x ]">

@if(!$subscribe_hidden)
<div class="[ o-wrap o-wrap--size-400 o-wrap--palm-size-full u-mar-b-5x ]">
Expand Down
8 changes: 8 additions & 0 deletions src/Commands/GenerateSitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ public function handle()

// Find Folio item paths
if (Folio::isFolioURI($url->path())) {

if($item = \Item::bySlug($url->path())) {
// Override domain when specified as property
if ($domain = $item->stringProperty('domain')) {
$url = new \Spatie\Sitemap\Tags\Url('https://'.$domain.$url->path());
}
}

$urlType = 'ITEM';
$url->setPriority(1);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Controllers/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public function create(Request $request)
'data' => $data,
'text' => $text ?? null,
],
function ($m) use ($email, $email_subject) {
$m->from(config('folio.subscribers.from.email'), config('folio.subscribers.from.name'));
$m->to(config('folio.subscribers.to.email'), config('folio.subscribers.to.name'))->
subject($email_subject);
function ($email) use ($email_subject) {
$email->to(config('folio.subscribers.to.email'), config('folio.subscribers.to.name'))
->from(config('folio.subscribers.from.email'), config('folio.subscribers.from.name'))
->subject($email_subject);
});

}
Expand Down
13 changes: 13 additions & 0 deletions src/Controllers/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ public function getUploadForm(Request $request)
// Confirm we're overwriting
if ($imgExists) {
array_push($messages, 'The file has been replaced.');

// Purge from imgix if possible
$imgix_api_key = env('IMGIX_API_KEY');
$imgix_purge_on_replace = env('IMGIX_PURGE_ON_REPLACE');
if ($imgix_api_key && $imgix_purge_on_replace) {
$imgix_url = imgix($uploaderUploadsFolder.'/'.$filename);
$purge_response = \Folio::purgeImgix($imgix_url);
if ($purge_response) {
array_push($messages, 'The file has been purged from imgix.');
} else {
array_push($messages, 'Failed to purge the file from imgix.');
}
}
}

// Store file
Expand Down
Loading