Skip to content

About

Loremly.com: free Lorem Ipsum generator for text, photos and placeholder images, with a free API.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Loremly

The website at loremly.com: a free Lorem Ipsum generator for text, photos and placeholder images, with a free API.

Live site · API docs · npm package repo · Deploy guide · Go-live checklist

The Loremly website in dark mode: a Lorem Ipsum generator with quick-start presets, a choice of paragraphs, sentences, words, lists or characters, and output tabs for Text, HTML, Markdown, JSON and JSX

Built with Next.js 16, React 19 and Tailwind CSS v4, in 10 languages.

What Details
Live loremly.com, deployed on Vercel from main
npm package loremly (source) uses the same text engine as src/lib/lorem/, so the same options and seed give the same text on the site, from the API and in the package
This repo Private. The brand kit, photo library and launch docs live here.
Background docs/AUDIT.md: the audit of the old site, the competitor review and the roadmap

Run locally

npm install
npm run dev        # http://localhost:3000
npm run build && npm start

Built with Next.js 16 on Node.js 26 (LTS). The version is set in .nvmrc (run nvm use) and in package.json → engines (Vercel reads this).

Configuration

Env var Default Purpose
NEXT_PUBLIC_SITE_URL https://www.loremly.com Canonical URLs, sitemap, OG and API examples

In src/lib/site.ts, set the real contact email (contactEmail) and social links (social). When page content changes, update contentUpdated, which is used for the sitemap dates.

Scripts

Command What it does
npm run dev Development server
npm run build / npm start Production build / server
npm run lint ESLint
npm run brand Rebuild the private brand kit in brand-kit/ (and src/app/apple-icon.png) from brand-kit/brand.json
npm run photos -- <dir> 12 --only=food Download CC0 photo candidates for review (see data/photos/README.md)

Writing a blog post

Add a Markdown file to content/blog/. The file name becomes the URL (my-post.md → /blog/my-post). Start the file with:

---
title: How to add Lorem Ipsum in Word
description: One or two sentences for search results and the blog list.
date: 2026-11-20
author: Loremly Team
tag: How-to                  # optional label on the card (default "Guide")
cover: /blog-covers/my.jpg   # optional; default is a generated illustration
---

Your post in Markdown: ## headings, lists, links, tables, `code` and code blocks.

The post list, post page, share image, RSS feed (/blog/rss.xml) and sitemap entry are all created automatically when the site is built. Posts are sorted by date, newest first.

Structure

src/
  lib/lorem/             # text engine, framework-agnostic (reusable for npm / plugins)
    rng.ts               #   seeded PRNG (deterministic output)
    flavors.ts           #   word banks
    english.ts           #   grammar-based readable English
    generate.ts          #   options → block tree
    format.ts            #   block tree → text / html / markdown / json / jsx, stats
    options.ts           #   types, limits, URL (de)serialisation shared by UI + API
  lib/images.ts          # image options + URL building (photo, illustration, solid)
  lib/photos.ts          # server-only: pick + crop photos from data/photos (sharp)
  lib/scenes.ts          # generated illustrations (SVG)
  lib/og.tsx             # shared social-share image design
  lib/presets.ts         # quick presets + generator pages (slug, icon, settings)
  lib/content.ts         # which FAQ questions show on which page
  lib/site.ts            # site URL, contact email, social links, menu
  i18n/                  # languages (see "Languages" below)
    locales.ts           #   the 10 languages
    paths.ts             #   which pages are translated; "/faq" → "/es/faq"
    dictionaries/        #   en.ts (source) + es, pt, fr, de, it, ja, zh, ko, id
  components/generator/  # text generator + image generator UIs
  app/
    [lang]/                      # TRANSLATED pages (root layout per language)
      page.tsx                   #   homepage
      [slug]/                    #   16 generator pages (+ share images)
      placeholder-images/ generators/ what-is-lorem-ipsum/ faq/ about/ contact/
    (en)/                        # ENGLISH-ONLY pages (own root layout)
      blog/ docs/ privacy/ terms/
    api/v1/{lorem,photo,image}/  # public REST API
    global-not-found.tsx         # 404 for unknown URLs
    sitemap.ts robots.ts manifest.ts icon.svg apple-icon.png favicon.ico
data/photos/             # CC0 / public-domain photo library + manifest (source & license records)
assets/fonts/            # Source Sans 3 (OFL), used for share images and the brand kit
public/                  # static files served as-is from the site root:
  icon-192x192.png icon-512x512.png icon-maskable-512x512.png   # app icons (from `npm run brand`)
  llms.txt                     # short site guide for AI assistants
  .well-known/security.txt     # security contact (renew "Expires" yearly)
                               # add search-console verification files or ads.txt here too
brand-kit/               # PRIVATE brand / media kit: logos, icons, guide, zip (not served by the website)
scripts/                 # fetch-photos.mjs, build-brand-kit.mjs
docs/                    # AUDIT.md, DEPLOY.md, GO-LIVE.md

Languages

The tool pages are translated into 10 languages: English, Español, Português, Français, Deutsch, Italiano, 日本語, 简体中文, 한국어 and Bahasa Indonesia. The language menu (globe icon) is at the top right of the header.

  • URLs: English has no prefix (/faq); the others do (/es/faq, /ja/faq…). next.config.ts serves English from app/[lang] with lang = "en" behind the scenes, and redirects /en/... to the plain URL.
  • English only: the blog (posts and labels, which are in src/lib/blog-labels.ts), API docs, privacy policy and terms (app/(en)). On those pages the language menu goes to each language's homepage.
  • SEO: every translated page has hreflang links to all its versions, a canonical URL and og:locale, and the sitemap lists every version. Visitors are never redirected by browser language; they choose.
  • Text: all wording lives in src/i18n/dictionaries/. en.ts is the source; the other files must have exactly the same keys (TypeScript checks this). In rich strings, **bold**, *italic* and [text](/path) work, and {name} placeholders are filled in by the code.
  • Changing text: edit en.ts, then the same key in the other 9 files. A key added to en.ts fails the build until every language has it.
  • Adding a page to the translated set: create it under app/[lang]/, add its path to TRANSLATED in src/i18n/paths.ts, and add it to src/app/sitemap.ts.
  • Adding a language: add it to src/i18n/locales.ts, create its dictionary, and register it in src/i18n/dictionaries/index.ts.
  • Share images: translated for Latin-script languages; Japanese, Chinese and Korean use the English image (the image font has no CJK characters).
  • The translations were written by AI in very easy language. Ask a native speaker to check each language before you promote it.

API

GET /api/v1/lorem?unit=paragraphs&count=3&flavor=latin&format=text&seed=abc   # text
GET /api/v1/photo?w=1200&h=800&seed=beach&category=nature&blur=2&format=webp      # real photo
GET /api/v1/photo?w=1200&h=800&seed=beach&type=illustration&style=landscape      # generated illustration
GET /api/v1/image?w=600&h=400&bg=e5e7eb&fg=6b7280&text=Hello&format=svg          # solid-color SVG/PNG
  • Photos: a self-hosted library of 97 CC0 / public-domain photos in data/photos (8 categories), cropped to size with sharp. See data/photos/README.md for the licensing rules and how to add more (scripts/fetch-photos.mjs).
  • Illustrations: drawn as SVG in src/lib/scenes.ts.
  • Solid colors: generated in src/lib/images.ts.

No image is loaded from a third-party service at runtime.

Full parameter reference and code examples: /docs.

Deploy

Launching? Start with the go-live guide. It's a timed checklist from one week before launch to one month after, covering the domain switch, SEO, rollback and the announcement.

Vercel via GitHub: follow the step-by-step guide in docs/DEPLOY.md. It covers the GitHub push, Vercel import, environment variables, domain/DNS, a post-launch checklist and troubleshooting.

Any other Node host also works: run npm run build && npm start. Every page is static except the three /api/v1/* endpoints. For Docker, build with STANDALONE=1 npm run build and run node .next/standalone/server.js, after copying .next/static into .next/standalone/.next/.

About

Loremly.com: free Lorem Ipsum generator for text, photos and placeholder images, with a free API.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages