Skip to content

Commit

Permalink
Merge pull request #4 from w3f-webops/fix/source-filesystem-site-path
Browse files Browse the repository at this point in the history
fix sourcing of files when in site (vs in theme) /{content,media,locales}
  • Loading branch information
hugurp authored Aug 23, 2021
2 parents 9e101d8 + 3fd32cd commit 1308161
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
9 changes: 6 additions & 3 deletions gatsby-theme-w3f/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* to resolve "site" paths (vs. theme paths) */
require('path')

/* read the `.env.*` files, gatsby builtin */
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
Expand Down Expand Up @@ -79,7 +82,7 @@ module.exports = ({
resolve: `gatsby-source-filesystem`,
options: {
name: `media`,
path: `${__dirname}/media`,
path: path.resolve('media'),
},
},

Expand Down Expand Up @@ -120,15 +123,15 @@ module.exports = ({
resolve: `gatsby-source-filesystem`,
options: {
name: `content`,
path: `./content/`,
path: path.resolve('content'),
},
},

/* source the locales for gatsby-react-i18next */
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/locales`,
path: path.resolve('locales'),
name: `locale`,
},
},
Expand Down
4 changes: 2 additions & 2 deletions gatsby-theme-w3f/src/hooks/use-site-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const useSiteMenus = () => {
id
url
}
legal {
network {
id
url
}
extra {
community {
id
url
}
Expand Down
48 changes: 24 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2351,30 +2351,6 @@
"@typescript-eslint/types" "4.29.1"
eslint-visitor-keys "^2.0.0"

"@w3f/gatsby-theme-w3f@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@w3f/gatsby-theme-w3f/-/gatsby-theme-w3f-0.0.1.tgz#ee89db797eb5703b3eb8eb8c907f1dc061a0dc3d"
integrity sha512-0vOwNVW9zgHNoPGZraTfb562MTKYhAF/MRLveBqbL5HTFgvA1Zbw6+FDPOjpTRWfqmzAsYrE5OcM76VTD0Lw+g==
dependencies:
gatsby-plugin-image "^1.2.0"
gatsby-plugin-manifest "^3.2.0"
gatsby-plugin-netlify-cms "^5.8.0"
gatsby-plugin-offline "^4.2.0"
gatsby-plugin-react-helmet "^4.2.0"
gatsby-plugin-react-i18next "^1.1.1"
gatsby-plugin-react-svg "^3.0.1"
gatsby-plugin-sharp "^3.10.2"
gatsby-remark-images "^5.7.0"
gatsby-remark-relative-images "^2.0.2"
gatsby-source-filesystem "^3.2.0"
gatsby-transformer-remark "^3.1.0"
gatsby-transformer-sharp "^3.2.0"
i18next "^20.2.4"
netlify-cms-app "^2.15.20"
prop-types "^15.7.2"
react-helmet "^6.1.0"
react-i18next "^11.8.15"

"@webassemblyjs/[email protected]":
version "1.11.1"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7"
Expand Down Expand Up @@ -6829,6 +6805,30 @@ gatsby-telemetry@^2.11.0:
node-fetch "^2.6.1"
uuid "3.4.0"

gatsby-theme-w3f@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/gatsby-theme-w3f/-/gatsby-theme-w3f-0.0.1.tgz#83063d702ba1a74c8b8dc9bc27c04db461d1c10f"
integrity sha512-szhyW2hvUuZZUYo9dacA+j1i3Hx4uQRzy+oFPq2j8B+EmlR0L026rhIfhHFNghvOvlKsRCrHmV3dzUiUMy11EA==
dependencies:
gatsby-plugin-image "^1.2.0"
gatsby-plugin-manifest "^3.2.0"
gatsby-plugin-netlify-cms "^5.8.0"
gatsby-plugin-offline "^4.2.0"
gatsby-plugin-react-helmet "^4.2.0"
gatsby-plugin-react-i18next "^1.1.1"
gatsby-plugin-react-svg "^3.0.1"
gatsby-plugin-sharp "^3.10.2"
gatsby-remark-images "^5.7.0"
gatsby-remark-relative-images "^2.0.2"
gatsby-source-filesystem "^3.2.0"
gatsby-transformer-remark "^3.1.0"
gatsby-transformer-sharp "^3.2.0"
i18next "^20.2.4"
netlify-cms-app "^2.15.20"
prop-types "^15.7.2"
react-helmet "^6.1.0"
react-i18next "^11.8.15"

gatsby-transformer-remark@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/gatsby-transformer-remark/-/gatsby-transformer-remark-3.2.0.tgz#51a608dfc12a1c4c3b266c5076043d068050d049"
Expand Down

0 comments on commit 1308161

Please sign in to comment.