No web site should be a silo. A CMS should be great at organizing, syndicating, and presenting your content, but it should also communicate with arbitrary applications outside the CMS. In particular, mobile applications should be able to use the data from the CMS. In DecentCMS, you can enable the
content-apifeature to expose all content items as JSON documents.
Content items are then available under two endpoints:
In the previous two posts, I exposed the general design of DecentCMS’ search feature, and described its indexing and querying APIs. In this post, we’ll apply what we’ve learned to build a paginated list of search results that will display the list of API documentation topics.
In the previous post, we looked at the basic concepts DecentCMS querying are built upon, and at how an index is built. In this post, we’ll examine how to query such an index in order to produce a result set.
Great libraries don’t just package useful functionality in a re-usable package, they do so while reducing friction. Low friction means that the answer to “hey, wouldn’t it be great if you could just do X?”, is “yes, it would, and you can.” Doing something simple is never complicated, and the way to do it is easily found, if not plainly obvious. Using such libraries is a joy, never a struggle. Of course, getting results like those is far from being easy, and requires smart designs and clean implementations. Most of all, it requires the library author to put himself in the shoes of his users.
An order for an electric conversion of a vintage Porsche just arrived at Greg’s workshop. He follows a script that will implement the transformation of the car. He looks at the order, and sees that the customer bought the 70kWh battery. He picks up the right number of cells, and re-orders more to refill the stock. The batteries are secured in the trunk. Then, he removes the car’s engine, and disposes of it. He fits the electric motor in its place, and proceeds to route wires from the trunk to the engine’s compartment. The control system is then assembled. All these operations are done sequentially by Greg. In a few weeks, the car is ready.
Meanwhile, a few kilometers away, another order for a brand new electric car arrives at Elon’s factory. It should be an obsidian black metallic all-wheel drive with a 85kWh battery, panoramic roof, silver cyclone wheels, black leather seats, carbon fiber décor, black alcantara headliner, autopilot, and subzero weather package. That’s a lot of little independent details.