Skip to content

Jekyll plugin for generating AI Domain Data Standard domain-profile.json files. Automatically creates and validates .well-known/domain-profile.json during site generation.

License

Notifications You must be signed in to change notification settings

ai-domain-data/jekyll-ai-domain-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jekyll-ai-domain-data

A Jekyll plugin that automatically generates and validates domain-profile.json files according to the AI Domain Data Standard v0.1.1.

The AI Domain Data Standard is an open, vendor-neutral format for publishing authoritative domain identity data for AI systems, search engines, and automated agents. This plugin makes it easy to add AI Domain Data support to your Jekyll site.

Installation

Add this line to your site's Gemfile:

gem "jekyll-ai-domain-data"

And then execute:

bundle install

Or install it yourself as:

gem install jekyll-ai-domain-data

Then add the plugin to your _config.yml:

plugins:
  - jekyll-ai-domain-data

Configuration

Add an ai_domain_data section to your _config.yml:

ai_domain_data:
  enabled: true  # Set to false to disable generation
  name: "Your Site Name"
  description: "A concise description of your site or organization"
  website: "https://example.com"  # Optional, defaults to site.url
  contact: "contact@example.com"
  logo: "https://example.com/logo.png"  # Optional
  entity_type: "Organization"  # Optional: Organization, Person, Blog, NGO, Community, Project, CreativeWork, SoftwareApplication, or Thing
  jsonld:  # Optional: Embedded JSON-LD block
    "@context": "https://schema.org"
    "@type": "Organization"
    "name": "Your Site Name"
    "url": "https://example.com"
    "email": "contact@example.com"

Field Mapping

The plugin will automatically use values from your Jekyll config if not explicitly set:

  • name: Falls back to site.title or site.name
  • description: Falls back to site.description
  • website: Falls back to site.url (will be prefixed with https:// if missing)
  • contact: Falls back to site.email

Minimal Configuration

If you already have basic site metadata in _config.yml, you can use a minimal configuration:

ai_domain_data:
  contact: "contact@example.com"  # Required, no fallback

All other fields will be pulled from your existing Jekyll configuration.

Usage

Automatic Generation

Once configured, the plugin automatically generates .well-known/domain-profile.json during site build. The file will be available at:

https://yourdomain.com/.well-known/domain-profile.json

Liquid Tags

You can also access domain data in your templates using the ai_domain_data tag:

{% ai_domain_data name %}        <!-- Outputs: Your Site Name -->
{% ai_domain_data description %} <!-- Outputs: Your description -->
{% ai_domain_data website %}     <!-- Outputs: https://example.com -->
{% ai_domain_data contact %}     <!-- Outputs: contact@example.com -->
{% ai_domain_data logo %}        <!-- Outputs: https://example.com/logo.png -->
{% ai_domain_data entity_type %} <!-- Outputs: Organization -->
{% ai_domain_data json %}        <!-- Outputs: Pretty-printed JSON -->
{% ai_domain_data json_compact %} <!-- Outputs: Compact JSON -->
{% ai_domain_data %}             <!-- Outputs: Pretty-printed full JSON -->

Example: Embedding in HTML

<script type="application/ld+json">
{% ai_domain_data json %}
</script>

CORS Configuration

To allow cross-origin requests (required for tools like the AI Domain Data checker), you need to configure CORS headers at your hosting provider level. The plugin generates a static file, so headers must be set by your web server or hosting platform.

GitHub Pages

GitHub Pages doesn't support custom headers. The file will be accessible, but cross-origin requests may be limited. Consider using a different hosting provider if CORS is required.

Netlify

Add to netlify.toml in your site root:

[[headers]]
  for = "/.well-known/domain-profile.json"
  [headers.values]
    Access-Control-Allow-Origin = "*"
    Access-Control-Allow-Methods = "GET, OPTIONS"
    Access-Control-Allow-Headers = "Content-Type"

Apache

Add to .htaccess in your site root:

<FilesMatch "domain-profile\.json$">
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, OPTIONS"
    Header set Access-Control-Allow-Headers "Content-Type"
</FilesMatch>

Nginx

Add to your server configuration:

location ~* \.well-known/domain-profile\.json$ {
    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Methods "GET, OPTIONS";
    add_header Access-Control-Allow-Headers "Content-Type";
}

Vercel

Add to vercel.json in your site root:

{
  "headers": [
    {
      "source": "/.well-known/domain-profile.json",
      "headers": [
        { "key": "Access-Control-Allow-Origin", "value": "*" },
        { "key": "Access-Control-Allow-Methods", "value": "GET, OPTIONS" },
        { "key": "Access-Control-Allow-Headers", "value": "Content-Type" }
      ]
    }
  ]
}

Note: Without CORS headers, the domain profile will still be accessible via direct URL, but cross-origin tools (like the checker) may be blocked by browser security policies.

Validation

The plugin validates your configuration against the AI Domain Data Standard schema before generating the file. If validation fails, you'll see warnings in the build output and the file won't be generated.

Common validation errors:

  • Missing required fields (name, description, website, contact)
  • Invalid entity_type (must be a valid schema.org @type value)
  • Invalid jsonld structure (must include @context: "https://schema.org" and @type)

Examples

Basic Configuration

# _config.yml
title: "My Awesome Blog"
description: "A blog about web development and technology"
url: "https://myblog.com"
email: "hello@myblog.com"

ai_domain_data:
  contact: "hello@myblog.com"
  entity_type: "Blog"

Complete Configuration

# _config.yml
ai_domain_data:
  name: "Acme Corporation"
  description: "Leading provider of innovative solutions"
  website: "https://acme.com"
  contact: "info@acme.com"
  logo: "https://acme.com/logo.png"
  entity_type: "Organization"
  jsonld:
    "@context": "https://schema.org"
    "@type": "Organization"
    "name": "Acme Corporation"
    "url": "https://acme.com"
    "logo": "https://acme.com/logo.png"
    "email": "info@acme.com"
    "description": "Leading provider of innovative solutions"
    "foundingDate": "2020-01-01"
    "numberOfEmployees": "50-100"

Requirements

  • Jekyll >= 3.8, < 5.0
  • Ruby >= 2.7.0

Development

After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake spec to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ai-domain-data/jekyll-ai-domain-data.

License

The gem is available as open source under the terms of the MIT License.

Related Projects

Support

For issues, questions, or contributions, please visit:

About

Jekyll plugin for generating AI Domain Data Standard domain-profile.json files. Automatically creates and validates .well-known/domain-profile.json during site generation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages