HumansTxt
HumansTxt renders a <link rel="author" type="text/plain"> tag that points to the project’s /humans.txt file. It is scoped to resolving and outputting the href for that tag only and does not generate or validate the humans.txt file itself.
| prop | type | default | required | description |
|---|---|---|---|---|
href | string | URL | derived from Astro.site | No | Absolute URL for the humans.txt file. When omitted, falls back to integration config, then to Astro.site + /humans.txt. |
Examples
Section titled “Examples”Input:
<HumansTxt href="https://example.com/humans.txt" />Output:
<link type="text/plain" rel="author" href="https://example.com/humans.txt" />Automatic
Section titled “Automatic”Derives the href from Astro.site by appending /humans.txt if headTags.humansTxt is set to true.
Input:
eminence({ headTags: { humansTxt: true, },});<HumansTxt />Output (assuming Astro.site is https://example.com):
<link type="text/plain" rel="author" href="https://example.com/humans.txt" />Decisions Made
Section titled “Decisions Made”Renders nothing when no valid href can be resolved
Section titled “Renders nothing when no valid href can be resolved”If href is false, or if no explicit value or derivable site is available, the component produces no output. This prevents a broken or empty link tag from appearing in the document.
Integration config is checked before Astro.site
Section titled “Integration config is checked before Astro.site”The resolution order is: explicit prop → integration config. This lets a project override the auto-derived URL at the integration level without touching every page.
Source code
Section titled “Source code”---import config from "virtual:eminence-astro-suite/head-tags";
interface Props { /** * Absolute humans.txt URL rendered directly as the link href. * @default `headTags.humansTxt` * @example "https://example.com/humans.txt" */ href?: string | URL;}
const { href = config.humansTxt } = Astro.props;---
{href && <link rel="author" href={href} type="text/plain" />}