diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..c6ecdc63 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,38 @@ +name: Deploy PR previews + +on: pull_request + +concurrency: preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Set up php 8.3 + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + - name: Set up PHP dependencie + run: composer i + - name: Change config.php + run: | + sed -i "s|libresign.coop|libresign.github.io|g" CNAME + sed -i "s|baseUrl' => '/'|baseUrl' => '/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/'|g" config.php + cat config.php|grep baseUrl + sed -i "/'matomo_container'/d" config.production.php + - name: Run composer command + run: composer prod + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./build_production/ + pages-base-url: libresign.github.io/site-preview + deploy-repository: LibreSign/site-preview + preview-branch: main + token: ${{ secrets.PREVIEW_TOKEN }} diff --git a/composer.json b/composer.json index 6ec776dd..c0a3d517 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "tightenco/jigsaw": "^1.7", "gregwar/captcha": "^1.2", "libresign/espeak": "dev-main", - "elaborate-code/jigsaw-localization": "dev-fix/use-package-default-locale", + "elaborate-code/jigsaw-localization": "dev-main", "nesbot/carbon": "^3.3", "samdark/sitemap": "^2.4" }, diff --git a/composer.lock b/composer.lock index 23992bfc..af07804b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74fc40313b12e89f2a98ff912ca4b7b8", + "content-hash": "13b0204aa5bbde1b9c0d698037ee13bd", "packages": [ { "name": "carbonphp/carbon-doctrine-types", @@ -243,16 +243,16 @@ }, { "name": "elaborate-code/jigsaw-localization", - "version": "dev-fix/use-package-default-locale", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/LibreSign/jigsaw-localization.git", - "reference": "047abccb52ea5e7ec3c1fb036390700a1e9af54d" + "reference": "30a889439bd82cc498971b3d2354788c4acd95a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LibreSign/jigsaw-localization/zipball/047abccb52ea5e7ec3c1fb036390700a1e9af54d", - "reference": "047abccb52ea5e7ec3c1fb036390700a1e9af54d", + "url": "https://api.github.com/repos/LibreSign/jigsaw-localization/zipball/30a889439bd82cc498971b3d2354788c4acd95a8", + "reference": "30a889439bd82cc498971b3d2354788c4acd95a8", "shasum": "" }, "require": { @@ -260,14 +260,21 @@ "php": "^8.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8", "laravel/pint": "^1.2", - "pestphp/pest": "^1.22", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "tightenco/jigsaw": "^1.7" }, + "default-branch": true, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + } + }, "autoload": { "files": [ "src/helpers.php" @@ -283,14 +290,14 @@ } }, "scripts": { + "bin": [ + "echo 'bin not installed'" + ], "analyse": [ "vendor/bin/phpstan analyse" ], "test": [ - "vendor/bin/pest" - ], - "test-coverage": [ - "vendor/bin/pest --coverage" + "vendor/bin/phpunit --colors=always" ], "format": [ "vendor/bin/pint" @@ -307,9 +314,9 @@ ], "description": "Brings localization feature to \"tightenco/jigsaw\" using JSON files", "support": { - "source": "https://github.com/LibreSign/jigsaw-localization/tree/fix/use-package-default-locale" + "source": "https://github.com/LibreSign/jigsaw-localization/tree/main" }, - "time": "2024-04-03T16:02:46+00:00" + "time": "2025-03-08T22:07:46+00:00" }, { "name": "elaborate-code/php-json-tongue", @@ -4705,12 +4712,12 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "libresign/espeak": 20, - "elaborate-code/jigsaw-localization": 20 + "elaborate-code/jigsaw-localization": 20, + "libresign/espeak": 20 }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/source/_assets/js/main.js b/source/_assets/js/main.js index ba94ce13..5c34d2d7 100644 --- a/source/_assets/js/main.js +++ b/source/_assets/js/main.js @@ -18,9 +18,9 @@ require('aos/dist/aos.css'); // === logo change if (ud_header.classList.contains("sticky")) { - logo.src = "/assets/images/logo/logo-2.svg"; + logo.src = window.baseUrl + "/assets/images/logo/logo-2.svg"; } else { - logo.src = "/assets/images/logo/logo.svg"; + logo.src = window.baseUrl + "/assets/images/logo/logo.svg"; } // show or hide the back-top-top button @@ -90,4 +90,4 @@ require('aos/dist/aos.css'); document.querySelector(".back-to-top").onclick = () => { scrollTo(document.documentElement); }; -})(); \ No newline at end of file +})(); diff --git a/source/_layouts/footer.blade.php b/source/_layouts/footer.blade.php index fddb0ab1..d3453f38 100644 --- a/source/_layouts/footer.blade.php +++ b/source/_layouts/footer.blade.php @@ -16,7 +16,7 @@
-

@@ -89,7 +89,7 @@

@@ -120,7 +120,10 @@ - + +