Nibble 0.23.0
Menus that do more, and blocks you add instead of copy. Menus gain headings, fields and kinds of their own, lists that fill themselves and show dates; a theme adds blocks to Nibble’s standard ones; and crumbs, the theme every site starts from, uses all of it.
This release is mostly menus, blocks and the default theme. It adds no database migrations; its content migrations for menus and global sets run only when a site writes them.
What’s new
bin/rails nibble:schema:types --without-sitewrites a theme’s types from Nibble’s schema and the theme’s alone, leaving outsite/schema, so a theme you publish can be type-checked as it ships, whatever the site you develop it in changes.- Themes get the site’s time zone as
site.time_zone, an IANA name such asAustralia/Sydney, in every view’s props, so a theme can date a post on the day it happened where the site is rather than in UTC. - crumbs uses what themes can do now. It shows dates in the page’s locale and the site’s time zone, asks listing
queries for only the fields it draws, sets
sizeson its card and hero images, and counts each topic’s articles. Its Main menu draws nested items, as a dropdown that works without JavaScript and an indented list on phones; its footer draws the Footer menu, falling back to Main while that is empty; its header shows the Site logo when one is set. Its 404 page offers the menu, a search box and the latest articles; search results say whether a hit is an article or a page and where a page sits; the embed block plays YouTube and Vimeo videos in privacy-friendly players and links anything else; form fields sit side by side by theirwidthhint; and the fallback taxonomy views show a term’s description. - Menus can hold more than links. A navigation can allow headings (
headings: true), links to a global’s address field (globals:) and to files (assets: true), and fields of its own on every item (item_fields:), such as a description or an icon;entry_fields:hands a theme chosen fields of the page an item links to. Any item can open in a new tab, be hidden, or show only between two dates, and cached pages change at each date. A menu that declares none of this behaves, stores and types exactly as before. - Mega menus, when a navigation asks for them.
kinds:declares item kinds of its own, such as a featured card with an image and a button, each saying whether it links and holds children.queries:lets an item list a collection’s published pages — a page’s children, or a term’s entries, sorted, up to 50 — so a new page appears without editing the menu; any change to that collection clears the pages that show the menu, so keep it for small collections. - Each menu item tells a theme whether it is the current page (
current) or leads to it (in_trail), so themes stop working it out themselves, anduseNavigation('main')is typed from the menu’s schema:@site/typesgains a<Menu>NavigationItemper menu that narrows onkind. Apps and agents are told each menu’s item shape. - The menu editor adds headings, site-setting and file links, Open in a new tab, Hidden, the menu’s own fields and kinds, lists of pages, and show dates; items can be duplicated, collapsed and moved by keyboard as well as dragged between levels, and a refused save marks the item each problem is on.
- Content packages carry every kind of menu item, naming the pages, terms and files it links to by key. An existing package imports as before.
- A theme or site adds blocks to Nibble’s standard ones with
add_setsunder a reference’sconfig:, and leaves some out withremove_sets, instead of copying the whole list.nibble:checkrefuses an added block whose handle is taken or a removal of one that isn’t there, and warns when a removed block still holds saved content. - Content migrations rename and delete menus and global sets:
rename_navigation,delete_navigation,rename_globalanddelete_global, in every locale and with their permissions.nibble:checkwarns about a menu stored for a navigation the schema no longer has, and names the migration that clears it. - crumbs uses all of it: its header and footer mark the current page and section from the menu, open new-tab
items in a new tab and say so to screen readers, and draw headings as dropdown titles and footer columns (crumbs’
Footer menu allows headings and two levels); its pages offer a Latest posts block, added with
add_sets.
What’s fixed
nibble:checkacceptsmessages.uniqueon a field the form’slimits.uniquenames. It said the field had no rule for that message, though a repeated value shows it.- crumbs’ contact form takes posts without JavaScript when it is paced. It now sends the
_nibble_thidden input, so a form withspam.min_secondsno longer counts every no-JavaScript post as spam. - crumbs opens off-site menu items. It drew them with Inertia’s
Link, which can’t leave the site, so a menu item such as GitHub did nothing; it uses a plain link now, as the CTA block does for an off-site link. - crumbs’ light or dark choice arrives with the page. It is kept in the
nibble_themecookie, so a returning visitor doesn’t see the other scheme first; a choice an earlier crumbs saved carries over. - crumbs loads its fonts from the page head, not an
@importthat held up the stylesheet, and its footer no longer prints the year, which a cached page could show stale. - Renaming a collection keeps who may edit it.
rename_collectionmoves roles’, connected apps’ and Agent access permissions to the new handle, anddelete_collectionremoves them; they stayed on the old handle, so the collection quietly disappeared for every editor who wasn’t a superuser.nibble:checkno longer stops an upgrade over a role naming a handle that a pending migration renames. - The menu editor offers only the levels a menu allows. It offered one more than
max_depth, which the save then refused, and a menu withoutmax_depthis no longer held to three levels. - Re-importing a package doesn’t count a menu as changed because a save stores an item’s field differently from how the package spells it.
Changed
- crumbs’ starter contact form is paced instead of using a CAPTCHA.
spam.min_seconds: 3andspam.max_links: 2replacecaptcha: true, so a fresh install takes messages without keys. A page that shows the form is no longer kept in the page cache, since each visit needs a fresh timestamp.
Upgrade:
- A site that relied on crumbs’ CAPTCHA keeps it with a form of its own. Copy
vendor/nibble/themes/crumbs/schema/forms/contact.ymltosite/schema/forms/contact.ymland setspam: { captcha: true }. - A theme that draws a paced form with its own markup adds the timestamp. Add
<input v-if="form.timestamp" type="hidden" name="_nibble_t" :value="form.timestamp" />, or posts without JavaScript are counted as spam. - A site that renamed a collection before this release re-ticks that collection’s permissions under Roles, checks its row under Agent access, and reconnects apps that were granted it.