openvibers/openvibe.food Commits
Food near you is in search: /near says index without a search (it was noindex by default while the sitemap listed it); searches stay noindex (#67)
Changes
@@@ -156,8 +156,10 @@ ${raw(showcase.cta({}}const title = out && out.location.name ? `Food near ${out.location.name.split(',').slice(0, 2).join(',')}` : 'Food near you';++ // The page itself is in search (the sitemap lists it; it was noindex by default); a search's results are not.page(req, res, {title, description: 'Food banks, pantries and budget grocery stores near a place, from OpenStreetMap.',++ index: !wantsSearch(req), cache: !wantsSearch(req) && !signedIn(req) ? PUBLIC_CACHE : null,crumbs: [{ label: 'Food near you' }], styles: [showcase.STYLESHEET],body: html`<h1>Food near you</h1><p class="lede">Food banks, soup kitchens, community fridges, free pantry boxes and budget grocery stores, from OpenStreetMap.</p>@@@ -61,6 +61,8 @@ const foods = require('../server/food/foods');assert.match(r.text, /<link rel="canonical" href="[^"]*\/plan">/);const map = await t.get('/sitemap.xml');assert.match(map.text, /<loc>[^<]*\/plan<\/loc>/, 'and the sitemap lists it');++ // So is "food near you" itself; a search's results are not.++ assert.match((await t.get('/near')).text, /<meta name="robots" content="index, follow">/);});await check('the /foods page and one food page render server-side, per serving and per 100 g', async () => {
@@ -156,8 +156,10 @@ ${raw(showcase.cta({
@@ -156,8 +156,10 @@ ${raw(showcase.cta({
}
}
}
}
const title = out && out.location.name ? `Food near ${out.location.name.split(',').slice(0, 2).join(',')}` : 'Food near you';
const title = out && out.location.name ? `Food near ${out.location.name.split(',').slice(0, 2).join(',')}` : 'Food near you';
+ // The page itself is in search (the sitemap lists it; it was noindex by default); a search's results are not.
page(req, res, {
page(req, res, {
title, description: 'Food banks, pantries and budget grocery stores near a place, from OpenStreetMap.',
title, description: 'Food banks, pantries and budget grocery stores near a place, from OpenStreetMap.',
+ index: !wantsSearch(req), cache: !wantsSearch(req) && !signedIn(req) ? PUBLIC_CACHE : null,
crumbs: [{ label: 'Food near you' }], styles: [showcase.STYLESHEET],
crumbs: [{ label: 'Food near you' }], styles: [showcase.STYLESHEET],
body: html`<h1>Food near you</h1>
body: html`<h1>Food near you</h1>
<p class="lede">Food banks, soup kitchens, community fridges, free pantry boxes and budget grocery stores, from OpenStreetMap.</p>
<p class="lede">Food banks, soup kitchens, community fridges, free pantry boxes and budget grocery stores, from OpenStreetMap.</p>
@@ -61,6 +61,8 @@ const foods = require('../server/food/foods');
@@ -61,6 +61,8 @@ const foods = require('../server/food/foods');
assert.match(r.text, /<link rel="canonical" href="[^"]*\/plan">/);
assert.match(r.text, /<link rel="canonical" href="[^"]*\/plan">/);
const map = await t.get('/sitemap.xml');
const map = await t.get('/sitemap.xml');
assert.match(map.text, /<loc>[^<]*\/plan<\/loc>/, 'and the sitemap lists it');
assert.match(map.text, /<loc>[^<]*\/plan<\/loc>/, 'and the sitemap lists it');
+ // So is "food near you" itself; a search's results are not.
+ assert.match((await t.get('/near')).text, /<meta name="robots" content="index, follow">/);
});
});
await check('the /foods page and one food page render server-side, per serving and per 100 g', async () => {
await check('the /foods page and one food page render server-side, per serving and per 100 g', async () => {