-
diff --git a/src/graphql/query/layout-recent.ts b/src/graphql/query/layout-recent.ts new file mode 100644 index 00000000..91b84957 --- /dev/null +++ b/src/graphql/query/layout-recent.ts @@ -0,0 +1,40 @@ +import { gql } from '@urql/core' + +export default gql` + query RecentShoutsForLayout($layout: String!, $amount: Int, $offset: Int) { + recentLayoutShouts(layout: $layout, amount: $amount, offset: $offset) { + _id: slug + title + subtitle + layout + slug + cover + # community + mainTopic + topics { + title + body + slug + stat { + _id: shouts + shouts + authors + followers + } + } + authors { + _id: slug + name + slug + userpic + } + createdAt + publishedAt + stat { + _id: viewed + viewed + reacted + } + } + } +` diff --git a/src/graphql/query/layout-top-month.ts b/src/graphql/query/layout-top-month.ts new file mode 100644 index 00000000..2e3100ff --- /dev/null +++ b/src/graphql/query/layout-top-month.ts @@ -0,0 +1,40 @@ +import { gql } from '@urql/core' + +export default gql` + query TopMonthShoutsForLayout($layout: String!, $amount: Int, $offset: Int) { + topMonthLayoutShouts(layout: $layout, amount: $amount, offset: $offset) { + _id: slug + title + subtitle + layout + slug + cover + # community + mainTopic + topics { + title + body + slug + stat { + _id: shouts + shouts + authors + followers + } + } + authors { + _id: slug + name + slug + userpic + } + createdAt + publishedAt + stat { + _id: viewed + viewed + reacted + } + } + } +` diff --git a/src/graphql/query/articles-for-layout.ts b/src/graphql/query/layout-top.ts similarity index 78% rename from src/graphql/query/articles-for-layout.ts rename to src/graphql/query/layout-top.ts index f5ea3c13..34da1292 100644 --- a/src/graphql/query/articles-for-layout.ts +++ b/src/graphql/query/layout-top.ts @@ -1,8 +1,8 @@ import { gql } from '@urql/core' export default gql` - query ShoutsForLayoutQuery($amount: Int, $offset: Int, $layout: String) { - shoutsByLayout(amount: $amount, offset: $offset, layout: $layout) { + query TopShoutsForLayout($layout: String!, $amount: Int, $offset: Int) { + topLayoutShouts(layout: $layout, amount: $amount, offset: $offset) { _id: slug title subtitle diff --git a/src/main.astro b/src/main.astro index a39f8e4f..63b790e0 100644 --- a/src/main.astro +++ b/src/main.astro @@ -1,5 +1,5 @@ --- -import { setLocale } from './stores/ui'; +import { setLocale } from './stores/ui' import './styles/app.scss' import { t } from './utils/intl' diff --git a/src/pages/404.astro b/src/pages/404.astro index 06d1839a..3fcad65b 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -1,5 +1,5 @@ --- -import Zine from '../main.astro' +import Prerendered from '../main.astro' import { Root } from '../components/Root' import { initRouter } from '../stores/router' @@ -9,6 +9,6 @@ initRouter(pathname, search) Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate') --- -