About This Repository
Relevant source files
The following files were used as context for generating this wiki page:
This repository, ci4_userguide, serves as the read-only publication source for the official CodeIgniter 4 User Guide. It contains the pre-built static HTML files and assets that constitute the documentation website. The content is generated automatically as part of the main CodeIgniter 4 framework's release workflow.
The primary purpose of this repository is distribution, not development. Contributions, bug fixes, or suggestions related to the user guide's content should not be submitted here. Instead, they must be directed to the main development repository for the framework.
Sources: README.md:3-6
Repository Workflow and Contribution Model
This repository is explicitly designated as read-only. Pull requests are not accepted. The content is updated automatically during the framework's release process. Any developer wishing to contribute to the user guide must do so through the main codeigniter4/codeigniter4 repository.
Sources: README.md:7-11
The diagram below illustrates the contribution and publication flow.
Sources: README.md:7-15
Site Architecture
The user guide website is a static site built using Jekyll. The repository contains the necessary Jekyll configuration, layouts, includes, and the final rendered HTML content.
Sources: _config.yml, _layouts/docs.html, _includes/nav_docs.html
Jekyll Configuration
The site's global settings are defined in _config.yml. This file controls metadata, URL structure, and build configurations.
Key configuration parameters are summarized in the table below:
| Parameter | Value | Description |
|---|---|---|
title | CodeIgniter 4 User Guide | The main title of the website. |
description | The CodeIgniter 4 User Guide | The site's meta description. |
url | https://codeigniter.com | The base URL for the production site. |
baseurl | /user_guide/ | The subpath where the site is hosted. |
permalink | /:path_root/:basename:output_ext | Defines the URL structure for generated pages. |
exclude | [... "README.md"] | A list of files and directories to exclude from the site build. |
Sources: _config.yml:1-12, 23, 30
Page Structure
The primary HTML structure for all documentation pages is defined in the _layouts/docs.html file. This layout file acts as a template, wrapping the content of each individual documentation page.
It includes:
- The main HTML head with metadata.
- A container for the page body.
- Inclusion of the navigation partial (
_includes/nav_docs.html). - A main content area where the specific page's Markdown/HTML is rendered via
{{ content }}.
The following diagram shows how a final page is assembled.
Sources: _layouts/docs.html, contributing/index.html
A snippet from the layout file shows the inclusion of the navigation and content placeholder:
<!-- _layouts/docs.html -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-3 col-lg-2 sidebar">
{% include nav_docs.html %}
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-9 col-md-offset-3 col-lg-10 col-lg-offset-2 main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
</div>
</div>
Sources: _layouts/docs.html:15-26
Navigation
The left-hand sidebar navigation is generated by the _includes/nav_docs.html file. It uses Jekyll's Liquid templating language to iterate through the site's pages and build the nested list of links.
The logic specifically looks for pages that have menu metadata defined in their front matter and constructs the navigation tree accordingly.
<!-- _includes/nav_docs.html -->
<ul class="nav nav-sidebar">
{%- assign items = site.pages | where: "menu", true | sort: "order" -%}
{%- for item in items -%}
<li class="{% if page.url == item.url %}active{% endif %}">
<a href="{{ item.url | relative_url }}">{{ item.title }}</a>
</li>
{%- endfor -%}
</ul>
This snippet demonstrates the iteration over pages (site.pages), filtering for those with menu: true, sorting them by order, and then creating list items with links.
Sources: _includes/nav_docs.html:2-9
Content Entrypoint
The root index.html file serves as the landing page for the user guide. It uses a redirect_to property in its front matter to immediately forward the user to the starting page of the documentation.
---
# index.html
layout: default
redirect_to: /user_guide/intro/index.html
---
This ensures that visitors landing at the root of the user guide are taken directly to the introduction.
Sources: index.html:1-5