Skip to content

Commit 78108d7

Browse files
[ADD] website_llms: add new module
1 parent decf5ca commit 78108d7

18 files changed

Lines changed: 885 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../website_llms

setup/website_llms/setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

website_llms/README.rst

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
================
2+
Website llms.txt
3+
================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:8a9926d7200ad9e863b35eef0281a85bde4f76ef4ed12ee7e35ffced4b32165d
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
20+
:target: https://github.com/OCA/website/tree/18.0/website_llms
21+
:alt: OCA/website
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_llms
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module adds support for serving a /llms.txt file in the website
32+
root. The content can be configured per website in the website settings.
33+
34+
The llms.txt file provides information for Large Language Models (LLMs)
35+
about your website, including company information, services, and content
36+
links.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Usage
44+
=====
45+
46+
Configuration
47+
-------------
48+
49+
1. Go to **Website > Configuration > Settings**
50+
2. In the **Website Info** section, find the **llms.txt Content** field
51+
3. Enter the content you want to serve at /llms.txt
52+
4. Save the settings
53+
54+
Usage
55+
-----
56+
57+
After configuration, the /llms.txt file will be available at your
58+
website root:
59+
60+
- If content is configured: The configured content will be served
61+
- If content is empty: A default content will be generated based on your
62+
website information
63+
64+
Example content format:
65+
66+
::
67+
68+
# Your Website — Information for LLMs
69+
70+
## Company
71+
- About: https://yourdomain.com/aboutus
72+
- Contact: https://yourdomain.com/contactus
73+
74+
## Services
75+
- Service 1: https://yourdomain.com/service1
76+
- Service 2: https://yourdomain.com/service2
77+
78+
## Content
79+
- Blog: https://yourdomain.com/blog
80+
81+
Bug Tracker
82+
===========
83+
84+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
85+
In case of trouble, please check there if your issue has already been reported.
86+
If you spotted it first, help us to smash it by providing a detailed and welcomed
87+
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_llms%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
88+
89+
Do not contact contributors directly about support or help with technical issues.
90+
91+
Credits
92+
=======
93+
94+
Authors
95+
-------
96+
97+
* Escodoo
98+
99+
Contributors
100+
------------
101+
102+
- `Escodoo <https://www.escodoo.com.br>`__:
103+
104+
- Marcel Savegnago <marcel.savegnago@escodoo.com.br>
105+
106+
Maintainers
107+
-----------
108+
109+
This module is maintained by the OCA.
110+
111+
.. image:: https://odoo-community.org/logo.png
112+
:alt: Odoo Community Association
113+
:target: https://odoo-community.org
114+
115+
OCA, or the Odoo Community Association, is a nonprofit organization whose
116+
mission is to support the collaborative development of Odoo features and
117+
promote its widespread use.
118+
119+
.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px
120+
:target: https://github.com/marcelsavegnago
121+
:alt: marcelsavegnago
122+
123+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
124+
125+
|maintainer-marcelsavegnago|
126+
127+
This module is part of the `OCA/website <https://github.com/OCA/website/tree/18.0/website_llms>`_ project on GitHub.
128+
129+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

website_llms/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import controllers

website_llms/__manifest__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Website llms.txt",
3+
"version": "18.0.1.0.0",
4+
"category": "Website",
5+
"summary": """
6+
This module adds support for serving a /llms.txt file in the website root.
7+
The content can be configured per website in the website settings.
8+
""",
9+
"website": "https://github.com/OCA/website",
10+
"author": "Escodoo, Odoo Community Association (OCA)",
11+
"maintainers": ["marcelsavegnago"],
12+
"depends": ["website"],
13+
"data": [
14+
"views/res_config_settings.xml",
15+
],
16+
"installable": True,
17+
"application": False,
18+
"license": "AGPL-3",
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import main

website_llms/controllers/main.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright 2026 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from odoo import http
4+
from odoo.http import request
5+
6+
7+
class LlmsTxtController(http.Controller):
8+
@http.route(
9+
"/llms.txt",
10+
type="http",
11+
auth="public",
12+
website=True,
13+
sitemap=False,
14+
methods=["GET"],
15+
csrf=False,
16+
)
17+
def llms_txt(self, **kwargs):
18+
"""
19+
Serve the llms.txt file with content configured in website settings.
20+
If no content is configured, returns a default message.
21+
"""
22+
website = request.website
23+
content = website.llms_txt_content or ""
24+
25+
# If content is empty, return a default message
26+
if not content.strip():
27+
base_url = website.domain or request.httprequest.host_url.rstrip("/")
28+
content = f"""# {website.name} — Information for LLMs
29+
30+
## Company
31+
- Website: {base_url}
32+
- About: {base_url}/aboutus
33+
- Contact: {base_url}/contactus
34+
35+
## Content
36+
- Blog: {base_url}/blog
37+
"""
38+
39+
# Ensure content ends with a newline
40+
content = content.strip() + "\n"
41+
42+
headers = [
43+
("Content-Type", "text/plain; charset=utf-8"),
44+
("Cache-Control", "public, max-age=3600"),
45+
]
46+
47+
return request.make_response(content, headers=headers)

website_llms/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import website
2+
from . import res_config_settings
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2026 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from odoo import fields, models
4+
5+
6+
class ResConfigSettings(models.TransientModel):
7+
_inherit = "res.config.settings"
8+
9+
llms_txt_content = fields.Text(
10+
string="llms.txt Content",
11+
related="website_id.llms_txt_content",
12+
readonly=False,
13+
help="Content to be served at /llms.txt. This file provides information "
14+
"for Large Language Models (LLMs) about your website.",
15+
)

website_llms/models/website.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2026 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from odoo import fields, models
4+
5+
6+
class Website(models.Model):
7+
_inherit = "website"
8+
9+
llms_txt_content = fields.Text(
10+
string="llms.txt Content",
11+
help="Content to be served at /llms.txt. This file provides information "
12+
"for Large Language Models (LLMs) about your website.",
13+
translate=False,
14+
)

0 commit comments

Comments
 (0)