Internals

How DocLayer's structure, its architecture and internals fit together

Structure

Before we dive into all the powerful tooling included with DocLayer, let's first talk about its structure and architecture - and why it's so unique. When we say "structure," we’re referring to all the important parts that aren’t immediately visible when you open your project. That’s because DocLayer works as a Nuxt Module: it’s installed as a package and lives inside your node_modules folder.

DocLayer leverages Nuxt's virtual file system, which is tightly integrated with the Nuxt ecosystem. Everything DocLayer provides works just like standard Nuxt components and features. The magic is that you gain all these capabilities “under the hood”, without cluttering your project folders. It’s like starting with a blank canvas, but equipped with a powerful toolkit operating behind the scenes. You focus on creating - DocLayer ensures you have the best possible starting point.

Here is the structure added by the module that you'll be working with - think of it as a part of your application, but hidden and invisible by default.

├── app                     # Main application directory (follows Nuxt 4’s recommended structure)│   ├── .doclayer           # Special hidden DocLayer directory collecting all of the modules resources│   │   ├── adapters        # Official DocLayer adapters for extensibility/integrations│   │   ├── components      # Vue components source provided by the module│   │   │   ├── content     # Components dedicated to Nuxt Content rendering│   │   │   └── ui          # Generic UI building blocks/components│   │   │   ├── layout      # Layout-level UI components (e.g., Header, Footer)│   │   │   └── page        # Components specific to content pages (e.g., PageHeader, PageNavigation)│   │   ├── composables     # Reactive composables: reusable application logic/"hooks"│   │   ├── utils           # Utilities and helper functions used internally by DocLayer; exported for global use│   │   ├── layouts         # Prebuilt layouts for content pages (landing & dynamic as default)│   │   ├── pages           # Internal pages (landing & dynamic as [...collection]/[...slug])│   └── └── macros          # Type-safe configuration-related macros└── types                   # TypeScript types and helpers dedicated to DocLayer; exported for global use

We've intentionally kept this structure as flat and non-colliding as possible - especially on the content coating - making it easy for you to extend and build upon.

Architecture

Below you'll find a brief outline of the DocLayer's architecture. Treat this as a basic overview to understand how it is built and how it could potentially fit into your business logic.

  1. Core. DocLayer core is a Nuxt Module that owns the content app shell (layouts/pages/components/utilities) and integrates by default with Nuxt Content, Nuxt UI, along with additional tooling. It can be consumed directly or via a starter/boilerplate, but the module remains the primary asset.
  2. Rendering Model. DocLayer is static-first: content routes are optimized for Static Site Generation (SSG), treating Markdown content as a build-time artifact. Optional runtime features are available but not required for the core experience. DocLayer can also handle SSR, enabling effective hybrid usage scenarios.
  3. Modularity & Extensibility. Additional capabilities are added via Nuxt Modules. Core does not depend on optional (user-defined) modules; modules integrate via explicit extension points and may be removed without breaking core builds. Only core modules are required.
  4. Data Handling. External data ingestion happens at build time through adapter-like functions. Runtime APIs are permitted only through opt-in modules (server-side adapters/handlers) and are not part of the required baseline.
  5. Deployment & Caching. DocLayer outputs optimized, static assets intended for CDN/Edge hosting. Caching behavior is declared via route rules (headers); content routes cache aggressively; dynamic endpoints defaults to conservative caching.
  6. State Management. DocLayer does not ship an opinionated global client state (store) layer. UI state remains local-based; content and server-derived state comes from Nuxt Content and caching primitives. Additional state architecture is module-owned, used only within the runtime.
  7. UI. DocLayer composes UI primitives into product-level interface (documentation layouts, content containers, code blocks, navigation, ToC, etc.). Tailwind CSS provides the low-level styling mechanism (tokens, utilities, responsive behavior). Nuxt UI supplies the foundational UI components and theming system, forming the default design subset.

This modular and layered architecture allows you to focus on content and unique logic, while DocLayer handles configuration, visuals, best practices, and advanced features out of the box.

Automations

Here’s a list of tasks/processes that DocLayer performs during app preparation, initialization or/and build. Most of these automations prepare the application structure, ensuring you have everything needed to start creating your content seamlessly.

  1. Cleaning module resources. This runs within the prepare script and removes auto-generated resources to ensure a fresh generation. It prevents conflicts and helps distinguish file types when working with either a development or production version of DocLayer.
  2. Injecting components, pages, and layouts. Based on the structure shown above, DocLayer injects the required files for your application at runtime. These include the typical items you would create when building a Vue application. However, they are not directly visible to you because DocLayer uses Nuxt’s virtual file system. Of course all of these are available for auto-import and reuse within the application.
  3. Root handling. Because certain files must physically exist in your application, DocLayer automatically adds essential entry points like app.vue and error.vue each time you run the prepare script. If you haven't created your own custom versions of these files, you must run pnpm prepare at least once to generate them. However, if you already have your own application entry points, you can prevent DocLayer from adding these by setting rootPrep to false in the module options.
  4. Initial configuration. With DocLayer's zero-config approach, most setup is handled automatically behind the scenes. The initial app and nuxt configurations are created and populated with sensible defaults. Below you'll find details related to internal tooling; information about application-specific configuration is available on a dedicated page.
  5. Other actions. Finally, there are a couple more processes performed when starting your app - mostly adding internal resources designed to help you build and write faster - vastly improving the developer experience. Most of these processes generate helper files that collect metadata about the application. All stored safely and locally.

Most of these automations are handled by the DocLayer's internal modules.

Tooling

Now that you’ve installed a fresh DocLayer Boilerplate application, you know its basic structure and architecture, let’s take a look at what’s inside. As mentioned earlier, DocLayer is built on top of Nuxt Content and Nuxt UI. In addition to these, there are several other powerful and helpful technologies included by default to help you build a rich and high-performant product.

Let’s take a quick look under the hood to better understand what’s already set up for you and what you don’t need to add yourself.

nuxt.config.ts

Your application's nuxt.config.ts file will likely be quite minimal. This is because most configuration is handled within the DocLayer, which your app depends on directly. Thanks to Nuxt's Module API, you can still override or add any settings you need in your own config.

As you’ll see on the next page, DocLayer splits configuration between two files: settings that are close to your application go in app.config.ts, while more functional, closer to internals (other modules) are managed in nuxt.config.ts. In many cases, you may never need to edit Nuxt’s configuration at all, which is perfectly fine. That just means DocLayer takes care of everything for you, so you can focus on building your project without extra hassle.

/** * Nuxt Config. * * @param { InputConfig<NuxtConfig, ConfigLayerMeta> } input */export default defineNuxtConfig({  compatibilityDate: '2025-01-01',  modules: ['@vuehouse/dl'],});

Typescript

It's important to emphasize that DocLayer is fully typed. Just like Nuxt, it adheres to the highest standards of TypeScript. With TypeScript integrated, you'll benefit from accurate data validation, intelligent code suggestions, and seamless tool integration throughout your development experience.

By default type checking is enabled for the application runtime. That means that vue-tsc has been installed as an devDependency.

export default defineNuxtConfig({  // the rest of the nuxt.config.ts  typescript: {    typeCheck: true,  },});

@nuxt/fonts

An official Nuxt Module that helps you fetch and optimize fonts for your app. Under the hood, it uses Vite to seamlessly inject fonts from any provider you specify. The result is an optimized set of fonts, ready to be bundled with your final application build.

The primary font used in the application is Montserrat, which is free and widely available from both Google and Adobe font catalogs. To keep things efficient and avoid loading the entire font family, we include only three font weights:

  • 400 as normal / default,
  • 700 as bold,
  • 900 as black.

They were mapped into the CSS Variables:

@theme {  --app-text-weight-default: 400;  --app-text-weight-bold: 700;  --app-text-weight-black: 900;}

More about theming with CSS Variables you can read here.

Here is how the module is configured:

export default defineNuxtConfig({  // the rest of the nuxt.config.ts  fonts: {    provider: 'google',    priority: ['google', 'adobe'],    families: [{ name: 'Montserrat', global: true }],    defaults: {      weights: [400, 700, 900],      styles: ['normal', 'italic'],    },  },});

By default, the @nuxt/fonts Module uses Bunny Fonts as its provider. However, Bunny Fonts may not always work reliably - for example, when using a VPN. To ensure consistent font loading, we've set Google Fonts as the default provider for the application.

@nuxt/image

For seamless image compression, we use the official Nuxt Module - by default, the IPX provider. However, you can choose from a wide range of other providers, or even configure your own custom provider if needed. By default, the module is configured to compress images with a quality of 60% - the best fit for the better performance.

The NuxtImg Module is configured to look for images in the public directory of both your app and the module.

export default defineNuxtConfig({  // the rest of the nuxt.config.ts  image: {    provider: 'ipx',    format: ['avif', 'webp', 'png', 'jpg', 'jpeg', 'gif'],    quality: 60,  },});

Use only public directory

It's important to note that any image placed outside of the public directory will not be compressed/optimized by the Nuxt Image Module. In that cases, image optimization becomes the responsibility of your application's internal bundler, such as Vite or Webpack. For example, images located in the app/assets folder will not be optimized by Nuxt Image by default.

Additionally, platforms like Vercel will only optimize your images if they are located in the public directory. If you set Vercel as your image provider (which happens automatically when your deployment and build preset targets Vercel), this limitation applies by default. Remember that DocLayer uses IPX as the default provider to ensure consistent image optimization; you can always change the provider as needed.

@nuxt/icon

This Nuxt Module is included by default with Nuxt Content, so there is no need to add it as a separate dependency. However, since it's not dependency of DocLayer, we've added it as a peer one, to at least use types for configuration. Module will automatically detect icons used in your application, fetch them from Iconify catalog, finally attaching to the app in runtime and the final build.

Internally, we use three sets of icons:

  • lucide, for all layout-related presentation needs,
  • bi, (Bootstrap) mainly for displaying icons in the header,
  • vscode-icons, for displaying file extensions in DlCode component.

This is how the default setup looks like:

import type { ModuleOptions as NuxtIconOptions } from '@nuxt/icon';export default defineNuxtConfig({  // the rest of the nuxt.config.ts  icon: {    mode: 'css',    cssLayer: 'base',    provider: 'iconify',    serverBundle: {      remote: 'jsdelivr',      collections: ['lucide', 'bi', 'vscode-icons'],    },  } satisfies NuxtIconOptions,});

CSS Selector Prefix

By default, no CSS selector prefix is applied to icons. If you choose to add a prefix, do so with caution, as it may prevent internally used icons from being recognized and displayed correctly.

@nuxtjs/color-mode

This Nuxt Module manages in-app color scheme switching between dark and light modes. By default, there is no preferred color scheme set internally. If you want your application to use a specific color mode by default, you can configure it using the dl.ui.colorMode option.

@nuxtjs/sitemap

This Nuxt Module generates a public sitemap so search engines can crawl your pages. DocLayer registers it for you. The file is prerendered into the final build (zeroRuntime), the site root is always listed.

export default defineNuxtConfig({  // the rest of the nuxt.config.ts  sitemap: {    urls: ['/'],    zeroRuntime: true,    defaultSitemapsChunkSize: false,  },});

We assume your application won't have a huge number of sitemap entries, so chunk splitting is disabled. If you need more entries, enable chunking or remove this option to use the default limit of 1000 entries per sitemap. A sitemap file is XML and holds at most 50K entries.

Content pages

A Nuxt Content collection is included only when its schema has a sitemap field. Collections without that field are skipped, and the module does not warn you. DocLayer's built-in page collections already define it, so those pages are listed without any frontmatter. loc defaults to the content path.

If you define your own collection, add the same field to its schema. Without it, those pages never appear in the sitemap:

sitemap: z  .object({    loc: z.string().optional(),    lastmod: z.string().optional(),    changefreq: z.enum(['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never']).optional(),    priority: z.number().optional(),  })  .optional(),

Write the object in frontmatter only when that URL needs its own values.

  • changefreq is one of always, hourly, daily, weekly, monthly, or never.
  • priority is a number, usually between 0.0 and 1.0.
  • lastmod is a date string.
  • loc replaces the content path.
---title: Your page titledescription: Your page descriptionsitemap:  loc: /docs/guidelines/internals  lastmod: 2026-11-06  changefreq: weekly  priority: 0.8---

sitemap: false is not valid

The sitemap module treats sitemap: false as "leave this page out". DocLayer's schema only accepts the object above, so false fails content validation. There is no per-page exclude flag. _seo.robots is also not read by the sitemap module, so noindex does not remove the URL.

nuxt/llms

Large Language Models (LLMs) Tooling increasingly rely on website information, but they face a key limitation: their context windows are too small to process most websites in full. Converting complex HTML pages into LLM-friendly plain text is challenging and often inaccurate.

That’s why the special initiative of the llms.txt file was born. This file is publicly accessible, included within your application’s final build (just like robots.txt). It provides an index of your pages along with the most important information you want to share with LLMs that read your website. It can be a valuable source for LLM-focused SEO (GEO), helping models extract key details about your product and making it more likely to be suggested to end users.

This Nuxt Module helps generating a llms.txt file. To ensure maximum control and quality, we use a dedicated plugin - integrated via Nitro - to prepare and deliver perfectly formatted content for LLMs.

What you can see below is the default configuration. It's required (by module) to provide the domain property; although it will be not used along with the final implementation. As you'll see on the next page, the whole configuration is bypassed by the app.config.ts, as it's more convenient and common place for the application-related configuration.

export default defineNuxtConfig({  llms: {    // Full configuration is bypassed by the app.config.ts file.    // Data execution done by a dedicated Nitro plugin.    domain: 'https://doclayer.dev',  },});

Everything else is handled automatically, behind the scenes. Our Nitro plugin, together with the module, will generate an llms.txt file in your final build. This file will include each page title along with its short description and any page-specific sections.

Experimental AI-based summaries

nuxt/llms can generate a dedicated description for each page link included in the llms.txt file. These descriptions are determined by the sections array, which you can configure in your app.config.ts file. By default, this array is automatically populated by the mentioned plugin, so you typically only need to provide basic data such as the title and description.

Additionally, DocLayer includes an experimental feature that can generate these descriptions using AI, as the summary of each page contents. To enable this feature, set the experimental.llmSummary flag to true in the module options.

How it works?

When building the application, a dedicated summarization model is fetched. It then reads content of each page and generates a description for every page link to be included in the llms.txt file. These descriptions are cached and reused in subsequent builds, since generating them can be time-consuming. To regenerate descriptions (for example, after substantially updating content), simply run pnpm prepare again.

nuxt/security

This Nuxt Module helps secure your application. It is included by default with DocLayer, so there is no need to add it as a separate dependency. Full guidance and internal configuration details can be found here.

markdownlint

Markdownlint is a linter designed to enforce consistent, high-quality Markdown writing experience. With editor integration, it applies rules tailored for .md files and gives instant feedback while you write.

To use the linter, you need to install a dedicated extension, which is available for the most popular editors. As for the moment you can get it for: VSCode, WebStorm, and Zed.

Rules definition

We've improved the default rule set to provide the smoothest workflow for your application. These rules are carefully tailored to our architecture and the way content pages are structured, ensuring an optimal editing experience.

The Boilerplate application includes this configuration by default, so you don't need to add anything else. Well, you just need an editor extension.

If you're starting from scratch, please create a .markdownlint.js file in your root folder and add this code to enable the tool; just after installing the package.

pnpm add -D @vuehouse/dl-mdl-rules
import { config } from '@vuehouse/dl-mdl-rules';export default {  ...config,};

Pro tip would be to restart your editor after changing or adding rules, as updates may not take effect immediately or on save action - you might otherwise experience inconsistent behavior.

markdownlint Custom Rules

Additionally, we've built a couple of custom rules to help you correctly define DocLayer content component syntax. For example, you'll get proper validation for (among others):

This is currently the best way to achieve an experience "similar" to what the TypeScript compiler provides when checking your types as you write code.

Our custom rules are added via @vuehouse/dl-mdl-rules package, included within the config object inside the .markdownlint.mjs file. Additionally if you're using VSCode there is a need to include them within the settings, like this:

{  // the rest of the configuration of .vscode/settings.json  "markdownlint.customRules": ["@vuehouse/dl-mdl-rules/rules"]}

And this is how the validation looks like:

Image
Custom rules validation

markdownlint CLI

This tool is not a part of the DocLayer module. Its usage is opinionated and optionally included in the Boilerplate application.

Finally, for even better content validation, we've added a dedicated CLI process that validates your content at the final step. By default, this process runs together with commitlint just before you send new code to the repository. It's also a great way to integrate additional checks in your CI/CD pipelines.

The script for this is already included in your package.json file. The only requirement is converting your .markdownlint.js config file to .markdownlint.json format, since the CLI expects a static JSON file rather than dynamic one. This will be done automatically within the prepare process. However, if you don't need this step, you can disable it by setting the dl.mdlConvert option to false in your module options.

Commitlint

This tool is not a part of the DocLayer module. Its usage is opinionated and optionally included in the Boilerplate application.

Another essential linting tool is Commitlint. This one checks that your commit messages follow the Conventional Commits style, for example:

feat: add new docs sectionfix: resolve sidebar bugdocs: update intro example# or with additional contextfeat(docs): add new docs sectionfix(issue-123): add new docs section

If your commit message doesn’t match the required pattern, the commit is rejected and you’ll see an error. No setup is needed - Commitlint is pre-configured and triggered automatically via Husky every time you commit. Just follow the pattern: <type>(<optional_context>): <short description>, where type is feat, fix, docs, etc.

Husky

This tool is not a part of the DocLayer module. Its usage is opinionated and optionally included in the Boilerplate application.

Last but not least, Husky, that adds special Git hooks that automatically run checks such as linting and commit message validation every time you commit or push changes. This helps prevent code that doesn't meet the project's standards from being pushed, saving you from potential issues later on. You don't need to set up anything extra - Husky is already configured out of the box and initialized via the postinstall script.

By default, we have set up two hooks:

  • pre-commit - runs linting and typechecking before each commit.
  • commit-msg - runs Commitlint to validate your commit message.

If you need anything more just add your custom one to the .husky folder.


That's it. Additional internal configurations related to predefined DocLayer's features will be introduced and explained on the following pages, providing more context and helping you better understand all its capabilities.