Vue.js / Nuxt.js

SEO with Nuxt

Meta tags, useHead, useSeoMeta, structured data, sitemaps, robots.txt, Open Graph, social sharing

20 면접 질문·
Senior
1

What is the main difference between useHead and useSeoMeta in Nuxt?

답변

useHead is a generic composable for managing all HTML head tags (title, script, link, style, meta), while useSeoMeta is specialized only for SEO meta tags with strict TypeScript typing. useSeoMeta offers better type safety and automatic validation of SEO properties like og:image, twitter:card, while useHead requires manual meta tag configuration. Prefer useSeoMeta for SEO metadata and useHead for other head elements.

2

What is a canonical tag and why is it important for SEO?

답변

The canonical tag (rel=canonical) tells search engines which is the primary version of a page when multiple URLs have similar or identical content. It prevents duplicate content penalty and consolidates PageRank to the canonical URL. In Nuxt, the canonical tag is automatically generated by default for each page, pointing to the current URL. It can be disabled or customized via useSeoMeta with canonical: false or a specific URL. Essential for sites with pagination, filters, or multilingual versions.

3

How to disable indexing of a specific page in Nuxt while allowing crawling?

답변

Using useSeoMeta with robots: 'noindex, follow' allows crawlers to visit the page and follow links, but prevents indexing in search results. This approach is preferable to robots.txt for already indexed pages, as robots.txt blocks crawling but doesn't remove pages from the index. Alternative: use defineRouteRules with robots: 'noindex' for centralized configuration. To completely block crawling, robots.txt with Disallow is necessary but less flexible per page.

4

What are the essential Open Graph properties for good social sharing?

5

How to generate a dynamic sitemap in Nuxt from an external API?

+17 면접 질문

다음 면접을 위해 Vue.js / Nuxt.js을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기