From abd9faf4f16d5eee863055f107816a808d339533 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 12 Jan 2024 13:22:41 +0100 Subject: [PATCH] Add author index (#60) * add author index * add lastModified back to default index --- helix-query.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 helix-query.yaml diff --git a/helix-query.yaml b/helix-query.yaml new file mode 100644 index 00000000..48f60c9d --- /dev/null +++ b/helix-query.yaml @@ -0,0 +1,52 @@ +version: 1 +indices: + default: + include: + - /** + target: /query-index.json + properties: + lastModified: + select: none + value: parseTimestamp(headers["last-modified"], "ddd, DD MMM YYYY hh:mm:ss GMT") + title: + select: head > meta[property="og:title"] + value: attribute(el, "content") + image: + select: head > meta[property="og:image"] + value: match(attribute(el, "content"), "https:\/\/[^/]+(/.*)") + description: + select: head > meta[name="description"] + value: attribute(el, "content") + authors: + include: + - /cigaradvisor/author/** + target: /cigaradvisor/author/query-index.json + properties: + name: + select: div:nth-of-type(1) > h2:nth-of-type(1) + value: | + textContent(el) + description: + select: div:nth-of-type(1) > p:nth-of-type(2) + value: | + textContent(el) + image: + select: div:nth-of-type(1) > p:nth-of-type(1) > picture:nth-of-type(1) > img + value: | + attribute(el, 'src') + twitter: + select: div:nth-of-type(1) > ul:nth-of-type(1) > li > a + value: | + match(attribute(el, 'href'), '^https?:\/\/(?:www\.)?twitter\.com\/(?:#!\/)?@?([^/?#]*)\/?(?:[?#].*)?$') + facebook: + select: div:nth-of-type(1) > ul:nth-of-type(1) > li > a + value: | + match(attribute(el, 'href'), '^https?:\/\/(?:www\.)?facebook\.com\/(?:#!\/)?@?([^/?#]*)\/?(?:[?#].*)?$') + instagram: + select: div:nth-of-type(1) > ul:nth-of-type(1) > li > a + value: | + match(attribute(el, 'href'), '^https?:\/\/(?:www\.)?instagram\.com\/(?:#!\/)?@?([^/?#]*)\/?(?:[?#].*)?$') + youtube: + select: div:nth-of-type(1) > ul:nth-of-type(1) > li > a + value: | + match(attribute(el, 'href'), '^https?:\/\/(?:www\.)?youtube\.com\/user\/(?:#!\/)?@?([^/?#]*)\/?(?:[?#].*)?$')