Overview

As a learning exercise for Headless CMS, I attempted to generate IIIF manifests from information registered in a CMS.

Here are the results. (That said, the server-side processing details are not visible from the app below.)

https://iiif-headless-cms.vercel.app/

This article serves as a memorandum of the above effort.

Contentful

https://www.contentful.com/

I created a Content model called iiif as shown below. For associating image data (url, width, height), both the “JSON object” and “Reference” fields seemed usable, but I chose “Reference” here and created a separate Content model called image to manage image data information.

The API that converts and returns data in IIIF manifest format was created using Nuxt 3.

https://github.com/nakamura196/iiif-headless-cms/blob/main/server/api/iiif/contentful/[id]/manifest.ts

I was able to connect easily by using the following library.

https://www.npmjs.com/package/contentful

microCMS

https://microcms.io/

I created a similar schema in microCMS as well.

I created a custom field to store image data as shown below.

By adding this custom field to the iiif schema in a repeatable format, I was able to store image-related information as shown below.

The exported schema data is as follows.

{}"]"]a,cpuisF{}{}t{}i,oemlFd"""""""""]i""""]"]""sifnkifnkcecfnf,p,uv"diaisiaiulriaiopi:VemnUemnsdeemesdealednledt"salel{}{}{}i[]aw[ld""id""o2"td"d,,tteuI::qI::m0:eI:sieredudF2dd"odG""""e"""i3[A"":""""""""""""n"""Ar::t":re-t:iifnkifnkifnk"YkStoe:el0"i[diaidiaidiai:1Sp"u""x""pd2:"iVemnVemnVemnB9L:pZl"tfi,eC-ifaledaledaled[3ah"Ra,"amar0"ild""ld""ld""CfB":db,late32iuI::uI::uI::_BE2eesgeaT0fedededtRa0"Xleert02_""""""""""""CRp2Hx"""e03i::Ut::n::n1HV37i,,,d:-mRe"uucrh-YWA40a""Lx"",m"""m"""0"Ot22gYu"tkwbSh,b,,2BL:-e1r,"Siepee-"i00"Bl9drLir0,s83,3"at"hg"3t.T"C,fhBhT"10,_B"Et0:10tR,a"08:CRp,:[Z41HV4"2crh5:""":0,,,580..141286ZZ"",,

The processing to convert to IIIF manifest format is as follows.

https://github.com/nakamura196/iiif-headless-cms/blob/main/server/api/iiif/microcms/[id]/manifest.ts

The code is slightly different from Contentful, but I was also able to connect easily using the following library.

https://www.npmjs.com/package/microcms-js-sdk

Summary

This time I tried using two Headless CMS services. Although I only used them at a basic level, I found them very easy to use.

I thought it could also be useful to create a digital archive system like Omeka using a frontend framework + Headless CMS.

Regarding the app introduced at the beginning, since server-side program execution was required, it was implemented using Nuxt 3’s SSR. For hosting, I used Vercel, but since it was my first time, I was a bit confused about build settings and enabling CORS, so I plan to introduce the configuration methods in a separate article.