0

I'm trying to develop a blog with Scully. There are 3 routes. Homepage, Blog page and dynamic Blog Post page. Scully generate static content for homepage and blog post pages. It does not produce for the blog page.

Here is the config and route files;

// app-routing.module.ts
const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
  },
  {
    path: 'blog',
    loadChildren: () =>
      import('./pages/blog/blog.module').then((m) => m.BlogModule),
  },
];
// blog-routing-module.ts
const routes: Routes = [
  {
    path: '',
    component: BlogListComponent,
  },
  {
    path: ':slug',
    component: BlogPostComponent,
  },
];
// scully.project.config.ts
import { ScullyConfig } from '@scullyio/scully';
import '@scullyio/scully-plugin-puppeteer';

export const config: ScullyConfig = {
  projectRoot: './src',
  projectName: 'myproject',
  distFolder: './dist/myproject', // output directory of your Angular build artifacts
  outDir: './dist/static', // directory for scully build artifacts
  defaultPostRenderers: [],
  routes: {
    '/blog/:slug': {
      type: 'json',
      slug: {
        url: 'https://myproject.com/wp-json/wp/v2/posts/?per_page=100',
        property: 'slug',
      },
    },
  },
};

0 Answers0