Comments (4)
你要不看看layout/partial/structured-data.ejs 这个文件和作者提供的原始文件有没有出入。
from hexo-theme-material.
from hexo-theme-material.
把themes/material/layout/_partial/structured-data.ejs
替换成下面的内容貌似可以解决问题(Google初步检查通过,但正式检查仍在进行)。
你看着diff改也行,也就去掉了一个逗点。
$ diff ./structured-data-org.ejs ./structured-data.ejs
52c52
< "description": "<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>",
---
> "description": "<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>"
<% if( (page.current === 1) && (is_home()) ) { %>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Website",
"publisher": {
"@type": "Organization",
"name": "<%= config.title %>",
"logo": "<%= theme.head.high_res_favicon %>"
},
"url": "<%- config.url %>",
"image": {
"@type": "ImageObject",
"url": "<%= theme.head.apple_touch_icon %>"
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "<%= config.url %>"
},
"description": "<%= config.description %>"
}
</script>
<% } %>
<% if( (is_post()) ) { %>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": "<%- config.url + url_for(path) %>",
"headline": "<%- page.title %>",
"datePublished": "<%= page.date %>",
"dateModified": "<%= page.updated %>",
"author": {
"@type": "Person",
"name": "<%= config.author %>",
"image": {
"@type": "ImageObject",
"url": "<%= theme.img.avatar %>"
},
"description": "<%- theme.uiux.slogan %>"
},
"publisher": {
"@type": "Organization",
"name": "<%= config.title %>",
"logo": {
"@type":"ImageObject",
"url": "<%= theme.head.high_res_favicon %>"
}
},
"keywords": "<% if(page.tags && page.tags.each) { page.tags.each(function(tag) { %><%- ',' + tag.name %><% })} %><%= theme.head.keywords %>",
"description": "<% if(page.description) { %><%= page.description %><% } else if(page.excerpt){ %><%= strip_html(page.excerpt).replace(/^s*/, '').replace(/s*$/, '') %><% } else if (config.description){ %><%= config.description %><% } %>"
}
</script>
<% } %>
from hexo-theme-material.
#732 我之前提交了pr 但作者不见了
from hexo-theme-material.
Related Issues (20)
- hexo init 报错 挺喜欢这个主题的 祝愿能越来越好 HOT 1
- 我在footerleft添加了sns-pixiv,但是我用chrome无法看到pixiv的图标,但是用其他浏览器就可以(pc和安卓chrome都不行) HOT 2
- 请问,这个主题如何指定文章的封面图片呢和放大博客文章中的图片? HOT 2
- 分页栏乱码,如何解决? How to solve my error in pagination display? HOT 3
- 关于scheme HOT 3
- 如何将我的博客文章页面向右边扩展?How to extend my post page to more right place with the left unchanged? HOT 3
- hexo s 出现下面的代码,不知道怎么解决? HOT 1
- 第一次使用就报错 HOT 5
- The theme is great! Can paging abnormalities be solved? HOT 2
- 手机端问题 HOT 9
- 分页突然变成这样 HOT 2
- 使用isolation主题,想展示thumbnail
- 手机端背景图片被奇怪缩放
- How to add AMP page linking in head?
- 配置评论系统之后生成错误
- 首页下方上下页按钮错误。 HOT 1
- 切换页面按钮变成一串代码
- 时间轴页面和归档功能优化建议
- demo site is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-material.