Skip to content
Kong Docs are moving soon! Our docs are migrating to a new home. You'll be automatically redirected to the new site in the future. In the meantime, view this page on the new site!
Kong Logo | Kong Docs Logo
  • Docs
    • Explore the API Specs
      View all API Specs View all API Specs View all API Specs arrow image
    • Documentation
      API Specs
      Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong AI Gateway
      Multi-LLM AI Gateway for GenAI infrastructure
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Kong Gateway Operator
      Manage your Kong deployments on Kubernetes using YAML Manifests
      Insomnia
      Collaborative API development platform
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      AI's icon
      AI
      Govern, secure, and control AI traffic with multi-LLM AI Gateway plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
Contribution guidelines
  • Home icon
  • Style guide and contribution guidelines
  • Reusable content
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • Contribution guidelines
  • Style guidelines
    • Style guide
    • Word choice and naming
    • Notes and other notices
    • Diagrams
    • Documenting user interfaces
    • Contribution templates
    • Plugin documentation
      • Documenting Kong-owned plugins
      • Documenting partner plugins
  • Markdown rules and formatting
    • Markdown rules
    • Reusable content
    • Variables
    • Single-sourced versions
    • Single-sourced plugins
    • Conditional rendering
  • Community
    • Welcome to the Kong Docs community
    • Community expectations
    • Hackathons
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • Create an include
    • File formats and directories
    • Markdown comments
    • Page variables
  • Use an include
    • Conditional content
  • include-check script

Reusable content

In Jekyll, reusable content is managed using include snippets, which are located in the /app/_includes folder. Use includes to reuse snippets of the same content across multiple pages.

The examples in this topic reference a short include file with a snippet about installation.

Snippets from that include file are called with an include tag in a few target files, such as the Docker installation guide.

Create an include

File formats and directories

Add a Markdown (.md) or HTML (.html) file to the /app/_includes directory at the root of the Kong/docs.konghq.com repository.

  • Markdown includes contain snippets of documentation content, for example, common installation steps.
  • HTML includes contain pieces of website layout and functionality, for example, the footer and top navigation bar.

If your Markdown include does not need to belong to a particular product version, place it in a product directory. For example:

  • app/_includes/mesh
  • app/_includes/plugins-hub

If the include will be used across products, place it directly in of the app/_includes/md/ directory.

If you have different versions of the include content:

  • Content for current version continues to live at the root of the product directory
  • Versioned content (for non-current versions only!) lives in a sub-directory named {VERSION_NUMBER}

Markdown comments

At the top of an include file, add a Markdown comment to note the instances where this include is being used. For example:

<!-- Shared between all Community Linux installation topics: Amazon Linux,
 CentOS, Debian, RedHat, and Ubuntu -->

Page variables

If using page variables inside an include, replace page in the variable with include. For example, page.release becomes include.release.

This is an include that uses {{ include.release }}.

This is necessary because we use the jekyll_include_cache plugin on the docs site, and the plugin needs to know that the variable should not be cached.

Use an include

To add an include, use the include tag with the following basic syntax:

{% include_cached /md/install.md %}
  • Declare the tag with include_cached
  • Add a path relative to the _includes directory

Depending on the content of the snippet, you can pass various parameters to the include tag. If the include content has a variable anywhere in the text, map it to the page variable:

{% include_cached /md/install.md release=page.release %}

This maps page.release to the include.release from the source include file.

Conditional content

You can add if statements to an include to create variations of the content for use in different contexts. For example, in an file named install.md, you might have a snippet where the instructions are specific to Docker:

{% if include.install == "docker" %}
your docker content goes here
{% endif %}

In the target file (the file where you want the content to display), call the Docker section of the include:

{% include_cached /md/install.md install='docker' %}

The syntax for the if statement and the include is not the same.

  • When creating an if statement condition based on a string, the string must be enclosed in double quotes (" ") and use two equals signs: if include.install == "docker"
  • When calling the section in an include_cached tag, use single quotes (' ') and one equals sign: install='docker'

include-check script

The Kong docs site runs an include check script on every change pushed to the repository. If you run into issues with an include, the check will flag them. See more info about the include check in our repository README.

Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    Powering the API world

    Increase developer productivity, security, and performance at scale with the unified platform for API management, service mesh, and ingress controller.

    • Products
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • Product Updates
      • Get Started
    • Documentation
      • Kong Konnect Docs
      • Kong Gateway Docs
      • Kong Mesh Docs
      • Kong Insomnia Docs
      • Kong Konnect Plugin Hub
    • Open Source
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kong Community
    • Company
      • About Kong
      • Customers
      • Careers
      • Press
      • Events
      • Contact
  • Terms• Privacy• Trust and Compliance
© Kong Inc. 2025