Commit Graph

126 Commits

Author SHA1 Message Date
Belle Aerni 57bb266635 Fix issue with the HTTPS redirect 2023-06-21 15:08:07 -07:00
Belle Aerni c613271c48 Switch to hrtime and display time to render in ms 2023-06-20 05:20:24 -07:00
Belle Aerni 8d9e894af8
~ 50% reduction in the time to render a page (#49) 2023-06-19 16:18:49 -07:00
Belle Aerni ebb0fce492
Bump AntLoader to version 2 (#46)
* Bump AntLoader to version 2

* Whoops - I forgot about the tests

* Oh yeah, cron.

Note to self: turn the autoloader into an individual file that can be included by the tests / cron file so I don't need to update 3 of them manually
2023-05-27 02:14:33 -07:00
Belle Aerni 945881365e
Implement per-page template functionality (#45)
Can be enabled by adding "Template: templatename" to a file header.
Then AntCMS will attempt to load the associated template from the  "Templates" directory of your current theme
2023-05-27 00:24:28 -07:00
Belle Aerni 38e51166c3
Implemented APCu caching (#44)
* Start implementing APCu caching

* Fix tests

* Now make PHPStan happy :)

* Fix tests

* Also enable the APCu extension in the tests

* Set maxlife to 7 days & clear with cron

* Implement a more correct way to clear the cache

* Also mention the APCu caching in the readme
2023-05-26 23:46:42 -07:00
Belle Aerni b61ac80227
Started work on routing improvements (#42)
* Started work on routing improvements

Creates a helper class to make handling routes a bit easier. Also should an issue that prevented SSL certs from being renewed via the .well-known folder

* Bugfix

* Added PHPDocs
2023-05-26 05:44:27 -07:00
Belle Aerni d03ec564f6 Remove AntKeywords, minor formatting changes 2023-05-13 13:08:33 -07:00
Belle Aerni b31e88a428
Move to using AntLoader (#38)
* Move to using AntLoader

* Update composer lockfile

I fixed the wrong classname in AntLoader

* Update tests

* It works!

* Use AntLoader 1.0.0
2023-05-04 19:36:15 -07:00
Belle Aerni 480ab7185d Small bugfix 2023-04-25 14:11:58 -07:00
Belle Aerni 8e018600a5 Minor, but important improvements 2023-04-01 19:30:12 -07:00
Belle Aerni 0663fbc604 Incorporate TinyZoom.JS 2023-03-30 23:01:08 -07:00
Belle Aerni 1770d5376a Minor tweak 2023-03-30 17:02:12 -07:00
Belle Aerni 0e252133e2 Cleanly handle no default attributes being set 2023-03-26 23:40:02 -07:00
Belle Aerni 90f0f96f13 Fix those pesky tests 2023-03-26 23:34:17 -07:00
Belle Aerni 70ff0a106f Per-theme config, default attributes, and bump BS ver 2023-03-26 23:29:17 -07:00
Belle Aerni 61fa0fc533 Fix file name 2023-03-21 13:16:53 -07:00
Belle Aerni 23e8b18ba3
Implemented multi-user support (#27)
* Implemented rudimentary multi-user support

* Delete src.zip

* Improve the update user function

And added a new function to the auth module to invalidate a session

* Update AntAuth.php

* Rename the configs, a bit more auth stuff

* Fix test and JS regex

* Turn the admin landing page into a twig template

* plugin/admin/ -> admin/

* Refactored templating for plugins

Plus. I finally converted the remaining options in the admin plugin to twig templates. No extra styling, but it'll be easier now

* Fix PHPStan warnings

* Basic "first time" user setup

* Improved styling

* Started implementing user management

* Completed user management in the admin panel

* Renamed templates, added support for sub-dirs

* Limit and validate allowed chars for usernames

* Finished the basics of the profile plugin

* Styling for the bootstrap theme

* Some more final touches

* Added an example to show author

* Tweak to the readme
2023-03-07 02:09:32 -08:00
Belle Aerni cba9f71f78 Lazy load images 2023-02-25 04:32:07 -08:00
Belle Aerni d08d136990 Implement a basic session expiration
It's rudimentary, but this should ensure that people will need to re-authenticate after closing their browser session
2023-02-12 19:41:52 -08:00
Belle Aerni 25e1ef9434 Started creating templates for the admin plugin
Also, replaced the old <!--AntCMS-SiteLink--> with a new filter called absUrl, which can be used to convert any link to an absolute URL by adding the base site URL
2023-02-12 17:02:07 -08:00
Belle Aerni 9eb24fee30 First try to render exceptions using twig 2023-01-28 20:54:53 -08:00
Belle Aerni af375a5499 Code styling /w Rector 2023-01-25 22:08:19 -08:00
Belle Aerni e1667b6374 Use actual twig variables for the page body
Replaces <!--AntCMS-Body--> with {{ AntCMSBody | raw }}
2023-01-25 21:32:38 -08:00
Belle Aerni e2ca10d51d Made exception rendering more flexible 2023-01-25 18:45:36 -08:00
Belle Aerni 95ed5059f0 Cleaned up the code a bit 2023-01-24 17:48:40 -08:00
Belle Aerni 7ea9cb2e5d Some fixes to the admin plugin 2023-01-24 17:22:12 -08:00
Belle Aerni a3039f10ed Fixed the page editor after recent page list gen changes
This part of the plugin hadn't been setup to handle the new paths that were being generated.
2023-01-20 20:39:09 -08:00
Belle Aerni ecf94d36da Removed the keyword generator
It didn't really work, added a bunch to the overall file size, and computer-generated keywords just won't compare to human created ones, unless you're to use AI or a particularly advanced algorithm, which I feel is outside the scope of the project.

I've left the class in place, so if needed, it'll be really easy to add it back
2023-01-19 18:01:03 -08:00
Belle Aerni 97e6a8a4e6 Make renderWithTiwg a static function
There's zero need to create a new instance of the class before calling it, so this removes a very small amount of overhead, but more importantly removes the need to create and define a new class of it each time, which makes the code very slightly cleaner
2023-01-19 15:07:15 -08:00
Belle Aerni ea7f3ac65b Micro-optimization to the createCacheKey function
Testing showed the in_array function made it overall slower than simply calling MD4. Using a define, I was able to get the overhead down to virtually nothing:
PHP 8.2:
Execution time for MD4: 0.064558029174805 seconds
Execution time for XXH128: 0.015785932540894 seconds
Execution time for Check: 0.0119788646698 seconds

PHP 8.1:
Execution time for MD4: 0.034939050674438 seconds
Execution time for XXH128: 0.0058550834655762 seconds
Execution time for Check: 0.0062451362609863 seconds
2023-01-19 01:41:17 -08:00
Belle Aerni bf3b425c8d MD5 -> MD4 2023-01-18 23:11:18 -08:00
Belle Aerni 612adb5a17 Revert "Use the official twig StringLoaderExtension"
This reverts commit b2036b765f.
2023-01-18 22:05:50 -08:00
Belle Aerni b2036b765f Use the official twig StringLoaderExtension
Not sure how I missed the fact that this exists, but let's use it instead of an unofficial extension
2023-01-18 22:02:33 -08:00
Belle Aerni 08cfdcf460 Stip 'index' off when generating the page list 2023-01-17 20:18:13 -08:00
Belle Aerni 02e4492ecd Improve the way the pagelist is generated
Now it automatically strips off the .md extension since it's unneeded, and it sorts it so that the 'index' of the site is always the first item in the array, since that dictates the order they appear in the browser
2023-01-17 19:45:59 -08:00
Belle Aerni f388c99647 Added the ability to toggle page visibility 2023-01-17 19:23:48 -08:00
Belle Aerni 0eca5dd3e1 Admin Plugin: added the ability to delete pages 2023-01-17 18:54:44 -08:00
Belle Aerni cbb978ccad AntConfig::saveConfig verify primary keys exist
Before saving the new config, verify that the config appears to be complete by checking for the primary keys in the array
2023-01-17 12:38:38 -08:00
Belle Aerni cdee7c8a04 Update config.php to delete all, including dirs 2023-01-16 18:05:33 -08:00
Belle Aerni 588811ec7a Created a feature list doc 2023-01-14 22:45:37 -08:00
Belle Aerni ff9583bfdf
Rector (#19)
* Rector code quality run

* Ran Rector with coding style ruleset

* Ran Rector with the naming setlist
2023-01-14 20:44:27 -08:00
Belle Aerni c90823afbe Default to having keyword generation off 2023-01-14 15:37:57 -08:00
Belle Aerni 8ed69831ee Check for cache before setting up the MD parser 2023-01-14 03:04:56 -08:00
Belle Aerni c5b999294b Added embed extension for markdown 2023-01-14 02:38:20 -08:00
Belle Aerni 3353be4920 Replaced my homebrew keyword generator
It now uses the one found here: https://github.com/Donatello-za/rake-php-plus
This is much better than the one I had hacked together.

Makes AntCMS a bit bigger.. but not by too much. I may end up removing the keyword generator outright, but for now I'm going to keep it.
2023-01-14 00:49:21 -08:00
Belle Aerni 91395db9c4 Added robots.txt plugin
Automatically generates the content, including the correct link to the sitemap.
2023-01-14 00:30:29 -08:00
Belle Aerni eaca96fd6b Added a sitemap generator 2023-01-13 23:46:17 -08:00
Belle Aerni ca54a56eaa fix active page highlight in the Bootstrap theme 2023-01-13 01:38:07 -08:00
Belle Aerni 44de365946 Fix header regex (again) 2023-01-13 01:18:43 -08:00