{"size": 1269, "ext": "js", "max_stars_repo_path": "services/marko-example-website/server/routes/website-section.js", "max_stars_repo_name": "Jlaird/base-cms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "services/marko-example-website/server/routes/website-section.js", "max_issues_repo_name": "Jlaird/base-cms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "services/marko-example-website/server/routes/website-section.js", "max_forks_repo_name": "Jlaird/base-cms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.4375, "max_line_length": 74, "alphanum_fraction": 0.6769109535}
const gql = require('graphql-tag');
const { withWebsiteSection } = require('@base-cms/marko-web/middleware');
const section = require('../templates/website-section');
const applications = require('../templates/website-section/applications');
const events = require('../templates/website-section/events');
const webinars = require('../templates/website-section/webinars');
const whitePapers = require('../templates/website-section/white-papers');
const videos = require('../templates/website-section/videos');

const queryFragment = gql`
  fragment WebsiteSectionPageFragment on WebsiteSection {
    fullName
    hierarchy {
      id
      name
    }
  }
`;

module.exports = (app) => {
  app.get('/:alias(tactical)', withWebsiteSection({
    queryFragment,
    template: applications,
  }));

  // Published content type pages
  app.get('/:alias(events)', withWebsiteSection({
    template: events,
  }));

  app.get('/:alias(webinars)', withWebsiteSection({
    template: webinars,
  }));

  app.get('/:alias(white-papers)', withWebsiteSection({
    template: whitePapers,
  }));

  app.get('/:alias(videos)', withWebsiteSection({
    template: videos,
  }));

  app.get('/:alias([a-z0-9-/]+)', withWebsiteSection({
    queryFragment,
    template: section,
  }));
};
