Skip to content

Content management inside Nuxt.

We build client websites in Nuxt. Each website also needs a place where the client can look after content. That is why we are developing tinyzoo: a CMS with a TypeScript model and an admin area in Czech, English or German. The website and content management run in one application. One project, one deployment.

/admin

Start with the content your website needs.

Define articles, page blocks and forms in cms.config.ts. The model generates the admin area. A generated client file carries the types through to your Vue templates. tinyzoo is a Nuxt layer and module that runs directly in your application.

cms.config.ts
import { defineEntity, f } from 'tinyzoo'

// Fields for the editor, typed content for the website.
export const News = defineEntity('news', {
  label: { cs: 'Aktuality', en: 'News' },
  titleField: 'title',
  fields: {
    title: f.text({ required: true }).localized(),
    slug: f.slug({ from: 'title', unique: true }),
    cover: f.media({ accept: 'image/*' }),
    body: f.richtext(),
  },
  content: { public: true, path: '/news/:slug' },
})
pages/news/[slug].vue
<script setup lang="ts">
import { createClient } from '~/lib/cms-content'

const cms = createClient({ baseUrl: useRequestURL().origin })
const slug = String(useRoute().params.slug)
// news is typed as News, inferred from cms.config.ts
const { data: news } = await useAsyncData(`news:${slug}`, () => cms.news.get(slug))
</script>

<template>
  <h1>{{ news?.title }}</h1>
  <CmsImage :media="news?.cover" />
  <CmsContent :doc="news?.body" />
</template>

From the first command to managing content.

  1. 1

    Create a project

    The pnpm create tinyzoo command asks for the languages, the parts of the site and the demo content, and sets up the project foundation. Carry on building your website in Nuxt.

  2. 2

    Define the content

    Describe the content your client will edit in cms.config.ts. Their admin area is generated from the model.

  3. 3

    Deploy the application

    tinyzoo uses Node and Postgres. We deploy with Pushbase. The website and admin area deploy together.

  4. 4

    Walk through the website with your client

    Try editing content, using the live preview and scheduling publication together. It is a chance to see how the content setup works for your client.

Developer questions

What does tinyzoo already include?

Pages built from blocks, lists within blocks and forms. Also menus with subitems, redirects, SEO fields and translations. The media library generates images in the sizes you need on demand. Editing includes a live preview, real-time collaborative writing, scheduled publishing and version history. Visitors and editors can search the content, and search copes with typos.

What if we need something extra?

We write extra features as custom modules in code. Tell us what your website needs. Together we can work out how to extend it.

How do we access the content?

Content is stored in standard Postgres tables. There is also a content API described in OpenAPI. In Vue templates, you work with types from the generated client file.

Who handles maintenance?

We handle development and fixes ourselves. We update one package across our websites. tinyzoo is young. Over 1,600 automated tests and a detailed check of all the usual editing tasks help us verify how it works. We will gather more experience as people use it.

See the website through an editor’s eyes.

Try editing an article and checking the preview. Then tell us how you got on and what you would need for your own website.