{"version":3,"sources":["webpack://ecoverso.org/./src/pages/blog.tsx","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"],"names":["props","t","useI18next","category","data","wordPress","posts","nodes","recentPosts","categories","tags","title","description","to","label","image","details","featuredImage","allPosts","className","relatedPosts","articlesType","articlesCount","noTitle","display","exceptPostUid","shownArticles","length","filter","post","uid","ArticleDetailed","width","height","highlighted","undefined","file","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","name","tag","visible"],"mappings":"+LAWA,mBAAgBA,GACd,IAAQC,GAAMC,UAAND,EACFE,EAAWH,EAAMI,KAAKC,UAAUF,SAChCG,EAAoBN,EAAMI,KAAKC,UAAUC,MAAMC,MAC/CC,EAA0BR,EAAMI,KAAKC,UAAUG,YAAYD,MAC3DE,EAA6BT,EAAMI,KAAKC,UAAUI,WAAWF,MAC7DG,EAAkBV,EAAMI,KAAKC,UAAUK,KAAKH,MAKlD,OACE,gBAAC,IAAD,KACE,gBAAC,KAAD,CAAKI,MAAOV,EAAE,QAASW,YAAaT,EAASS,cAC7C,gBAAC,KAAD,CAAaR,KAAM,CAAC,CAAES,GAAI,IAAKC,MAAOb,EAAE,SAAW,CAAEa,MAAOb,EAAE,YAE9D,gBAAC,IAAD,CACEU,MAAOV,EAAE,QACTW,YAAaT,EAASS,YACtBG,MAAOZ,EAASa,QAAQC,cACxBX,MAAOA,EACPG,WAAYA,EACZC,KAAMA,EACNQ,SAAUV,O,8FCuFlB,aAAe,GAAuE,IAApEG,EAAmE,EAAnEA,MAAOC,EAA4D,EAA5DA,YAAaG,EAA+C,EAA/CA,MAAOT,EAAwC,EAAxCA,MAA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8B,KAAI,SAACpC,EAAUsC,GACzB,OAAItC,EAASkE,MAAQlE,EAASmE,SAASD,MACJ,GAA/BlE,EAASG,MAAMC,MAAMoB,OAD2B,KAGlD,uBAAKe,IAAKD,EAAGyB,MAAO,CAAEC,aAAc,SAClC,gBAAC,KAAD,CAAMtD,GAAI,QAAUV,EAASa,QAAQc,KAClC3B,EAASoE,KADZ,KACoBpE,EAASG,MAAMC,MAAMoB,OADzC,SAMN,sBAAIR,UAAU,QAAQlB,EAAE,QACvBS,EAAK6B,KAAI,SAACiC,EAAK/B,GACd,OAAK+B,EAAIxD,QAAQyD,QACa,GAA1BD,EAAIlE,MAAMC,MAAMoB,OAAoB,KAEtC,uBAAKe,IAAKD,EAAGyB,MAAO,CAAEC,aAAc,SAClC,gBAAC,KAAD,CAAMtD,GAAI,OAAS2D,EAAIxD,QAAQc,KAC5B0C,EAAID,KADP,KACeC,EAAIlE,MAAMC,MAAMoB,OAD/B,MAJ6B","file":"component---src-pages-blog-tsx-69fb7bb13e29f31ed84a.js","sourcesContent":["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 const posts: PostData[] = props.data.wordPress.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($language: ID!, $languageCode: Wordpress_LanguageCodeFilterEnum!) {\n wordPress {\n category(idType: SLUG, id: $language) {\n details {\n featuredImage {\n ...imageData\n }\n }\n description\n }\n posts(where: { orderby: { field: DATE, order: DESC } }, first: 1000) {\n nodes {\n ...post\n }\n }\n ...recentPosts\n ...sidebarData\n }\n }\n`\n","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"],"sourceRoot":""}