In the 297th issue of ProcessWire Weekly we're going to check out the latest core updates (ProcessWire 3.0.149) and introduce a new third party module called StaticWire. Read on!
Welcome to the latest issue of ProcessWire Weekly! This time we've got a compact issue: we're going to kick things off by covering the latest core updates, continue from there by taking a quick look at a brand new third party module called StaticWire, and then wrap things up by introducing a site of the week belonging to an Australian martial arts club.
Thanks to all of our readers for being here with us again, and as always, any feedback is most welcome – please don't hesitate to drop us a line if there's anything in your mind you'd like to share with us. Enjoy our latest issue and have a great weekend!
Latest core updates: ProcessWire 3.0.149
The latest ProcessWire version in the dev branch is now 3.0.149, and according to Ryan (check out the weekly update post at the support forum for more details) this version once again comes with a number of new and upgraded features:
- Updates to the $notices API variable, including behind the scenes code updates, new flags (allowing notices to show up only for logged-in users, in admin, or for superusers), and the ability to specify used flags as a space separated string.
- Updates to the comments fieldtype and related classes, including new ways to manage parent/child relations for threaded comments via the API, and more – such as the ability to move comments via Comments Manager to another page.
- Small but useful tweak to the AdminThemeUikit search box: if this area gets the focus but user doesn't immediately start typing anything, it'll suggest you to type "help" for instructions. (This word can be translated to current language as well.)
The updates mentioned here area already available via the dev branch, so feel free to give them a go if you're using that on your site. If you have any questions or feedback, be sure to check out the weekly updates support forum thread as well.
New module: StaticWire
This week we have a very interesting new module to introduce: the module in question is called StaticWire, and what it does is that it provides a way to basically turn a site built with ProcessWire into a static (pure HTML/CSS/JS, with no PHP dependencies) package, thus essentially turning ProcessWire into a simple static site generator.
You can configure the directory for the static files via module configuration screen (the default value is /static/
in your site's root directory), and once the module is installed and configured, there are two methods for generating the package:
- Via Admin GUI. Navigate to Setup > Static Site Generator and click "Generate". If you want regular users to have access to this feature, give them the staticwire-generate permission first.
- Via CLI (command line): go to your site's root directory and execute the script in the module directory:
php site/modules/StaticWire/cli.php
. This is particularly useful if you're using CI/CD and want to automate the whole process.
What actually happens when a static version of the site is generated is that the module creates a directory structure mirroring your page tree, and within each directory it adds a index.html file with the contents of the page in question. Page content is rendered via $page->render()
, so it should always be identical with its "dynamic" counterpart.
Known limitations and considerations at this point:
- Pagination is not yet supported. Only the first (initial) page gets rendered, while subsequent pagination pages are skipped.
- Assets (such as CSS and JS) or files (/site/assets/files) are not copied. This means that you should either copy these manually, via a CI/CD in case that's part of your workflow, or make use of symlinks or a similar approach.
- The module is still in alpha stage – which isn't really a limitation, just something to be mindful of. As with any early stage module, one should tread carefully, and consider twice before enabling it on a live site just yet.
This is a very interesting module, so big thanks to Christoph Engelmayer for sharing it with us. I for one am very much looking forward to giving this module a proper go!
Site of the week: Jita Kyoei Martial Arts
Our latest site of the week belongs to Jita Kyoei Martial Arts, which is a Judo and Jiu Jitsu club located on Manns Road in West Gosford, Australia.
The experienced coaching team at Jita Kyoei Martial Arts offers guidance for students of all ages (five and up) and all skill levels, all the way from recreational students to those serious about competing in the sport. For students that prefer a more dedicated way of couching, Jita Kyoei Martial Arts also offers private, on-demand classes.
The website of JKMA is a relatively simple one-pager with a clean and straightforward design, and a bunch of transition effects thrown in for a bit of extra punch. Content-wise it is – characteristically for most one-pagers – easy to follow, and allows one to effortlessly browse through all the key details: background for the club, introductions for the coaches, prices, and contact details.
Behind the scenes the site is constructed using a regular page tree approach, so there are no hard-coded sections or anything like that. The front-end framework of choice was Bootstrap, and the beneath that the site is being powered by the Template Engine Twig module, along with some modifications to run Twig version 3.
You can find some additional details regarding this site from the case story posted at the showcase area of our support forum. Thanks to Paul Sheean for sharing this project with us!
Stay tuned for our next issue
That's all for the 297th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 25th of January. As always, ProcessWire newsletter subscribers will get our updates a few days later.
Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!
Post a comment