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) in today's era 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 and search engine friendliness of the content from the beginning, making the reference to image resources very intuitive and efficient.
Image management and content presentation of AnQi CMS
AnQi CMS is an enterprise-level content management system based on Go language, and 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.In terms of image resources, Anqi CMS provides a series of powerful features:
Firstly, the system supports users to directly upload images to the media library and can classify and manage them.This means that every uploaded image will get a unique, accessible storage path within the CMS.It is especially worth mentioning that Anqi CMS has the ability to automatically process images, for example, in the "Content Settings", we can configure whether to automatically download remote images, whether to enable WebP format conversion to optimize loading speed, and whether to automatically compress large images, etc.At the same time, it can also automatically generate and process thumbnails (Thumb) and cover logos (Logo), and even batch regenerate thumbnails of different sizes to adapt to the display needs of different terminals.
These processed images are presented in the front-end template through specific tags such asarchiveDetail/categoryDetail/pageDetailWhen called, Anqi CMS is responsible for outputting the complete URLs of these images.Whether it is the thumbnail of the article detail page, the Banner image of the category page, or the single page illustration, they will eventually be displayed on the page as a directly accessible HTTP or HTTPS address that can be accessed by the browser.This mechanism lays the foundation for directly referencing image addresses in Json-LD.
Json-LD's requirements for image URLs
Json-LD is a lightweight data format that allows website administrators to describe content on web pages in a standardized way, such as the title of the article, the author, the publication date, and most importantly - the accompanying image. Search engines, when parsing Json-LD, pay attention to images (imageThe requirement is usually an absolute URL that can be directly accessed. This means that the image address cannot be a relative path such as/uploads/image.jpgAn absolute URL must include a protocol, domain, and full path, such ashttps://www.yourdomain.com/uploads/image.jpgThis is because search engine crawlers need to be able to accurately locate image resources when crawling and understanding structured data.
Seamless connection of AnQi CMS image resources with Json-LD
Because the image address output by AnQi CMS in the template is a complete and accessible URL, it is perfectly feasible to directly refer to it in Json-LD. The template system of AnQi CMS provides rich tags, allowing us to accurately obtain the URL of the required image:
- Document thumbnail (Thumb) or cover logo (Logo)For articles, products, and other content models, we can use
archiveDetailEasily obtain the thumbnail or Logo address after CMS processing. For example,{% archiveDetail with name="Thumb" %}It will directly output the thumbnail URL of the current document. - Multiple image sets (Images)If the content contains multiple images,
Imagesthe field will return an array of image URLs. Typically, we would reference the first image as the representative in Json-LD. - Category or page imageLikewise,
categoryDetailandpageDetailTags can also retrieve the Logo, Thumb, or Images of the category or page.
The built-in of AnQi CMSjsonLdThe tag further simplifies this process. This tag allows us to customize the Json-LD content in the template and intelligently merge it with the Json-LD data generated by the system by default.This allows us to directly embed the image URL obtained from the template variable intoimageIn the attribute, ensure that the output structured data conforms to the Schema.org specification and accurately points to the image resources of the website.
For example, on the article detail page, we can build Json-LD in this way, referencing the article 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 absolute URL of the current article thumbnail will be replaced to meet the Json-LD requirement for image address. Similarly,{% system with name="SiteLogo" %}The absolute URL of the website logo is also output. 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.
In summary, Anqi CMS, through its comprehensive image management functions and flexible template tag system, provides website operators with a convenient way to seamlessly integrate optimized image resource addresses into Json-LD structured data.This not only simplifies the SEO workflow, but also ensures that the website can be displayed in a richer, more attractive form on the search engine results page, thereby enhancing the overall operational effect.
Frequently Asked Questions (FAQ)
Ask: If my article content has multiple images, which image should Json-LD refer to?Answer: In Json-LD's
imageIn the attribute, it is usually 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.Ask: Is the image URL generated by AnQi CMS relative or absolute? Is Json-LD required to use an absolute path?Answer: 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
/Starting). For Json-LD, search engines explicitly require the use of complete absolute URLs. 幸运的是,AnQiCMS in handling image paths, even if the root relative path is directly displayed in your template, in the final HTML rendering, combined with the website'sBaseUrlSettings (can be configured in the backend system), and 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 safety.Ask: If the Anqie CMS performs WebP conversion or automatic compression on images in the background, will these optimizations affect the image references in Json-LD?Answer: Not at all. The image optimization function of Anqi CMS is processed on the server side. When you use template tags such as
{{archive.Thumb}}When getting the image URL, the one returned is the final accessible image after these optimization processes