Gatsby plugin for using portal-designer as a source.
- Install
$ npm install --save-dev @edx/gatsby-source-portal-designer
- Add
@edx/gatsby-source-portal-designer
to the plugins array in yourgatsby-config.js
.
let pagesApiUrl;
if (process.env.UNBRANDED_LANDING_PAGE === 'True') {
pagesApiUrl = `${process.env.DESIGNER_BASE_URL}/api/v1/pages/?type=pages.IndexPage,pages.ProgramPage,pages.EnterprisePage`;
} else {
pagesApiUrl = `${process.env.DESIGNER_BASE_URL}/api/v1/pages/?hostname=${process.env.HOSTNAME}&type=pages.IndexPage,pages.ProgramPage,pages.EnterprisePage`;
}
module.exports = {
plugins: [
{
resolve: 'gatsby-source-portal-designer',
options: {
pagesApiUrl,
},
},
],
}