WebToSpeech

For publishers · Add an audio player to an Eleventy (11ty) blog

Put an audio player on every Eleventy post.

Drop two lines into your Nunjucks or Liquid post layout and give every 11ty article a clean, cookie-free audio version without adding a single build plugin.

Works with Nunjucks, Liquid, WebC, and @11ty/eleventy-plugin-rss. Requires the Publisher plan.

  1. Step 1

    Register your site in WebtoSpeech

    Add your domain under Settings → Sites to get your verification tag and ws_ site key.

  2. Step 2

    Add verification to your base layout

    Paste the meta tag inside the <head> of _includes/layouts/base.njk (or verify with DNS), deploy, and press Verify.

    _includes/layouts/base.njk

    <meta name="webtospeech-verification" content="your_verification_code">
  3. Step 3

    Add the player to your post layout

    Insert the player right before {{ content | safe }} in your post layout template. Wrap it in an optional front-matter check so you can disable audio on any post.

    _includes/layouts/post.njk

    {% if not noAudio %}
      <div data-webtospeech></div>
      <script src="https://webtospeech.app/embed.js" data-site="ws_your_site_key" async></script>
    {% endif %}
  4. Step 4

    Deploy and press play

    Every post on your verified domain now shows a lightweight audio player. Audio generates on first play and is reused for every future reader.

    Output <link rel="canonical"> and <meta property="article:modified_time"> in your head so edits stay in sync automatically.

Good to know on Eleventy

Zero JavaScript bundle weight

Eleventy sites pride themselves on shipping minimal HTML. WebtoSpeech adds no client bundle to your repo and lazy-loads the iframe when scrolled into view.

Works with @11ty/eleventy-plugin-rss

Connect your /feed/feed.xml Atom or RSS feed in Settings → Sites → Feed and podcast to publish an automatic podcast alongside your site.

No cookies or analytics bloat

The embed sets zero cookies and runs without trackers, keeping your 11ty blog fast and privacy-respecting.

Custom themes and dark mode

The player adapts automatically to prefers-color-scheme, or takes data-theme="light" / data-theme="dark" to match a custom theme toggle.

See everything else the player does

Questions

Does WebtoSpeech slow down Eleventy builds?
Not at all. Nothing runs during the 11ty build—audio is generated on demand when a visitor presses play or when your RSS feed updates.
Does it work with both Nunjucks and Liquid templates?
Yes. The snippet is standard HTML, so it drops directly into Nunjucks, Liquid, WebC, or Eleventy JavaScript templates.
Can I turn off the player for specific posts?
Yes. Guard the snippet with a front-matter boolean like noAudio: true, or only include it in your long-form post layout.

Publisher plan

$29 a month. Unlimited sites.

200 hours of audio a month, every Studio and standard voice, cookie-free embeds, RSS-to-podcast feeds, and play counts.