How to indicate AI-assisted content in a Docusaurus blog
A step-by-step guide to show when a blog post has been written with the help of an AI like Google Gemini, by adding an icon and an author.
This article is part of the Creating Docusaurus components series:
- Change how Docusaurus will create img tags
- Overrides the generation of img tags with Docusaurus
- Organize Your Docusaurus Content with a Custom Series Component
- Providing a go to the top button in Docusaurus posts
- Creating a search&replace plugin for Docusaurus
- A component for showing code snippets in a Docusaurus blog
- A Docusaurus component that alerts readers the article is over a year old
- Showing the changelog of your post
- Inject ASCII Art in any HTML pages rendered by Docusaurus
- Best Practice - Customizing the Docusaurus RSS Feed for Full Content & Images
- Running some checks on your Docusaurus images
- Tags management in Docusaurus
- Automating TL;DR Summaries with Gemini AI
- Introducing the ProjectSetup Component - A Standardized Way to Share Project Structures
- How to indicate AI-assisted content in a Docusaurus blog
- Bring Your CLI Tutorials to Life with a Typewriter Terminal
- Meerkat Mischief: Sprinkling Easter Eggs Across my Blog
- AI-Powered Code Tooltips in Docusaurus — Explain Like I'm Five
- Adding Reader Reactions to Your Docusaurus Blog
- Your Blog Is Unreadable to an AI. Here Is the Fix.
- Shake Your Phone, Startle the Meerkat
- Add a "Copy as Markdown" Button to Your Docusaurus Blog
- Ask My Blog: Turning 259 Articles Into 2,160 Searchable Questions
- The Third Door: A Floating Chat Bubble, and the Feature Nobody Could Find
- Drawing a Map of My Own Blog
- Let Readers Flag Issues — A Multi-Type Feedback Widget for Docusaurus

This blog post explains how to indicate AI-assisted content in a Docusaurus blog by adding an icon and a co-author.
In the age of powerful AI assistants like Google Gemini, it's becoming increasingly common to use them for content creation, brainstorming, or even coding. As a content creator, I believe in transparency with my audience. If an AI has significantly contributed to a piece of content, the reader should know.
Two concrete cases where I lean on an AI and therefore raise this flag: Automating TL;DR Summaries with Gemini AI and AI-Powered Code Tooltips in Docusaurus.
This blog post is a step-by-step guide on how I implemented an "AI Assisted" indicator in my Docusaurus blog. When I add ai_assisted: true to my YAML post's front matter, two things happen automatically:
- A small "AI Assisted" icon appears next to the post's date and reading time.
- "Google Gemini" is added as a co-author.
Here's how you can do the same for your own blog.
The Result
Here's what a single ai_assisted: true flag produces, rendered on an actual post of this blog:

The icon sits right next to the date and reading time, and the AI shows up as a real co-author alongside the human one — nothing hidden, nothing to click to reveal.
Why Do This
As a content creator, I believe in transparency with my audience. If an AI has significantly contributed to a piece of content, the reader should know — not buried in a footer, not omitted, right there in the header where the date and reading time already are. A single front-matter flag drives both the icon and the co-author, so there's no separate step to forget.
Step 1: The ai_assisted Front Matter
The entire process is driven by a single flag in the front matter of your blog posts. This is the simplest part: just add ai_assisted: true to any post where you've had help from an AI.
---slug: my-awesome-posttitle: My Awesome Postauthors: [christophe]ai_assisted: true---
... content ...This is a front matter section (metadata) for a blog post or similar document, written in YAML format. It defines properties like the post's URL slug, title, author, and whether it was created with AI assistance, followed by the actual content below.
This flag will be the trigger for all the logic we'll build next.
Step 2: Creating the AIIcon Component
First, let's create the visual component for our indicator. This is a simple React component that displays an icon and the text "AI Assisted."
Need help here? Click the "Help" button above for setup instructions.
Step 3: Displaying the Icon with Swizzling
Now we need to make this component appear in our post header. To do this, we need to modify some of Docusaurus's core theme components. This is where swizzling comes in. Swizzling is a Docusaurus feature that allows you to replace a theme component with your own customized version.
In this implementation, the logic is spread across three components: BlogPostItem, its Header, and the Info section within the header. We'll need to swizzle all three.
Run the following commands in your terminal:
This will copy the original theme files into your src/theme directory, ready for you to edit.
3.1. Modify src/theme/BlogPostItem/index.js
Here, we'll import our new AIIcon and decide if it should be rendered based on the front matter.
import AIIcon from "@site/src/components/Blog/AIIcon";
import { useBlogPost } from "@docusaurus/plugin-content-blog/client";
import BlogPostItemContainer from "@theme/BlogPostItem/Container";
import BlogPostItemContent from "@theme/BlogPostItem/Content";
import BlogPostItemFooter from "@theme/BlogPostItem/Footer";
import BlogPostItemHeader from "@theme/BlogPostItem/Header";
export default function BlogPostItem({ children, className }) {
const { metadata, isBlogPostPage } = useBlogPost();
const { frontMatter } = metadata;
const containerClassName = useContainerClassName();
const aiIcon = frontMatter.ai_assisted && isBlogPostPage ? <AIIcon /> : null;
return (
<BlogPostItemContainer className={clsx(containerClassName, className)}>
<BlogPostItemHeader aiIcon={aiIcon} />
<BlogPostItemContent>{children}</BlogPostItemContent>
<BlogPostItemFooter />
</BlogPostItemContainer>
);
}
3.2. Modify src/theme/BlogPostItem/Header/index.js
This component just needs to accept the aiIcon prop and pass it down to its child.
import React from 'react';
import BlogPostItemHeaderTitle from '@theme/BlogPostItem/Header/Title';
import BlogPostItemHeaderInfo from '@theme/BlogPostItem/Header/Info';
import BlogPostItemHeaderAuthors from '@theme/BlogPostItem/Header/Authors';
// Add aiIcon to the function signature
export default function BlogPostItemHeader({aiIcon}) {
return (
<header>
<BlogPostItemHeaderTitle />
<BlogPostItemHeaderInfo aiIcon={aiIcon} />
<BlogPostItemHeaderAuthors />
</header>
);
}
3.3. Modify src/theme/BlogPostItem/Header/Info/index.js
Finally, this component receives the prop and renders it.
import React from "react";
import clsx from "clsx";
import { translate } from "@docusaurus/Translate";
// ... other imports
function Spacer() {
return <>{" · "}</>;
}
export default function BlogPostItemHeaderInfo({ className, aiIcon }) {
const { metadata } = useBlogPost();
const { date, readingTime } = metadata;
// ... other code
return (
<div className={clsx(styles.container, "margin-vert--md", className)}>
<DateTime date={date} formattedDate={formatDate(date)} />
{typeof readingTime !== "undefined" && (
<>
<Spacer />
<ReadingTime readingTime={readingTime} />
</>
)}
{aiIcon && <Spacer />}
{aiIcon}
</div>
);
}
With these changes, the "AI Assisted" icon will now appear on any blog post with the correct front matter.
Step 4: Adding "Google Gemini" as an Author
Just like the icon, we can automatically add an author.
4.1. Define the AI Author
First, define your AI author in blog/authors.yml.
gemini:
name: Google Gemini
title: AI Assistant
url: https://gemini.google.com/
image_url: /img/gemini-logo.webp
This is a YAML configuration block defining metadata for Google's Gemini AI service. It specifies the service name, a user-facing title, where to access it, and where to find its logo image.
4.2. Swizzle the Authors Component
We need to swizzle one more component to inject the author logic.
4.3. Modify src/theme/BlogPostItem/Header/Authors/index.js
Now, edit the newly created file to add the logic. We read the ai_assisted flag from the front matter and, if it's true, we push our "Gemini" author object into the list of authors.
import React from "react";
import clsx from "clsx";
import { useBlogPost } from "@docusaurus/plugin-content-blog/client";
import BlogAuthor from "@theme/Blog/Components/Author";
import styles from "./styles.module.css";
export default function BlogPostItemHeaderAuthors({ className }) {
const {
metadata: { authors },
frontMatter,
assets,
} = useBlogPost();
const allAuthors = [...authors];
if (frontMatter.ai_assisted) {
const geminiAuthor = {
name: "Google Gemini",
title: "AI Assistant",
url: "https://gemini.google.com/",
imageURL: "/img/gemini-logo.webp",
};
if (!allAuthors.find((a) => a.name === geminiAuthor.name)) {
allAuthors.push(geminiAuthor);
}
}
const authorsCount = allAuthors.length;
// ... rest of the component
Conclusion
That's it! With a few component customizations, you now have a robust system for transparently indicating AI assistance in your blog. This approach keeps your Markdown files clean (just one flag to add) and centralizes the logic within your Docusaurus theme, making it easy to manage and update. By being open about your process, you can build greater trust with your audience.
This ai_assisted flag is what you'll see on other posts where AI played a real role, like How I used Google Gemini Nano Banana on my blog (generating all my banner images) or Lovable.dev (an AI-driven app builder) — the very post the screenshot above was taken from.
This article is part of the Creating Docusaurus components series:
- Change how Docusaurus will create img tags
- Overrides the generation of img tags with Docusaurus
- Organize Your Docusaurus Content with a Custom Series Component
- Providing a go to the top button in Docusaurus posts
- Creating a search&replace plugin for Docusaurus
- A component for showing code snippets in a Docusaurus blog
- A Docusaurus component that alerts readers the article is over a year old
- Showing the changelog of your post
- Inject ASCII Art in any HTML pages rendered by Docusaurus
- Best Practice - Customizing the Docusaurus RSS Feed for Full Content & Images
- Running some checks on your Docusaurus images
- Tags management in Docusaurus
- Automating TL;DR Summaries with Gemini AI
- Introducing the ProjectSetup Component - A Standardized Way to Share Project Structures
- How to indicate AI-assisted content in a Docusaurus blog
- Bring Your CLI Tutorials to Life with a Typewriter Terminal
- Meerkat Mischief: Sprinkling Easter Eggs Across my Blog
- AI-Powered Code Tooltips in Docusaurus — Explain Like I'm Five
- Adding Reader Reactions to Your Docusaurus Blog
- Your Blog Is Unreadable to an AI. Here Is the Fix.
- Shake Your Phone, Startle the Meerkat
- Add a "Copy as Markdown" Button to Your Docusaurus Blog
- Ask My Blog: Turning 259 Articles Into 2,160 Searchable Questions
- The Third Door: A Floating Chat Bubble, and the Feature Nobody Could Find
- Drawing a Map of My Own Blog
- Let Readers Flag Issues — A Multi-Type Feedback Widget for Docusaurus
Loading comments…






