feat(content): 본문 이미지 목록 썸네일·og:image 폴백 전 티어 구현
공개 이슈 https://github.com/gnuboard/g7/issues/22 — 본문에 삽입한 이미지가 카드/갤러리 목록 썸네일과 공유 미리보기(og:image)에 반영되지 않던 공백을 코어+3모듈+2템플릿에서 해소. - 코어 7.0.9: HtmlImageExtractor(내부 이미지 한정, origin 정규화 SSoT 재사용) + seo.og_image_default 사이트 기본 공유 이미지 설정 + SeoMetaResolver 폴백 체인 - board 1.1.0 / ecommerce 1.2.0 / page 1.1.0: content_thumbnail_url 캐시 컬럼, saving 추출(html 모드 한정·첨부 우선·비밀글 게이트 유지), filter_content_thumbnail 훅, 기존 데이터 백필 업그레이드 스텝 - ecommerce 카테고리 og:image 생산자 신설, page og:description 死키 정정 - sirsoft-basic 1.1.2 og 바인딩 정정, admin_basic 1.0.7 SEO 탭 업로더(+ja 팩 2종) - 검수 중 발견한 text 모드 오캐시 결함은 실패 테스트 선행 후 수정
This commit is contained in:
1 parent
14eb2e39e4
commit
1ba67ca7cf
98 files changed
+4640
-101
No files matched your search
@@ -69,6 +69,57 @@ class EcommerceModuleSeoTest extends ModuleTestCase
|
||||
$this->assertStringContainsString('/api/modules/sirsoft-ecommerce/product-image/abc123', $og['image']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 카테고리 og:image 출력 레벨 — thumbnail_url 이 있으면 image 가 절대 URL 로 방출된다.
|
||||
*
|
||||
* @scenario product-content-thumbnail-fallback
|
||||
*
|
||||
* @effects category_og_image_emitted_from_thumbnail_url
|
||||
*/
|
||||
public function test_category_seo_og_defaults_emits_image_from_thumbnail_url(): void
|
||||
{
|
||||
$context = [
|
||||
'category' => [
|
||||
'data' => [
|
||||
'name' => ['ko' => '아우터', 'en' => 'Outer'],
|
||||
'thumbnail_url' => '/api/modules/sirsoft-ecommerce/category-image/cat123',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$og = $this->module->seoOgDefaults('category', $context);
|
||||
|
||||
$this->assertArrayHasKey('image', $og);
|
||||
$this->assertStringStartsWith('http', $og['image'], 'og:image 는 절대 URL 이어야 공유 카드가 인식합니다');
|
||||
$this->assertStringContainsString('/api/modules/sirsoft-ecommerce/category-image/cat123', $og['image']);
|
||||
$this->assertSame('아우터', $og['image_alt']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 카테고리 og:image 출력 레벨 — 이미지 없는 카테고리는 image 키 자체가 미출력된다
|
||||
* (빈 값은 array_filter 로 제거 → 코어 사이트 기본 OG 이미지 폴백에 위임).
|
||||
*
|
||||
* @scenario product-content-thumbnail-fallback
|
||||
*
|
||||
* @effects category_og_image_omitted_without_thumbnail
|
||||
*/
|
||||
public function test_category_seo_og_defaults_omits_image_without_thumbnail(): void
|
||||
{
|
||||
$context = [
|
||||
'category' => [
|
||||
'data' => [
|
||||
'name' => '아우터',
|
||||
'thumbnail_url' => null,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$og = $this->module->seoOgDefaults('category', $context);
|
||||
|
||||
$this->assertArrayNotHasKey('image', $og);
|
||||
$this->assertSame('website', $og['type']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회귀: 상품 structured_data 도 다국어 array 안전 처리.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user