Commit graph

973 commits

Author SHA1 Message Date
Daniel Rudolf 35d894ec1a
Add 'page' Twig function to return a single page 2023-01-05 22:12:41 +01:00
Daniel Rudolf a5fefa46fb
Update README.md and sample contents for Pico 3.0 2022-04-03 17:47:24 +02:00
Daniel Rudolf a178e85c07
Update sample contents for Pico 3.0 2022-04-03 17:08:13 +02:00
Daniel Rudolf 268f4033f1
Sample contents: Remove Pico's map Twig filter 2022-03-21 01:59:44 +01:00
Daniel Rudolf 1da5e26d57
Remove Pico's map Twig filter
Fixes #623
2022-03-21 01:49:27 +01:00
Daniel Rudolf 6698130b0f
Update dependencies in composer.json 2022-03-13 12:17:15 +01:00
Daniel Rudolf 0068406e23
Update CHANGELOG.md 2022-03-13 12:16:50 +01:00
Daniel Rudolf 81c21722d3
Update CONTRIBUTING.md to include latest changes 2022-03-12 18:02:11 +01:00
Daniel Rudolf c0639ccef6
Minor code improvements 2022-03-09 15:36:58 +01:00
Daniel Rudolf 3b6984dbd7
Add some "art" to Pico class docs 2022-03-08 22:41:11 +01:00
Daniel Rudolf 60d0f5403c
CI: Use build script to publish new releases
Since Pico depends on PicoDeprecated, and PicoDeprecated depends on Pico, a chicken-egg-problem arises: When pushing a new tag for Pico, GitHub Actions will try to build this new release by downloading the matching version of PicoDeprecated from Packagist. Since we didn't release a new version of PicoDeprecated yet, this will fail. So we need to push PicoDeprecated's tag first. Doing so yields GitHub Actions trying to build PicoDeprecated's new release - by trying to download the matching version of Pico from Packagist, which doesn't exist yet.

Thus builds will always fail - unless you push both tags at the exact same time, and unless you send some prayers that GitHub Actions delays building until Packagist picks up the new releases. The simplest solution is not to use GitHub Actions to publish new releases, but letting the user to do it instead. With this changeset this is as simple as `make publish version=v3.0.0`. The 'deploy-release' GitHub workflow now just updates the website and is triggered by publishing the GitHub release, not the tag. This additionally allows the user to perform some manual tests before publication.

The build script now depends on GitHub CLI (`gh`), see https://cli.github.com/. You must setup authentication first (`gh auth login`).
2022-03-08 22:07:35 +01:00
Daniel Rudolf 998f0d1dbd
CI: Fix Composer root version guessing (again) 2022-03-07 21:24:20 +01:00
Daniel Rudolf cb2cf3a4a3
DummyPlugin: Add PHP return types to event methods
Follow-up to 070714d1d8
2022-03-06 18:05:46 +01:00
Daniel Rudolf 00ac6c0700
CI: Some small styling improvements 2022-03-06 18:04:03 +01:00
Daniel Rudolf dde3a76d78
CI: Fix Composer root version guessing 2022-03-06 18:03:27 +01:00
Daniel Rudolf 070714d1d8
DummyPlugin: Encourage devs to use PHP strict typing 2022-03-03 22:02:51 +01:00
Daniel Rudolf 872da5714c
DummyPlugin: Remove missed imports of the picocms namespace 2022-03-03 21:59:41 +01:00
Daniel Rudolf 71c0dfbffb
Proberly handle page data of hidden pages when accessing such a page
This is a workaround for meta pages (i.e. pages starting with a '_'): If a user attempts to request such a page, Pico won't respond with the contents of this meta page, but with a 404 page. This is expected behavior. However, we also have a shortcut in Pico::readPages() attempting to skip reading the contents of the requested page twice. Since we're not serving the contents of the meta page, but of the 404 page, we accidentally overwrite the contents of the meta page by Pico's 404 page. This is unexpected behavior. Even though this commit fixes this particular issue, it doesn't fix its major cause, as the shortcut still exists and can still be triggered by plugin authors by simply overwriting the contents of an existing page. Even though a plugin author might want this to happen, we can't really tell whether it is intended or not. The solution is to remove the shortcut, but we don't want that either, it's a useful performance optimization. The only real solution to this is to switch to page objects, allowing us to handle such situations more verbose. This feature is expected for Pico 4.0. For now we leave this partially fixed...

Fixes #602
2022-03-03 21:55:00 +01:00
Daniel Rudolf 9a8b3da2ae
Simplify PHP class imports 2022-03-03 21:39:27 +01:00
Daniel Rudolf a3f801b89a
Enable PHP strict typing
We can't enable strict typing everywhere without major BC breaks (likely Pico 4.0), so we're doing this on a best-effort basis.

Fixes #603
2022-03-03 21:37:04 +01:00
Daniel Rudolf 0f48280f73
composer.json: Allow using all Composer plugins in the 'picocms/*' namespace 2022-02-27 23:05:35 +01:00
Daniel Rudolf 6f1fc9f8de
CI: Run 'test' workflow as part of the 'deploy-branch' workflow
Mimics the behaviour of the 'deploy-release' workflow, even though branch deployment doesn't depend on Pico's tests to succeed. Pull requests still use the 'test' workflow directly.
2022-02-27 23:05:28 +01:00
Daniel Rudolf 9d08d4247a
CI: Add Composer oauth token for github.com 2022-02-27 23:05:20 +01:00
Daniel Rudolf 1aacce829f
🎉 Switch from Travis CI to GitHub Actions for release deployment
Since Travis CI was transformed into a proprietary service we didn't have a CI pipeline. This heavily refactors and simplifies the CI pipeline and uses GitHub Actions to deploy new Pico releases. You can use Pico's Makefile to build new releases locally, too. Pico's build script no longer depends on any external resources (like our `picocms/ci-tools` collection). However, this isn't true for other release deployment steps, like updating phpDoc class docs, version badge, cloc stats, etc., even though the CI scripts are mostly self-containing now.
2022-02-27 23:05:17 +01:00
Daniel Rudolf 67408ce935
Merge branch 'pico-3.0-alpha' into pico-3.0 2022-02-27 21:17:55 +01:00
Daniel Rudolf 261b5c68a7
CI: Add 'deploy-branch.yml' workflow to update website on branch updates 2022-02-27 00:17:27 +01:00
Daniel Rudolf e3365a4345
CI: Check Pico version on tag push 2022-02-26 22:37:51 +01:00
Daniel Rudolf 4bf3260766
phpDoc: Ignore .github dir 2022-02-26 21:53:57 +01:00
Daniel Rudolf 93dbbe750d
Add 'SECURITY.md' to .htaccess 2022-02-26 21:53:38 +01:00
Daniel Rudolf 61880d150e
Update Pico::VERSION to '3.0.0-dev' 2022-02-26 21:52:11 +01:00
Daniel Rudolf bdb86d37ff
CI: Improve Composer root version guessing for PRs 2022-02-19 16:52:09 +01:00
Daniel Rudolf f4706bb8e1
CI: Improve GitHub Actions YAML formatting 2022-02-19 16:46:49 +01:00
Daniel Rudolf d01918a2fe
CI: Update Stale Bot config 2022-02-19 16:46:11 +01:00
Daniel Rudolf b9de38f7f2
CI: Improve reusable 'install' action 2022-02-19 16:38:24 +01:00
Daniel Rudolf 23b00ba1e0
CI: Move install steps to reusable 'install' action 2022-02-13 17:27:59 +01:00
Daniel Rudolf 92907a1361
GitHub 'test' workflow: Run on any pull request 2022-02-13 15:39:57 +01:00
Daniel Rudolf 8b4b20fe97
PHP_CodeSniffer: Allow using strftime() 2022-02-13 15:34:44 +01:00
Daniel Rudolf 68c47429ef
Add GitHub workflow 'test'
Runs `composer install` and `phpcs` on basically every push, replaces Travis CI.
2022-02-13 15:34:13 +01:00
Daniel Rudolf e33f6c8148
Update various links 2022-02-13 15:10:08 +01:00
Daniel Rudolf 76a761c3a2
Bump to API version 4 2022-02-07 00:00:27 +01:00
Daniel Rudolf 0f152c7165
Travis CI: Test on PHP 8.0 and 8.1 2022-02-06 23:23:59 +01:00
Daniel Rudolf f7ccd0b703
Revert "Added Temporary PHP 8.0 Notice"
This reverts commit ff5e345e58.
2022-02-06 23:22:58 +01:00
Daniel Rudolf 5a81fe89d8
CONTRIBUTING.md: Probot Stale was replaced by GitHub Actions 2022-02-06 23:22:33 +01:00
Daniel Rudolf 4e572adb33
Merge branch 'master' into pico-3.0 2022-02-06 23:21:00 +01:00
Daniel Rudolf 1b956afc29
Code cleanup 2022-02-06 23:15:51 +01:00
Daniel Rudolf fe6c8f805a
Re-add deprecated Pico::getBaseThemeUrl() and AbstractPicoPlugin::__call()
This reverts commits efc4fb5288 and bc816febfc
2022-02-06 23:15:39 +01:00
Daniel Rudolf 41fc15a7e8
Remove picocms\Pico\ namespace
This reverts commit 812ae5c215
2022-02-06 23:14:08 +01:00
Daniel Rudolf edfab74ff2
Add %page_*% replacements for Markdown files
`%page_id%` is replaced by the page's ID, `%page_url%` by the page's relative URL, and `%page_path%` by the dirname of page file.
2022-02-06 22:43:19 +01:00
Maya McDougall ff5e345e58
Added Temporary PHP 8.0 Notice 2022-02-06 16:34:18 -05:00
Daniel Rudolf 7e3c6a7b3e
Merge pull request #599 from dipohl/patch-1
Update web links in index.md
2021-08-15 13:38:01 +02:00