فهرست منبع

修复首页和视频列表页的seo问题

guoziyun 1 ماه پیش
والد
کامیت
c5ca8dfd14
2فایلهای تغییر یافته به همراه27 افزوده شده و 29 حذف شده
  1. 7 5
      views/v2/index.ejs
  2. 20 24
      views/v2/video-coloring-pages.ejs

+ 7 - 5
views/v2/index.ejs

@@ -434,7 +434,7 @@
     },
     "image": {
       "@type": "ImageObject",
-      "url": "https://art.pcoloring.com/assets/images/hero.webp", // 替换为代表网站整体的图片
+      "url": "https://art.pcoloring.com/assets/images/hero.webp",
       "width": 820,
       "height": 360
     },
@@ -449,14 +449,15 @@
   "name": "Dog Riding an Electric Scooter - Video Story Coloring Page",
   "description": "Watch the real-life story of a dog riding an electric scooter that inspired our coloring page. Then, color it yourself!",
   "thumbnailUrl": "https://d2mb6s2cy1zg97.cloudfront.net/thumbs/coloring-page/vs-poster/320/67b2b23b9c09d12e648ea25a.webp",
-  "uploadDate": "2025-01-17T08:00:00+08:00", // 替换为实际上传日期和时区
+  "uploadDate": "2025-01-17T08:00:00+08:00",
   "contentUrl": "https://d1tdr4l5yr56j4.cloudfront.net/%E7%8B%97%E9%AA%91%E7%94%B5%E5%8A%A8%E8%BD%A602-story.m3u8",
   "duration": "PT11S",
+  "url": "https://art.pcoloring.com",
   "potentialAction": {
     "@type": "WatchAction",
     "target": {
       "@type": "EntryPoint",
-      "url": "https://art.pcoloring.com/video-coloring-pages"
+      "url": "https://art.pcoloring.com"
     }
   },
   "interactionStatistic": {
@@ -476,7 +477,8 @@
   "thumbnailUrl": "https://art.pcoloring.com/assets/images/app-tutorial-poster.webp",
   "uploadDate": "2025-06-15T10:00:00+08:00",
   "contentUrl": "https://art.pcoloring.com/assets/video/art-number-coloring.mp4",
-  "duration": "PT45S", // 例如:12秒
+  "duration": "PT45S",
+  "url": "https://art.pcoloring.com",
   "potentialAction": {
     "@type": "WatchAction",
     "target": {
@@ -487,7 +489,7 @@
   "interactionStatistic": {
     "@type": "InteractionCounter",
     "interactionType": "https://schema.org/WatchAction",
-    "userInteractionCount": 3252 // 替换为实际观看次数
+    "userInteractionCount": 3252
   }
 }
 </script>

+ 20 - 24
views/v2/video-coloring-pages.ejs

@@ -424,30 +424,26 @@
     }
   </style>
 
+  <% data.forEach(function(item) { %>
   <script type="application/ld+json">
-{
-  "@context": "https://schema.org",
-  "@type": "VideoObject",
-  "name": "Dog Riding an Electric Scooter - Video Story Coloring Page",
-  "description": "Watch the real-life story of a dog riding an electric scooter that inspired our coloring page. Then, color it yourself!",
-  "thumbnailUrl": "https://d2mb6s2cy1zg97.cloudfront.net/thumbs/coloring-page/vs-poster/320/67b2b23b9c09d12e648ea25a.webp",
-  "uploadDate": "2025-01-17T08:00:00+08:00",
-  "contentUrl": "https://d1tdr4l5yr56j4.cloudfront.net/%E7%8B%97%E9%AA%91%E7%94%B5%E5%8A%A8%E8%BD%A602-story.m3u8",
-  "duration": "PT11S",
-  "potentialAction": {
-    "@type": "WatchAction",
-    "target": {
-      "@type": "EntryPoint",
-      "url": "https://art.pcoloring.com/video-coloring-pages"
-    }
-  },
-  "interactionStatistic": {
-    "@type": "InteractionCounter",
-    "interactionType": "https://schema.org/WatchAction",
-    "userInteractionCount": 2353
+  {
+    "@context": "https://schema.org",
+    "@type": "VideoObject",
+    "name": "<%- item.seoTitle %>",
+    "thumbnailUrl": "<%= item.poster %>",
+    "uploadDate": "<%= new Date(item.timeCreate).toISOString() %>",
+    "contentUrl": "<%= item.url %>",
+    "url": "https://art.pcoloring.com/video-coloring-pages/<%= item._id %>",
+    "potentialAction": {
+      "@type": "WatchAction",
+      "target": {
+        "@type": "EntryPoint",
+        "url": "https://art.pcoloring.com/video-coloring-pages/<%= item._id %>"
+      }
+    }
   }
-}
-</script>
+  </script>
+  <% }); %>
 
   <script type='text/javascript'
     src='https://platform-api.sharethis.com/js/sharethis.js#property=685036ce6c1ae8001abaded7&product=sop'
@@ -521,9 +517,9 @@
           <% data.forEach(item=> { %>
             <div class="coloring-card">
               <div data-content-id="<%= item._id %>" class="coloring-image">
-                <a href="javascript:;" onclick="onPlay(`<%= item.url %>`, `<%= item.jsonStr %>`)">
+                <a href="/video-coloring-pages/<%= item._id %>" onclick="event.preventDefault(); onPlay(`<%= item.url %>`, `<%= item.jsonStr %>`)">
                   <img src="<%= item.poster %>" alt="<%= item.seoTitle %>">
-                  <img src="/assets/svg/play-button.svg" , class="video-play-icon" width="20px" height="20px"
+                  <img src="/assets/svg/play-button.svg" class="video-play-icon" width="20px" height="20px"
                     alt="Coloring Page Video Play Button">
                 </a>
               </div>