Skip to content

Commit

Permalink
fix: Make adjustments for Kirby 3.9. Also add some plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCordes committed Mar 6, 2023
1 parent 33c5336 commit e1c54ab
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 85 deletions.
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
}
],
"require": {
"php": "^8.0",
"getkirby/cms": "^3.7"
"php": "^8.1",
"getkirby/cms": "^3.9"
},
"config": {
"optimize-autoloader": true,
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"getkirby/composer-installer": true
}
},
"extra": {
"kirby-cms-path": false,
Expand Down
220 changes: 152 additions & 68 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ function determineSeparator(string $path): string {
}

function replaceForWindows(): array {
return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package local-url Anotherkit anotherkit vendor_name vendor_slug author@domain.com"'));
return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package local-url Anotherkit anotherkit Mailhog vendor_name vendor_slug author@domain.com"'));
}

function replaceForAllOtherOSes(): array {
return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|local-url|Anotherkit|anotherkit|vendor_name|vendor_slug|author@domain.com" --exclude-dir=vendor ./* ./.github/* | grep -v ' . basename(__FILE__)));
return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|local-url|Anotherkit|anotherkit|Mailhog|vendor_name|vendor_slug|author@domain.com" --exclude-dir=vendor ./* ./.github/* | grep -v ' . basename(__FILE__)));
}

$gitName = run('git config user.name');
Expand Down Expand Up @@ -135,7 +135,11 @@ function replaceForAllOtherOSes(): array {
if (str_contains($file, 'README.md')) {
removeReadmeParagraphs($file);
}

if (str_contains($file, 'config.anotherkit.test.php')) {
rename($file, str_replace('config.anotherkit.test.php', 'config.' . $packageSlug . '.test.php', $file));
}
}

confirm('Execute `composer install` and `npm install`?', true) && run('composer require diesdasdigital/kirby-meta-knight diverently/laravel-mix-kirby genxbe/kirby3-ray getkirby/layouts && npm install alpinejs && npm install -D tailwindcss @tailwindcss/forms autoprefixer browser-sync browser-sync-webpack-plugin laravel-mix last-release-git postcss semantic-release');
confirm('Execute `composer install` and `npm install`?', true) && run('composer require lukaskleinschmidt/kirby-snippet-controller gearsdigital/enhanced-toolbar-link-dialog diesdasdigital/kirby-meta-knight diverently/laravel-mix-kirby genxbe/kirby3-ray && npm install alpinejs && npm install -D tailwindcss @tailwindcss/forms autoprefixer browser-sync browser-sync-webpack-plugin laravel-mix last-release-git postcss semantic-release');
confirm('Let this script delete itself?', true) && unlink(__FILE__);
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
Empty file added public/images/index.html
Empty file.
4 changes: 2 additions & 2 deletions public/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"icons": [
{ "src": "/images/icon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "/images/icon-512.png", "type": "image/png", "sizes": "512x512" }
{ "src": "/favicon/icon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "/favicon/icon-512.png", "type": "image/png", "sizes": "512x512" }
]
}
13 changes: 6 additions & 7 deletions site/layouts/default.php → site/snippets/layouts/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<?php echo mix("/css/main.css") ?>
<?= mix("/css/main.css") ?>

<?php snippet('meta_information'); ?>
<?php snippet('robots'); ?>

<?php echo mix('/js/main.js', ['defer' => true]) ?>
<?= mix('/js/main.js', ['defer' => true]) ?>

<link rel="icon" href="/images/favicon.ico" sizes="any">
<link rel="icon" href="/images/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
<link rel="icon" href="/favicon/favicon.ico" sizes="any">
<link rel="icon" href="/favicon/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/favicon/apple-touch-icon.png">
<link rel="manifest" href="/manifest.webmanifest">

<style>
Expand All @@ -23,7 +23,6 @@
</style>
</head>
<body class="bg-gray-50">
<?php slot() ?>
<?php endslot() ?>
<?= $slot ?>
</body>
</html>
4 changes: 3 additions & 1 deletion site/templates/default.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php layout() ?>
<?php snippet('layouts/default', slots: true) ?>

Content here

<?php endsnippet() ?>
4 changes: 3 additions & 1 deletion site/templates/home.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php layout() ?>
<?php snippet('layouts/default', slots: true) ?>

<div x-data="{ visible: false }" class="relative overflow-hidden">
<div class="hidden sm:block sm:absolute sm:inset-y-0 sm:h-full sm:w-full" aria-hidden="true">
Expand Down Expand Up @@ -117,3 +117,5 @@
</main>
</div>
</div>

<?php endsnippet() ?>

0 comments on commit e1c54ab

Please sign in to comment.