{
  "openapi": "3.1.0",
  "info": {
    "title": "imlucas.dev content API",
    "version": "1.0.0",
    "summary": "Read-only endpoints for the imlucas.dev blog.",
    "description": "imlucas.dev is a static site. These endpoints are pre-rendered files: there is no authentication, no rate limit beyond the CDN's, and nothing can be written. Every HTML page also has a Markdown rendering, served either through content negotiation (Accept: text/markdown) or from the index.md file that sits next to each page.",
    "contact": {
      "name": "Lucas Ribeiro",
      "url": "https://imlucas.dev/contact/"
    }
  },
  "servers": [{ "url": "https://imlucas.dev" }],
  "paths": {
    "/search.json": {
      "get": {
        "operationId": "listPosts",
        "summary": "List all published blog posts",
        "description": "Newest first. The id is the URL slug: the post lives at /blog/{id}/.",
        "responses": {
          "200": {
            "description": "Array of post summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/PostSummary" }
                }
              }
            }
          }
        }
      }
    },
    "/blog/{id}/": {
      "get": {
        "operationId": "getPost",
        "summary": "Read one blog post",
        "description": "Returns HTML by default. Send Accept: text/markdown to receive the original Markdown source with a YAML front matter block (title, description, author, date, tags, url).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Post slug, as returned by /search.json",
            "schema": { "type": "string" }
          },
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": { "type": "string", "enum": ["text/html", "text/markdown"] }
          }
        ],
        "responses": {
          "200": {
            "description": "The post",
            "headers": {
              "Vary": { "schema": { "type": "string" }, "description": "Accept" }
            },
            "content": {
              "text/html": { "schema": { "type": "string" } },
              "text/markdown": { "schema": { "type": "string" } }
            }
          },
          "404": { "description": "Unknown slug" }
        }
      }
    },
    "/blog/{id}/index.md": {
      "get": {
        "operationId": "getPostMarkdown",
        "summary": "Read one blog post as Markdown without content negotiation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown source with YAML front matter",
            "content": { "text/markdown": { "schema": { "type": "string" } } }
          },
          "404": { "description": "Unknown slug" }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Site overview for language models (llms.txt)",
        "responses": {
          "200": {
            "description": "Markdown index of every post and page",
            "content": { "text/markdown": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "operationId": "getFeed",
        "summary": "RSS 2.0 feed of all posts",
        "responses": {
          "200": {
            "description": "RSS feed",
            "content": { "application/rss+xml": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/sitemap-index.xml": {
      "get": {
        "operationId": "getSitemap",
        "summary": "XML sitemap index",
        "responses": {
          "200": {
            "description": "Sitemap index pointing at the per-page sitemap",
            "content": { "application/xml": { "schema": { "type": "string" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PostSummary": {
        "type": "object",
        "required": ["id", "title", "description", "tags", "pubDate"],
        "properties": {
          "id": { "type": "string", "description": "URL slug" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "tags": { "type": "array", "items": { "type": "string" } },
          "pubDate": { "type": "string", "format": "date-time" }
        }
      }
    }
  }
}
