<|start_filename|>docs/.vuepress/components/utils.js<|end_filename|>
export const getBlogPages = site =>
  site.pages
    .filter(page => page.frontmatter.layout === "Post")
    .sort(
      (a, b) => new Date(b.frontmatter.date) - new Date(a.frontmatter.date)
    );


<|start_filename|>docs/.vuepress/components/constants.js<|end_filename|>
export const FEATURES = [
  {
    title: "Productive",
    icon: "package",
    details:
      "Bocadillo is an ASGI web framework designed to help you build, test and deploy web APIs as easily as possible. It focuses on modularity, has thorough documentation, and integrates seamlessly with third-party async libraries."
  },
  {
    title: "Real-time capable",
    icon: "broadcast",
    details:
      "Embrace asynchronous programming and use the built-in WebSocket and SSE support to design real-time, highly-concurrent systems."
  },
  {
    title: "Performant",
    icon: "zap",
    details:
      "Bocadillo makes the most out of Starlette and Uvicorn, the lightning-fast ASGI toolkit and web server."
  },
  {
    title: "Scalable",
    icon: "rocket",
    details:
      "As your project grows, features such as routers, providers and plugins help you solve a variety of problems out of simple components."
  },
  {
    title: "Tooling",
    icon: "tools",
    details:
      "Bocadillo ships with testing and development tools that help you build high-quality applications."
  },
  {
    title: "Documented",
    icon: "book",
    details:
      "We make sure every single feature is documented front to back, and provide optimal editor support with a 100% type-annotated code base."
  }
];


<|start_filename|>docs/.vuepress/utils.js<|end_filename|>
const fs = require("fs");

const makeAddDir = dir => file => `/${dir}/${file}`;

function listDir(dir, children) {
  if (!children) {
    // NOTE: children will be sorted in alphabetical order.
    children = fs
      .readdirSync(`docs/${dir}`)
      .filter(file => file.endsWith(".md"))
      .filter(file => file !== "README.md");
  }
  const addDir = makeAddDir(dir);
  return children.map(file => {
    if (typeof file === "string") return addDir(file);
    const [theFile, title] = file;
    return [addDir(theFile), title];
  });
}

function maybeRoot(base, path) {
  return path ? `${base}/${path}` : base;
}

module.exports = { listDir, maybeRoot };
