-
Posts
469 -
Joined
-
Last visited
-
Days Won
31
FireWire last won the day on November 21
FireWire had the most liked content!
About FireWire
- Birthday January 1
Profile Information
-
Location
California
-
Interests
Writing code. Writing more code. Refactoring. Writing code.
Recent Profile Visitors
8,266 profile views
FireWire's Achievements
Hero Member (6/6)
909
Reputation
-
@bernhard I have a project in mind for my brother who sells things he makes online. Once I can get through a couple of projects, I'd like to build him a shop. Many thanks for your hard work and dedication. Such great contributions to the ProcessWire ecosystem.
-
FireWire started following [SOLVED] JavaScript error - 'invalid json in alfred' but I'm not outputting any json to the block , π RockCommerce is Here! π₯π , llms.txt and 2 others
-
Congrats on the launch @bernhard!
-
Maybe just for consistency? Optimization where the interpreter can reliably determine accepted types from hints alone without parsing default values? I can't tell how far into the PHP engine this goes and when it turns into a future exception perhaps how PHP handles this underneath the hood may itself change. A speculative example would be that the parser could ignore default values entirely if the arguments being passed/not passed to the function don't match the signature which could be the lone trigger for an exception in that case. This was frustrating for me as well. I couldn't find any information about type hints other than their usage. I could be entirely wrong about my thoughts above thanks to that. As for '?' vs. '|null', I like to use ? in type hints and spell out 'null' in the docblock. It's clear to read when the docblock is referenced by dev/editor tools that will display the full '|null' property description while still keeping the type definition in the method itself shorter so code lines take up less space in code editors. Personal preference, only thing that matters is consistency I guess. I haven't thought about a lot of this stuff in a long time though since I started declaring strict_types in every file and got set in my ways years ago. I consider that choice a luxury though because I'm not in a position where I ensure the kind of wide version support and foundational stability that ProcessWire does.
-
Went down a rabbit hole on this one... Really curious why they chose a structureless document format like markdown when there are rich and mature data standards like Schema.org. The foundational work would have already been completed, the syntax well established/adopted, and there could be a lot of areas where the wheel may not need to be reinvented. Already exists on millions of websites and generators/parsers already exist for it- adoption by devs and orgs could adopt it so much more quickly with updates to existing packages/libraries. Almost all of the examples they give on the llmstxt website could be satisfied out of the box and if not, remedied by extending the specification. Maybe I'm missing the boat on this one, but is their rejection of an existing data structure due to the fact that they want LLMs to read the content "naturally"? Are LLMs incapable? If that's the case, should LLMs be giving anyone programming tips... I know I've veered off the topic of this post, but this proposal is 3 months old and curious if it has any legs. ANYWAY. Considerations for a module... How would it handle different information at different URL paths? Would it just dump all content into a single file? May create a massive file that starts to introduce performance issues on larger sites with things like blogs. This issue filed on the proposal Github repo brings up multiple URLs but the proposal itself doesn't seem to have anything concrete that takes this into consideration. Thinking about this out loud because creating a module to satisfy this need may end up being a more generalized module. I think this would end up turning into a Markdown generator, if not a library outright. I did a good amount of searching and there are tons of PHP packages that parse MD but I couldn't find any that generate MD from values. If that library existed, the module would be a lot easier to build. In the case of this module we'd essentially be building two versions of the same site because Markdown is as concerned about presentation as it is about content rather than just logic. Each field would have to be configured for rendering in MD. The llmstxt example of Franklin's BBQ is a good illustration. They have an unordered list of weekly hours, but their menu is formatted as a table. In that example, either one could be rendered as a list or table. Assuming we are using a repeater for hours and a repeater for menu items, each field would need to have settings for how it should be rendered (list or table). In the case of a table, fields for table headers need to be mapped and the subfields in the repeater mapped to column values. I don't even know what the settings would look like to render the business hours as a list according to the example. I'm thinking that putting all of the configuration into a module would be a significant challenge. I'm not sure that this proposed standard lends itself well to creating content for the markdown file via a user-friendly UI. It may need a developer to handle it all separately. This is one of the reasons I mentioned Schema data. It would be trivial to implement a Schema object, we already to for Google's structured data. The biggest lift would be to write a library that the developer uses to render the MD data and minimizing per-field configuration, and probably making the module just a formatter that outputs Markdown using defined methods. Here's a hypothetical implementation that uses page classes and an imaginary MarkdownGenerator module. This would render something like the Franklin's BBQ example in the link above <?php namespace ProcessWire; // site/classes/HomePage class HomePage extends DefaulePage { public function renderLlmsMarkdown(): string { $md = wire('modules')->get('MarkdownGenerator'); return $md->render([ $md->h1($this->title), $md->quote($this->summary), $md->text('Here are our weekly hours'), $md->ul( array_map( fn ($row) => "{$row->days}: {$row->hours}", $this->pages->get(1012)->operating_hours->getArray(), ), ), $md->h2('Menus'), $md->ul( array_map( fn ($menuPage) => $md->link($menuPage->title, "{$menuPage->httpUrl}/llms.txt"), $this->get('template=menu')->menus->getArray(), ), ), ]); } } // site/classes/MenuPage.php class MenuPage extends DefaulePage { public function renderLlmsMarkdown(): string { $md = wire('modules')->get('MarkdownGenerator'); $markdownItems = array_map(function($menuSection) use ($md) { return $md->render([ $md->h2($menuSection->title), $md->table( ['Item', 'Price'], array_map( fn ($item) => [$item->title, $item->price], $section->menu_items->getArray(), ), ), ]); }, $this->menu->getArray()); return $md->renderBlocks($markdownItems); } } // site/init.php foreach ($pages->find('template=home|menu') as $llmPage) { $wire->addHook( "{$llmPage->url}llms.txt", fn (HookEvent $e) => $e->pages->get($llmPage)->renderLlmsMarkdown() ); } That should really leverage caching in the real world. This approach will render an llms file at each individual URL for pages that are configured. This standard proposal seems to be taking a non-web approach and, as mentioned in that Github issue above, haven't considered leveraging web URLs but instead creating a stack of separate linked MD documents that an LLM reads like a book at the root URL. Since the standard doesn't say "look for llms.txt at every available url', then any pages with llms data will have to be specifically referenced/rendered on either the root llms.txt document or another llms.txt document that is or has an ancestor that is referenced in the root document. This follows the BBQ example, but just uses actual URLs rather than generating a stack of separate MD documents at the root. I assume you could just hook file names that contain Page IDs or something, but this makes more sense to me. Seems like an incredibly efficient way to build a whole new internet just for robots without any value provided to the people doing the work π€ At the very least I want a promise from someone that my life and the lives of my family will be spared when Skynet takes over. tl;dr Creating a module specifically to render llms data may not be the most efficient way to go about this A module that puts configurations into the UI would have to be extremely complex and account for the many types of fields available in ProcessWire Accounting for fields requires that each type of field is limited to the type of MD is can generate if the module attempted to make everything configurable The best way would probably be to create fields that will contain the content and then have your code do the rendering This is basically just creating two websites. One for people and one for LLMs Because this proposed standard has chosen markup over a logical data structure, it's probably always going to be on the shoulders of the developer unless they change something Another challenge is their expectation of additional content management: If this is important enough then there may be a need to manage LLM consumable information separately in fields that contain content sufficiently dumbed down for LLMs. Maybe the real module here is one that connects to an LLM API which auto-summarizes the content to then be used when creating MD files that describe the content to other LLMs. Solution: a library or Module that takes inputs and renders Markdown. Wouldn't be anything specific to AI. Or this standard could be tossed and we can just render structured data on the web page so LLMs can use the internet as a natively hyperlinked set of documents located at stable and discoverable URLs... Having thought this out I think even less of this standard than when I first read the proposal π€£
- 1 reply
-
- 2
-
?I've ?been ?type ?hinting ?parameters ?with ?question ?marks ?for ?so ?long ?I ?don't ?even ?see ?them ?anymore. @ryan Seconding @adrian's many thanks for the PHP 8.4 attention π Will we see any (Disjunctive|Normal)|(Form&Types) type declarations? Maybe a contest for longest function signatureΒΏ Wait, did I just break my keyΒΏ
-
Hi all (again)! I'm continuing to create buttons and have created a Github repo for all of the images. I've since added another after updating the initial post above. The repo will always have the latest preview, and new buttons. As mentioned above, the latest push contains cleanup and consistency for existing buttons as well as several new ones. Download from or fork the Builder Buttons Github repository Enjoy!
-
@modifiedcontent Virtualmin is open source and has a free community version. You can host multiple sites and have multiple users. Unless you're running a serious enterprise multi-server hosting business, I think Virtualmin would suit you just fine. What constitutes "use my websites professionally" more has to do with the features you expect to need. Virtualmin has an easy and clear breakdown of whether you're a person who actually needs a professional license at all, and "best" is very subjective. Personal preference, I've never liked cPanel but it's popular so some people think it's the best for them. I'm not an expert in server management software, but from what I've used I like Virtualmin the best. A downside for a more casual user is that the main admin (the one that manages users and has total control of the server) has a lot of features and may involve a little bit of a learning curve. It's likely not something you can't handle, but you have much more granular control over the server and users. I may have used Plesk in the past, probably through some managed hosting provider but it's not memorable enough to have an opinion. Given that the software you do choose is going to manage your server for the long term and there are open source/free versions, it's worth spending an afternoon trying them out. Spin up a cheap VPS, install the software, play around with it, then destroy the instance and review your notes. I've never been satisfied by just comparing specs or features "on paper" so to speak when it comes to server management software. It's something you have to feel out. Honestly- spending some time and getting a feel for the software is time well spent. You can be confident that the hours you spend up front now will ensure that you don't need to spend way, way, way more time later migrating all of your sites later because you find you can't live with it. Vultr has a marketplace that you can select an image to spin up a VPS with both cPanel and Plesk. It doesn't include Virtualmin or Vesta but those are essentially single line bash command installs. Just remember that if you're going to install Virtualmin, spin up a blank server with Linux and without any web hosting applications like Apache or MySQL- Virtualmin will take care of all of that.
- 10 replies
-
- 1
-
- hosting services
- vps
-
(and 1 more)
Tagged with:
-
@bernhard <section class="rpb-quote page-section rpb-block" data-rpbblock=5827 alfred='{"icons":[{"icon":"edit","tooltip":"Edit Block #5827","href":"\/admin\/page\/edit\/?id=5827&language=1027","class":"pw-modal alfred-edit","suffix":"data-buttons=\"button.ui-button[type=submit]\" data-autoclose data-reload"},{"icon":"clone","label":""Five International Architecture Festivals Worth Building a Trip Around"","tooltip":"Clone Block #5827","href":"\/admin\/rockpagebuilder\/clone\/?block=5827","confirm":"Do you really want to clone this element?"},{"icon":"moveh","label":""Five International Architecture Festivals Worth Building a Trip Around"","tooltip":"Move Block #5827","class":"pw-modal","href":"\/admin\/page\/edit\/?id=1&language=1027&field=rockpagebuilder_blocks&rpb-moveblock=5827","suffix":"data-buttons=\"button.ui-button[type=submit]\" data-autoclose data-reload"},{"icon":"trash-2","label":""Five International Architecture Festivals Worth Building a Trip Around"","tooltip":"Trash Block #5827","href":"\/admin\/rockpagebuilder\/trash\/?block=5827","confirm":"Do you really want to delete this element?"},{"icon":"code","label":"\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte","href":"subl:\/\/open\/?url=file:\/\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte&line=%line","tooltip":"\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte"},{"icon":"php","label":"\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php","href":"subl:\/\/open\/?url=file:\/\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php&line=%line","tooltip":"\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php"}],"addTop":"\/admin\/rockpagebuilder\/add\/?block=5827&above=1","addBottom":"\/admin\/rockpagebuilder\/add\/?block=5827","addLeft":null,"addRight":null,"widgetStyle":false,"type":"Quote"}'> <div class="pt-4 px-5 md:px-10 lg:px-16"> <blockquote class="relative w-fit max-w-[60rem] mx-auto"> <span class="block absolute top-0 left-0 w-20 h-20 text-neutral-100 transform -translate-x-8 -translate-y-8 child-svg:w-full child-svg:fill-neutral-200"> <?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" aria-hidden="true" role="img" aria-labelledby="title-bc232395-adec-49ef-877a-a8c1d379b1d1"><title id="title-bc232395-adec-49ef-877a-a8c1d379b1d1">Open Quote</title><path d="M7.39762 10.3C7.39762 11.0733 7.14888 11.7 6.6514 12.18C6.15392 12.6333 5.52552 12.86 4.76621 12.86C3.84979 12.86 3.09047 12.5533 2.48825 11.94C1.91222 11.3266 1.62421 10.4467 1.62421 9.29999C1.62421 8.07332 1.96459 6.87332 2.64535 5.69999C3.35231 4.49999 4.33418 3.55332 5.59098 2.85999L6.4943 4.25999C5.81354 4.73999 5.26369 5.27332 4.84476 5.85999C4.45201 6.44666 4.19017 7.12666 4.05926 7.89999C4.29491 7.79332 4.56983 7.73999 4.88403 7.73999C5.61716 7.73999 6.21938 7.97999 6.69067 8.45999C7.16197 8.93999 7.39762 9.55333 7.39762 10.3ZM14.6242 10.3C14.6242 11.0733 14.3755 11.7 13.878 12.18C13.3805 12.6333 12.7521 12.86 11.9928 12.86C11.0764 12.86 10.3171 12.5533 9.71484 11.94C9.13881 11.3266 8.85079 10.4467 8.85079 9.29999C8.85079 8.07332 9.19117 6.87332 9.87194 5.69999C10.5789 4.49999 11.5608 3.55332 12.8176 2.85999L13.7209 4.25999C13.0401 4.73999 12.4903 5.27332 12.0713 5.85999C11.6786 6.44666 11.4168 7.12666 11.2858 7.89999C11.5215 7.79332 11.7964 7.73999 12.1106 7.73999C12.8437 7.73999 13.446 7.97999 13.9173 8.45999C14.3886 8.93999 14.6242 9.55333 14.6242 10.3Z" /></svg> </span> <div class="relative z-10 prose prose-neutral max-w-none"> <em class="text-lg leading-relaxed tracking-wide sm:text-xl md:text-2xl"><div id=pw-edit-5 class='pw-edit pw-edit-InputfieldTextarea' data-name=rpbblock_textarea data-page=5827 data-lang='1027' style='position:relative'><div class=pw-edit-orig>One of the top five international architecture festivals in the world.</div><div class=pw-edit-copy id=pw-editor-rpbblock_textarea-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>One of the top five international architecture festivals in the world.</div></div></em> </div> <footer class="mt-4 md:mt-6 pl-4 md:pl-10"> <div class="flex items-center justify-center md:justify-start space-x-4"> <div> <div class="text-base md:text-lg text-neutral-700"><span id=pw-edit-8 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=5827 data-lang='1027' style='position:relative'><span class=pw-edit-orig>"Five International Architecture Festivals Worth Building a Trip Around"</span><span class=pw-edit-copy id=pw-editor-title-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>"Five International Architecture Festivals Worth Building a Trip Around"</span></span></div> <div class="text-sm md:text-lg text-neutral-600 mt-2 pl-6"> <a href="https://robbreport.com/shelter/spaces/five-international-architecture-festivals-1235458827/https://robbreport.com/shelter/spaces/five-international-architecture-festivals-1235458827/" class="!no-underline" rel="noopener nofollow" target="_blank"> <span id=pw-edit-12 class='pw-edit pw-edit-InputfieldText' data-name=rpbblock_text data-page=5827 data-lang='1027' style='position:relative'><span class=pw-edit-orig>β Robb Report</span><span class=pw-edit-copy id=pw-editor-rpbblock_text-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>β Robb Report</span></span> </a> </div> </div> </div> </footer> </blockquote> </div> </section>
-
-
When you try to edit a "widget" but something broke with the theme and the entire website goes down, front end, admin, everything. Rendered completely inaccessible. When I say "broke with the theme" I mean, best guess because it's impossible to tell. Then you, the person who was just asked to update the name of a person and an email address on the page has to explain why the client's site is down without looking like a complete idiot. Not sure if anyone had started following the WordPress ecosystem, which has further devolved into 3 dumpsters put into a pile and lit on fire, but it's been wild. https://www.theverge.com/2024/10/12/24268637/wordpress-org-matt-mullenweg-acf-fork-secure-custom-fields-wp-engine
-
Pull request got merged into the dev branch, PW should be in an upcoming release of Devicons. https://github.com/devicons/devicon/pull/1905 Wait... what year is it?!
-
I've used DigitalOcean for years and the experience has been great, but little less over time. Ever since they went public with their IPO they've raised their prices noticeably and it feels like there are a bunch of upcharges for things that should be included. As a word of warning to anyone stumbling across this post, don't even bother with their managed databases. Terrible performance with high latency that really slows down applications. Not surprised that @ErikMH tests of DO vs others showed lag. I'm going to take a look at Vultr for my next move, the pricing looks good, like DO used to be. @modifiedcontent The flavor of Linux you choose will have less of an impact than the hardware. I tend to go with Ubuntu on servers because everything is easily available through apt repositories and it has wide support. You could say the same for Debian, but I go with Ubuntu since they offer Expanded Security Maintenance and Livepatch services. Knowing that there's automatic updates to the server is nice. Combine that with configuring unattended-upgrades and it's a good way to keep things up to date. When you read the information on their site about these services, the language targets the enterprise, however when you create an account you can get these services for free for a limited number of machines. I've run ProcessWire on both Ubuntu and Alpine and didn't notice a difference other than Alpine was a little more bare bones. As long as the server can handle PHP and a database, ProcessWire won't know the difference. You're better off focusing on optimizing PHP-FPM workers and taking advantage of the strong PHP features like OPcache, adding the ModPageSpeed module, and JIT compiling (if it suits your use case). If you choose to explore using ModPageSpeed that will be an easy add and configuration on Ubuntu, Alpine will require a Docker container and extra work. As for a recommendation on hardware, NVMe drives will likely have the most impact on performance, followed by the processor. Depending on how much you expect your server to handle, they're worth the few extra bucks if it's in your budget. I've switched between the basic VPS and a VPS with an upgraded drive and CPU and the difference was noticeable in how fast the PW admin runs. ProCache content is also delivered faster via NVMe. I saw some benchmarks that were performed on a DO droplet and AMD beat out Intel easily on performance. Not sure if that translates to other cloud providers, but given what we've seen with Intel and their chip shenanigans in the past year, I'm all AMD these days. Not sure of how you prefer or plan to manage the server itself, but if you want a recommendation for a control panel, I've recently had a great experience with Virtualmin. It has a lot of UI control for some granular items that you would expect to manage from the CLI. I've managed VPSs via both, and have long preferred managing everything via bare SSH and bash but Virtualmin offers pretty much everything you need in a gui, and is great on performance. It also makes managing resources much easier than CLI, like how much RAM is dedicated to the database process (if you choose to run your DB on the same server), which makes it great for running lean on lower spec servers. I did just migrate to Virtualmin + bare Ubuntu from OpenLiteSpeed + CyberPanel within the last month. OLS has some attractive features out of the box, like native support for HTTP3 which provides excellent speed on TTFB, but it comes with tradeoffs and locks a lot of things behind an upgrade package that is hard to justify in cost. OLS locks you to one worker process unless you purchase a very expensive enterprise upgrade. I use ProCache to deliver content where possible but there are times when you can't, and the PW admin can run noticeably slow. The HTTP3 and extra layer of built-in caching are eclipsed by less than stellar performance everywhere else. I added some extras here that nobody asked for, but if anyone else has some experiences they can share I'm interested in hearing more from the community as well.
- 10 replies
-
- 4
-
- hosting services
- vps
-
(and 1 more)
Tagged with:
-
First time I've run into this. I have a block called "Quote" and I've used it on one template but started getting this error when using it on a different template. I removed all of my block markup but still getting the error. It looks like the {alfred($block)} call is inserting JSON into the element I feel like there's something I'm missing but can't figure out what would be causing it and not sure where to start looking.