Empower structured data: Direct reference strategy of AnQi CMS image resources in Json-LD

As an experienced website operation expert, I know that the importance of structured data (Structured Data) in the field of search engine optimization (SEO) today is self-evident.It not only helps search engines better understand page content, but is also the key to obtaining rich search results (Rich Snippets).While JSON-LD is the mainstream implementation of structured data, its accuracy and completeness directly affect the exposure and click-through rate of the website.Today, let's delve into a frequently asked question: Can the image resource address of AnQiCMS (AnQiCMS) be directly referenced in Json-LD, especially the thumbnail URL?

The answer is affirmative, it can be directly quoted, and the Anqi CMS has fully considered the accessibility of content and search engine optimization from the beginning of its design, making the referencing of image resources very intuitive and efficient.

Auto CMS's image management and content presentation

English CMS as an enterprise-level content management system based on Go language, it has many highlights in content management and SEO optimization.It is not just a content publishing tool, but also an intelligent content asset management platform.

Firstly, the system supports users to directly upload images to the media library and can classify and manage the images.This means that every uploaded image will be assigned a unique, accessible storage path within the CMS.It is especially worth mentioning that AnQi CMS has the ability to automatically process images, such as configuring whether to automatically download remote images, whether to enable WebP format conversion to optimize loading speed, and whether to automatically compress large images in the "Content Settings".At the same time, it can also automatically generate and process thumbnails (Thumb) and cover logo (Logo) according to preset rules, and even can batch regenerate thumbnails of different sizes to meet the display needs of different terminals.

These processed images are displayed in the front-end template through specific tags (such as)archiveDetail/categoryDetail/pageDetailWhen calling with , the CMS will be responsible for outputting the complete URLs of these images.Whether it is a thumbnail of an article detail page, a Banner image on a category page, or a single page illustration, they will eventually be presented on the page as a directly accessible HTTP or HTTPS address.This mechanism lays the foundation for directly referencing image addresses in Json-LD.

The requirement of Json-LD for image URLs

Json-LD is a lightweight data format that allows web administrators to describe content on web pages in a standardized way, such as article titles, authors, publication dates, and most importantly—the images accompanying the articles. Search engines, when parsing Json-LD, for images (imageThe requirement for the attribute) is typically an absolute URL that can be directly accessed. This means that the image address cannot be a relative path (such as/uploads/image.jpg),and it must be an absolute URL containing the protocol, domain, and full path (such ashttps://www.yourdomain.com/uploads/image.jpg)。This is because search engine crawlers need to be able to accurately locate image resources when crawling and understanding structured data.

English CMS image resources and seamless connection with Json-LD

Because the image address output by AnQi CMS in the template is a complete and accessible URL, it is completely feasible to directly reference it in Json-LD. AnQi CMS's template system provides a rich set of tags that allow us to accurately obtain the URL of the required image:

  • Document thumbnail (Thumb) or cover logo (Logo)For articles, products, and other content models,archiveDetailTags easily obtain their thumbnail or Logo address after CMS processing. For example,{% archiveDetail with name="Thumb" %}Will directly output the thumbnail URL of the current document.
  • Multi-image album (Images)If the content contains multiple images,Imagesthe field will return an array of image URLs. Typically, we will reference the first image as the representative in Json-LD.
  • Category or page imageSimilarly,categoryDetailandpageDetailTags can also get the Logo, Thumb, or Images of categories or pages.

Built-in in AnQi CMSjsonLdThe label further simplifies this process.This tag allows us to customize the Json-LD content in the template and it will intelligently merge with the default Json-LD data generated by the system.imageEnsure that the structured data output meets the Schema.org specification and accurately points to the website's image resources.

For example, on the article detail page, we can construct Json-LD like this, referencing the article's thumbnail:

{% jsonLd %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "{{archive.Link}}"
  },
  "headline": "{{archive.Title}}",
  "image": [
    "{% archiveDetail with name="Thumb" %}" // 直接引用缩略图URL
  ],
  "datePublished": "{{stampToDate(archive.CreatedTime, "2006-01-02T15:04:05+08:00")}}",
  "dateModified": "{{stampToDate(archive.UpdatedTime, "2006-01-02T15:04:05+08:00")}}",
  "author": {
    "@type": "Person",
    "name": "AnQiCMS 编辑团队"
  },
  "publisher": {
    "@type": "Organization",
    "name": "{% system with name="SiteName" %}",
    "logo": {
      "@type": "ImageObject",
      "url": "{% system with name="SiteLogo" %}" // 引用网站Logo
    }
  },
  "description": "{{archive.Description}}"
}
</script>
{% endjsonLd %}

In the above example,{% archiveDetail with name="Thumb" %}The content will be directly replaced with the absolute URL of the current article thumbnail, thus meeting the Json-LD requirements for image addresses. Similarly,{% system with name="SiteLogo" %}Also outputs the absolute URL of the website logo.Even if the image has been converted to WebP or resized in the AnQi CMS backend, the output is still the accessible final image URL.

Summarizing, the Aanqi CMS provides a convenient way for website operators to seamlessly integrate optimized image resource addresses into JSON-LD structured data through its perfect image management functions and flexible template tag system.This not only simplifies the SEO workflow, but also ensures that the website can be displayed in a richer and more attractive form on the search engine results page, thus enhancing the overall operation effect.


Common Questions (FAQ)

  1. 问:如果我的文章内容中有多张图片,Json-LD应该引用哪一张图片?答:在Json-LD的imageProperties, it is generally recommended to refer to the most representative single image, such as the cover image or thumbnail of the article. If the document content contains multiple images, you can use the AnQiCMS template tag to obtain the image list (such asarchive.ImagesThen select the first image URL from the list for reference, as search engines usually prioritize the first URL in the array.

  2. 问:The URL of the image generated by AnQi CMS is a relative path or an absolute path? Is it necessary to use an absolute path for Json-LD?答:The image URL called by the tag in the front-end template of AnQi CMS is usually an absolute path (including domain and protocol) or a root relative path (starting with/beginning).For Json-LD, search engines explicitly require the use of complete absolute URLs.BaseUrlSet (can be configured in the background system settings), and it can also ensure that these paths are correctly parsed as absolute URLs.Even so, when referencing directly in Json-LD, it is best to confirm that the output is a complete absolute URL to ensure no mistakes.

  3. 问:如果安企CMS在后台对图片进行了WebP转换或自动压缩,这些优化会影响Json-LD中的图片引用吗?答:Absolutely not. The image optimization feature of Anqi CMS is processed on the server side. When you use template tags (such as{{archive.Thumb}}Get the image URL, and the returned one is the final accessible image after these optimizations.