A website built with the Next.js 13 app directory. It has quotes!
You can add your own quote by editing the quotes.yaml
file.
At the end of the file, add your quote with the following format:
- name: John Doe
quote: "Hello, World!"
Afterwards, submit a pull request and wait for your request to be reviewed. Once it is merged, your quote will be available within a minute!
The API can be accessed from https://quote.lukadev.me/api
.
The API allows you to get a specific quote, get a random quote, or get a
quote image.
GET /api/quotes/[slug].[ext]
[slug]
is the slug of the quote, such as talk-is-cheap-show-me-the-code-8a97f957
, the slug
is the quote slugififed with a hash appended onto it.
[ext]
can either be .json
, .yaml
or .yml
.
interface Response {
// The URL which points to the location within `quotes.yaml` where this
// quote is defined.
source: string
// This quote's slug
slug: string
// The name on the quote
name: string
// The quote itself
quote: string
}
Example: https://quote.lukadev.me/api/quotes/talk-is-cheap-show-me-the-code-8a97f957.json
Same as above, but with the slug random
.
Example: https://quote.lukadev.me/api/quotes/random.json
Note This used to be available through
/api/og/quote
but has been moved in order to use Next.js's new file metadata API.
GET /quotes/[slug]/opengraph-image