Some plugins accept hints in their items that don't have any mechanism other than, say, choosing the right example from an about page. Here we devise a way to selectively apply a change to pages in the lineup.
We'll try this first with maps. See Item Type Survey.
LINEUP CLICK CODE lineup PREVIEW synopsis items
export function lineup(type) { let site = this.context.site let code = this.context.page.story[4] let text = this.items .map(item => `CLICK\n` + ` FROM ${item.site||site}/${item.slug}\n` + ` CODE apply\n` + ` PREVIEW page`) .join("\n") this.items = [{type:'mech',text},code] }
export function apply() { let tile = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' let page = this.page page.story.forEach(item => { if(item.type == 'map') item.tile = tile }) this.page = page }