我想在某些特定页面上添加架构标签并在头标签中加载我的自定义 CSS,而不是全部,所以他们有什么简单的方法可以做到这一点,因为我不是编码器,有人可以帮我解决这个问题吗?
index.styl
要将自定义样式添加到默认安装的 vuepress,我在下面使用以下代码.vuepress/styles/
来更新content__default
css 类:
/**
* Custom Styles here.
*
* ref:https://v1.vuepress.vuejs.org/config/#index-styl
*/
.home .hero img
max-width 450px!important
.content__default
background-color #3df085
阅读你的评论后,我看到自定义布局是解决方案。
通过以下方式将标签添加到头部config.js
:
head: [
['meta', { name: 'theme-color', content: '#3eaf7c' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
['meta', { 'property': 'og:type', 'content': 'article' }]
],
使用默认主题轻松定制:
#1 和 #2 的示例:
/blog/README.md
---
pageClass: blog-page
home: true
heroText: Hero Title
actionLink: /blog/
meta:
- name: description
content: blog page by abuabdellah
- name: keywords
content: super duper SEO
---
# Introduction
This is a test for a blog using v1 Vuepress
/guide/README.md
---
pageClass: guide-page
meta:
- name: description
content: guide page by abuabdellah
- name: keywords
content: super duper SEO
---
# Introduction
VuePress is composed of two parts
索引样式
.theme-container.blog-page
background-color blue !important
.theme-container.guide-page
background-color green !important
您好感谢您的回答,但 loris 插件没有我需要的选项,也很抱歉我没有提到我想在 head 标签中添加 html。而且我想在一个页面中添加样式,而不是我提到的所有内容。
阅读您的评论后,我更新了答案。
谢谢,但它添加了元标记,我希望其他一些东西也可以加载到头部,并且它正在加载到所有页面中,我需要在单个页面中使用它,这样 seo 标记之间就不会发生冲突。
愿那些遵循指导的人平安,我用新的解决方案对其进行了更新。