{"version":3,"sources":["webpack://ecoverso.org/./src/rows/Blog.tsx","webpack://ecoverso.org/./src/rows/CommunityArticles.tsx","webpack://ecoverso.org/./src/rows/HeroBlog.tsx","webpack://ecoverso.org/./src/rows/Sidebar.tsx","webpack://ecoverso.org/./src/templates/wpBlogCategory.tsx"],"names":["title","description","image","posts","allPosts","categories","tags","useI18next","t","category","className","relatedPosts","articlesType","articlesCount","noTitle","display","exceptPostUid","shownArticles","length","filter","post","details","uid","ArticleDetailed","width","height","highlighted","undefined","to","file","featuredImage","type","authors","map","author","i","key","dangerouslySetInnerHTML","__html","excerpt","date","ArticleDetailedVertical","Article","articleDistributions","compact","component","full","minor","test","randomDistribution","articles","Math","min","currentDistribution","floor","random","layout","Component","push","sitemap","style","marginBottom","decodeHTMLEntities","slug","language","nodes","name","tag","visible","props","data","wordPress","recentPosts","imageFile","publicURL","label","siteMap"],"mappings":"6KAyHA,aAAe,GAAuE,IAApEA,EAAmE,EAAnEA,MAAOC,EAA4D,EAA5DA,YAAaC,EAA+C,EAA/CA,MAAOC,EAAwC,EAAxCA,MAAOC,EAAiC,EAAjCA,SAAUC,EAAuB,EAAvBA,WAAYC,EAAW,EAAXA,MAC1DC,UAANC,EAER,OACE,gCACE,gBAAC,IAAD,CAAUN,MAAOA,EAAOF,MAAOC,EAAaQ,SAAUT,IAEtD,uBAAKU,UAAU,2BACb,uBAAKA,UAAU,+BACb,gBAAC,IAAD,CAAmBN,SAAUD,EAAOQ,aAAc,GAAIC,aAAa,MAAMC,cAAe,EAAGC,SAAO,EAACC,QAAQ,UAE7G,gBAAC,IAAD,CAASX,SAAUA,EAAUC,WAAYA,EAAYC,KAAMA,Q,4FC+HnE,IAxNkD,SAAC,GAAyG,IAAvGI,EAAsG,EAAtGA,UAAWC,EAA2F,EAA3FA,aAAcP,EAA6E,EAA7EA,SAAUQ,EAAmE,EAAnEA,aAAcC,EAAqD,EAArDA,cAAeG,EAAsC,EAAtCA,cAAeF,EAAuB,EAAvBA,QAASC,EA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,GACd,IAAQ7D,GAAMD,UAANC,EACFC,EAAW4D,EAAMC,KAAKC,UAAU9D,SAEhCN,EAAoBkE,EAAMC,KAAKC,UAAU9D,SAASN,MAAM8D,MACxDO,EAA0BH,EAAMC,KAAKC,UAAUC,YAAYP,MAC3D5D,EAA6BgE,EAAMC,KAAKC,UAAUlE,WAAW4D,MAC7D3D,EAAkB+D,EAAMC,KAAKC,UAAUjE,KAAK2D,MAKlD,OACE,gBAAC,IAAD,KACE,gBAAC,KAAD,CACEjE,MAAOS,EAASyD,KAChBjE,YAAaQ,EAASR,YACtBC,MAAOO,EAASY,QAAQS,cAAc2C,UAAUC,YAElD,gBAAC,KAAD,CACEJ,KAAM,CAAC,CAAE1C,GAAI,IAAK+C,MAAOnE,EAAE,SAAW,CAAEoB,GAAIgD,aAAkBD,MAAOnE,EAAE,SAAW,CAAEmE,MAAOlE,EAASyD,SAGtG,gBAAC,IAAD,CACElE,MAAOS,EAASyD,KAChBjE,YAAaQ,EAASR,YACtBC,MAAOO,EAASY,QAAQS,cACxB3B,MAAOA,EACPE,WAAYA,EACZC,KAAMA,EACNF,SAAUoE","file":"component---src-templates-wp-blog-category-tsx-ec37590a3e790907e63e.js","sourcesContent":["import React from \"react\"\nimport { graphql } from \"gatsby\"\nimport GridLayout from \"../Layout/GridLayout\"\nimport { FormatDate, useI18next, Link } from \"../i18n\"\n\nimport { ImageData, Image, Icon } from \"../Layout/Components\"\nimport { DynamicRow, RowData } from \"./DynamicRow\"\nimport HeroBlog from \"./HeroBlog\"\nimport WPComments, { CommentData } from \"./WPComments\"\nimport CommunityArticles from \"./CommunityArticles\"\n\nimport { Seo } from \"../seo\"\nimport { decodeHTMLEntities } from \"../Layout/utils/utils\"\nimport Sidebar from \"./Sidebar\"\n\nexport type PostData = {\n title: string\n id: string\n databaseId: number\n date: string\n modified: string\n slug: string\n language: {\n slug: string\n }\n translations: [\n {\n slug: string\n language: {\n slug: string\n }\n }\n ]\n seo: {\n title: string\n metaDesc: string\n }\n categories: {\n nodes: [\n {\n name: string\n slug: string\n details: { uid: string }\n }\n ]\n }\n tags: {\n nodes: [\n {\n name: string\n slug: string\n }\n ]\n }\n details: {\n uid: string\n authors: [\n {\n id: string\n title: string\n details: {\n ownedCars: string\n bio: string\n titolo: string\n photo: ImageData\n }\n }\n ]\n excerpt: string\n rows: RowData[]\n featuredImage: ImageData\n }\n commentCount: number\n commentStatus: string\n comments: { nodes: CommentData[] }\n}\n\nexport type CategoryData = {\n slug: string\n name: string\n details: { uid: string }\n language: { slug: string }\n posts: {\n nodes: [\n {\n title: string\n slug: string\n date: string\n }?\n ]\n }\n}\n\nexport type TagData = {\n slug: string\n name: string\n details: {\n uid: string\n visible: boolean\n }\n posts: {\n nodes: [\n {\n title: string\n slug: string\n date: string\n }?\n ]\n }\n}\n\ntype Props = {\n title: string\n description: string\n image: ImageData\n relatedPosts: PostData[]\n allPosts: PostData[]\n categories: CategoryData[]\n tags: TagData[]\n}\n\nexport default ({ title, description, image, posts, allPosts, categories, tags }) => {\n const { t } = useI18next()\n\n return (\n <>\n \n\n
\n
\n \n
\n \n
\n \n )\n}\n","import React from \"react\"\nimport { graphql, useStaticQuery } from \"gatsby\"\nimport { FormatDate, Link, useI18next } from \"../i18n\"\nimport { Image, ImageData } from \"../Layout/Components\"\n\nimport sitemap from \"../sitemap\"\n\nexport type PostData = {\n title: string\n date: string\n details: {\n uid: string\n authors: [\n {\n id: string\n title: string\n details: {\n titolo: string\n }\n }\n ]\n excerpt: string\n featuredImage: ImageData\n layout: {\n highlighted: boolean\n minor: boolean\n }\n }\n commentCount: string\n}\n\ntype Props = {\n className?: string\n relatedPosts: PostData[]\n allPosts: PostData[]\n articlesType?: \"all\" | \"related\"\n articlesCount?: 0 | 1 | 3 | 5 // 0 = All\n exceptPostUid?: string\n noTitle?: boolean\n random?: boolean\n display?: \"random\" | \"compact\" | \"full\" // default = \"compact\"\n}\n\nexport const CommunityArticles: React.FC = ({ className, relatedPosts, allPosts, articlesType, articlesCount, exceptPostUid, noTitle, display }) => {\n const { t } = useI18next()\n\n display = display || \"compact\"\n let posts = articlesType == \"all\" ? allPosts : relatedPosts\n // posts = [...posts, ...posts, ...posts, ...posts, ...posts, ...posts, ...posts, ...posts, ...posts]\n // const shownArticles = articlesCount == posts.length ? 3 : articlesCount == 0 ? posts.length : articlesCount\n const shownArticles = articlesCount == null || articlesCount == 0 ? posts.length : articlesCount\n\n // eventually filter\n if (exceptPostUid) {\n posts = posts.filter((post) => post.details.uid != exceptPostUid)\n }\n\n // If no posts do not render\n if (posts.length == 0) return null\n\n const ArticleDetailed: React.FC<{ post: PostData; width?: number; height?: number; highlighted: boolean }> = ({ post, width, height, highlighted }) => {\n if (post == undefined) return null\n return (\n \n \n
\n
\n {post.details.authors.map((author, i: number) => (\n \n {author.title}\n {i < post.details.authors.length - 2 ? t(\",\") : \"\"}\n {i == post.details.authors.length - 2 ? t(\" e\") : \"\"}{\" \"}\n \n ))}\n
\n

\n
\n
\n
\n \n
\n \n
\n
\n
\n \n )\n }\n\n const ArticleDetailedVertical: React.FC<{\n post: PostData\n width?: number\n height?: number\n highlighted: boolean\n }> = ({ post, width, height, highlighted }) => {\n if (post == undefined) return null\n return (\n \n \n
\n
\n {post.details.authors.map((author, i: number) => (\n \n {author.title}\n {i < post.details.authors.length - 2 ? t(\",\") : \"\"}\n {i == post.details.authors.length - 2 ? t(\" e\") : \"\"}{\" \"}\n \n ))}\n
\n

\n
\n
\n
\n \n
\n \n
\n
\n
\n \n )\n }\n\n const Article: React.FC<{ post: PostData; width?: number; height?: number; highlighted: boolean }> = ({ post, width, height, highlighted }) => {\n if (post == undefined) return null\n return (\n \n
\n
\n {post.details.authors.map((author, i: number) => (\n \n {author.title}\n {i < post.details.authors.length - 2 ? t(\",\") : \"\"}\n {i == post.details.authors.length - 2 ? t(\" e\") : \"\"}{\" \"}\n \n ))}\n
\n

\n
\n
\n
\n \n
\n \n
\n
\n
\n \n )\n }\n\n //-----------------------------------------------------------------------------------------------\n // Possible distributions\n\n const articleDistributions = {\n compact: [\n { width: 12, height: 1, highlighted: false, component: ArticleDetailed },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: ArticleDetailedVertical },\n { width: 6, height: 1, highlighted: false, component: ArticleDetailedVertical },\n ],\n full: [\n { width: 12, height: 1, highlighted: false, component: ArticleDetailedVertical },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailed },\n { width: 6, height: 2, highlighted: false, component: ArticleDetailedVertical },\n ],\n minor: [{ width: 6, height: 1, highlighted: false, component: Article }],\n test: [\n { width: 6, height: 2, highlighted: true, component: ArticleDetailedVertical },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 2, highlighted: false, component: ArticleDetailedVertical },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailed },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n ],\n }\n\n const randomDistribution = [\n { width: 12, height: 1, highlighted: true, component: ArticleDetailedVertical },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailedVertical },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailedVertical },\n { width: 6, height: 2, highlighted: true, component: ArticleDetailedVertical },\n { width: 6, height: 2, highlighted: false, component: ArticleDetailedVertical },\n { width: 6, height: 2, highlighted: false, component: ArticleDetailedVertical },\n { width: 12, height: 1, highlighted: true, component: ArticleDetailed },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailed },\n { width: 12, height: 1, highlighted: false, component: ArticleDetailed },\n { width: 6, height: 1, highlighted: true, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n { width: 6, height: 1, highlighted: false, component: Article },\n ]\n\n //-----------------------------------------------------------------------------------------------\n\n // Render all the articles\n let articles = []\n for (let i = 0; i < Math.min(shownArticles, posts.length); i++) {\n let currentDistribution: { width: number; height: number; highlighted: boolean; component: any }\n switch (display) {\n case \"random\":\n currentDistribution = { ...randomDistribution[Math.floor(Math.random() * randomDistribution.length)] }\n break\n case \"compact\":\n currentDistribution = {\n ...articleDistributions[\"compact\"][i % articleDistributions[\"compact\"].length],\n highlighted: posts[i].details.layout.highlighted,\n }\n break\n case \"full\":\n // after rendering the first posts as dictated by \"full\" distribution, consider also rendering possible \"minor\" posts\n currentDistribution =\n posts[i].details.layout.minor && i > articleDistributions[\"full\"].length - 1\n ? {\n ...articleDistributions[\"minor\"][i % articleDistributions[\"minor\"].length],\n highlighted: posts[i].details.layout.highlighted,\n }\n : {\n ...articleDistributions[\"full\"][Math.min(i, articleDistributions[\"full\"].length - 1)],\n highlighted: posts[i].details.layout.highlighted,\n }\n break\n }\n\n const Component = currentDistribution.component\n articles.push(\n \n )\n }\n\n return (\n
\n {noTitle ? null : (\n
\n

Gli articoli del nostro Blog

\n \n vai al blog\n \n
\n )}\n
{articles}
\n
\n )\n}\n\nexport default CommunityArticles\n\n// Query fragment to include in graphql\nexport const query = graphql`\n fragment post on Wordpress_Post {\n title\n date\n details {\n uid\n excerpt\n layout {\n highlighted\n minor\n }\n featuredImage {\n ...imageData\n }\n authors {\n ... on Wordpress_Person {\n id\n title\n details {\n titolo\n }\n }\n }\n }\n commentCount\n }\n fragment relatedPosts on Wordpress {\n relatedPosts: posts(where: { language: $languageCode, orderby: { field: DATE, order: DESC }, tagSlugIn: $tags }, first: $relatedPostsLimit) {\n nodes {\n ...post\n }\n }\n }\n fragment recentPosts on Wordpress {\n recentPosts: posts(where: { language: $languageCode, orderby: { field: DATE, order: DESC } }, first: 5) {\n nodes {\n ...post\n }\n }\n }\n`\n","import React, { useState } from \"react\"\nimport Tabs from \"../Layout/Components/Tabs\"\nimport { ColumnData } from \"./DynamicRow\"\nimport { Image, Button, ImageData } from \"../Layout/Components\"\n\ntype Props = {\n image: ImageData\n category: string\n title: string\n}\n\nconst HeroBlog: React.FC = ({ image, category, title }) => {\n return (\n
\n
\n \n
\n
\n
\n
\n

\n
\n
\n )\n}\n\nexport default HeroBlog\n","import React from \"react\"\nimport { graphql } from \"gatsby\"\nimport { FormatDate, useI18next, Link } from \"../i18n\"\nimport { decodeHTMLEntities } from \"../Layout/utils/utils\"\nimport { CategoryData, PostData, TagData } from \"./Blog\"\n\ntype Props = {\n relatedPosts?: PostData[]\n allPosts: PostData[]\n categories: CategoryData[]\n tags: TagData[]\n}\n\nexport const Sidebar: React.FC = ({ relatedPosts, allPosts, categories, tags }) => {\n const { t } = useI18next()\n\n return (\n
\n

{t(\"Articoli recenti\")}

\n {allPosts.map((post, i) => (\n
\n {decodeHTMLEntities(post.title)}\n
\n ))}\n

{t(\"Categorie\")}

\n {categories.map((category, i) => {\n if (category.slug == category.language.slug) return null\n if (category.posts.nodes.length == 0) return null\n return (\n
\n \n {category.name} [{category.posts.nodes.length}]\n \n
\n )\n })}\n

{t(\"Tag\")}

\n {tags.map((tag, i) => {\n if (!tag.details.visible) return null\n if (tag.posts.nodes.length == 0) return null\n return (\n
\n \n {tag.name} [{tag.posts.nodes.length}]\n \n
\n )\n })}\n
\n )\n}\n\nexport default Sidebar\n\n// Query fragment to include in graphql\nexport const query = graphql`\n fragment sidebarData on Wordpress {\n categories(where: { language: $languageCode }, first: 1000) {\n nodes {\n slug\n name\n details {\n uid\n }\n language {\n slug\n }\n posts(where: { orderby: { field: DATE, order: DESC } }, first: 1000) {\n nodes {\n title\n slug\n date\n }\n }\n }\n }\n tags(where: { language: $languageCode }, first: 1000) {\n nodes {\n slug\n name\n details {\n uid\n visible\n }\n posts(where: { orderby: { field: DATE, order: DESC } }, first: 1000) {\n nodes {\n title\n slug\n date\n }\n }\n }\n }\n }\n`\n","import React from \"react\"\nimport { graphql } from \"gatsby\"\nimport GridLayout from \"../Layout/GridLayout\"\nimport { useI18next } from \"../i18n\"\n\nimport { Breadcrumbs } from \"../Layout/Components\"\nimport Blog, { PostData, CategoryData, TagData } from \"../rows/Blog\"\n\nimport { Seo } from \"../seo\"\nimport siteMap from \"../sitemap\"\n\nexport default (props) => {\n const { t } = useI18next()\n const category = props.data.wordPress.category\n\n const posts: PostData[] = props.data.wordPress.category.posts.nodes\n const recentPosts: PostData[] = props.data.wordPress.recentPosts.nodes\n const categories: CategoryData[] = props.data.wordPress.categories.nodes\n const tags: TagData[] = props.data.wordPress.tags.nodes\n\n //console.log(\"Props: \", props)\n //console.log(\"Context: \", props.pageContext)\n\n return (\n \n \n \n\n \n \n )\n}\n\n//query($id: ID!, $tags: [String!]) {\nexport const query = graphql`\n query($id: ID!, $languageCode: Wordpress_LanguageCodeFilterEnum!) {\n wordPress {\n category(id: $id) {\n description\n name\n details {\n uid\n featuredImage {\n ...imageData\n }\n }\n posts(where: { orderby: { field: DATE, order: DESC } }, first: 1000) {\n nodes {\n ...post\n }\n }\n }\n ...recentPosts\n ...sidebarData\n }\n }\n`\n"],"sourceRoot":""}