gatsby

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

寵の児 提交于 2021-02-08 16:21:56
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

六月ゝ 毕业季﹏ 提交于 2021-02-08 16:10:53
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

左心房为你撑大大i 提交于 2021-02-08 16:07:57
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list

How to limit and skip after grouping in a GraphQL query to paginate the tags list page?

别说谁变了你拦得住时间么 提交于 2021-02-08 16:06:23
问题 I'm trying to paginate the blog tags list page in a Gatsby site, the tags are defined in the frontmatter of the MDX files: --- title: Blog Post Title date: 2020-05-20 tags: ["Markdown", "Gatsby", "JavaScript"] --- Paginating the posts is easy using limit and skip passed in the page context object: query Posts($limit: Int!, $skip: Int!) { allMdx( sort: { fields: frontmatter___date, order: DESC } limit: $limit skip: $skip ) { nodes { ... } } But this doesn't apply for paginating the tags list

How do I turn off source maps in production in Gatsby v2?

*爱你&永不变心* 提交于 2021-02-08 15:18:31
问题 I'm struggling how to disable source maps for production since the default Webpack set up is to leave out the devtool option, but Gatsby v2 is enabling it. I've tried coming up with a way based on the old version and the new docs, but it doesn't work: // gatsby-node.js exports.onCreateWebpackConfig = ({ actions, stage }) => { if (stage === 'build-javascript') { // turn off source-maps actions.setWebpackConfig({ devtool: false }) } }; 回答1: The code in the question is the correct solution. The

Get WordPress Submenus in Gatsby JS

ぐ巨炮叔叔 提交于 2021-02-08 07:34:43
问题 I am fiddling around with Gatsby JS using WP as the backend and so far so good. Now I was trying to pull in the menu which for main menu items works just as expected. What I can't really wrap my head around is how to get the submenus pulled in. The only related thing I found was https://github.com/gatsbyjs/gatsby/issues/2426 which does give me the submenus if I log the data. Just can't get them to be pulled into the menu. Here is my query in layouts/index.js: export const query = graphql`

Gatsby dynamic routing breaks upon gh-pages deploy

半世苍凉 提交于 2021-02-07 20:55:18
问题 I deployed my first Gatsby project to github pages: repo: https://github.com/michal-kurz/stfuandclick gh-pages: https://michal-kurz.github.io/stfuandclick/app/ (generated from gh-pages branch) It has one page, src/pages/app.tsx , which uses use Reach Router for dynamic routing. // app.tsx const App = () => ( <> <GlobalStyles /> <Provider store={store}> <ThemeProvider theme={theme}> <Router> <Homepage path={`${BASE_URL}/app/`} /> <Team path={`${BASE_URL}/app/team/:teamName/`} /> </Router> <

Gatsby dynamic routing breaks upon gh-pages deploy

﹥>﹥吖頭↗ 提交于 2021-02-07 20:55:16
问题 I deployed my first Gatsby project to github pages: repo: https://github.com/michal-kurz/stfuandclick gh-pages: https://michal-kurz.github.io/stfuandclick/app/ (generated from gh-pages branch) It has one page, src/pages/app.tsx , which uses use Reach Router for dynamic routing. // app.tsx const App = () => ( <> <GlobalStyles /> <Provider store={store}> <ThemeProvider theme={theme}> <Router> <Homepage path={`${BASE_URL}/app/`} /> <Team path={`${BASE_URL}/app/team/:teamName/`} /> </Router> <

Gatsby dynamic routing breaks upon gh-pages deploy

℡╲_俬逩灬. 提交于 2021-02-07 20:54:12
问题 I deployed my first Gatsby project to github pages: repo: https://github.com/michal-kurz/stfuandclick gh-pages: https://michal-kurz.github.io/stfuandclick/app/ (generated from gh-pages branch) It has one page, src/pages/app.tsx , which uses use Reach Router for dynamic routing. // app.tsx const App = () => ( <> <GlobalStyles /> <Provider store={store}> <ThemeProvider theme={theme}> <Router> <Homepage path={`${BASE_URL}/app/`} /> <Team path={`${BASE_URL}/app/team/:teamName/`} /> </Router> <

How to use Environmental or OS variables in self-created JavaScript files

浪尽此生 提交于 2021-02-05 12:21:10
问题 I created a helpers.js under <project_root>/static folder Inside this JS file, I have method which needs access to the environmental/OS variables. async function saveRegistration(pushSubscriptionObject) { let url = ""; try { url = `${process.env.GATSBY_FUNCTION_URL_BASE}${process.env.GATSBY_FUNCTION_UPDATE_SUBSCRIPTION}`; console.log("using netlify config: ", url); console.log("--------updateSub() url--------", url); } catch (ex) { console.log("saveReg() catch block:", JSON.stringify(ex));