yaml - "There was a YAML syntax error"... "mapping values are not allowed in this context"

标签 yaml jekyll github-pages

有很多帖子描述了同样的错误,我试图阅读所有帖子以找出导致我的错误的确切原因。

我已尝试以十一种不同的方式修改此文件,甚至将其还原为原始文件 - 仍然没有成功。我错过了什么?

错误应该在“第 3 行第 22 列”上——这并不存在。我在客户端没有 jekyll 解析器,一切都通过 GitHub Pages 处理。

https://github.com/drovani/drovani.github.io/commits/master/_config.yml

#
# This file contains configuration flags to customize your site
#

# Name of your site (displayed in the header)
name: "Rovani in C#"

# Short bio or description (displayed in the header)
description: "Ostinato, Pensato, Scordatura"

# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://avatars3.githubusercontent.com/u/898478

#
# Flags below are optional
#

# Includes an icon in the footer for each username you enter
footer-links:
  dribbble:
  email: dev@rovani.net
  facebook:
  flickr:
  github: drovani
  instagram:
  linkedin:
  pinterest:
  rss: # just type anything here for a working RSS icon
  twitter: davidrovani
  stackoverflow: "users/28310/drovani"
  youtube: # channel/<your_long_string> or user/<user-name>
  googleplus: # anything in your profile username that comes after plus.google.com/


# Enter your Disqus shortname (not your username) to enable commenting on posts
# You can find your shortname on the Settings page of your Disqus account
disqus: drovani

# Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking
google_analytics: UA-82341148-1

# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url:

# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
# and NOT your User repository (http://yourusername.github.io)
# then add in the baseurl here, like this: "/repository-name"
baseurl: ""

#
# !! You don't need to change any of the configuration flags below !!
#

permalink: /:title/

# The release of Jekyll Now that you're using
version: v1.2.0

# Jekyll 3 now only supports Kramdown for Markdown
kramdown:
  # Use GitHub flavored markdown, including triple backtick fenced code blocks
  input: GFM
  # Jekyll 3 and GitHub Pages now only support rouge for syntax highlighting
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    # Use existing pygments syntax highlighting css
    css_class: 'highlight'

# Set the Sass partials directory, as we're using @imports
sass:
  style: :expanded # You might prefer to minify using :compressed

# Use the following plug-ins
gems:
  - jekyll-sitemap # Create a sitemap using the official Jekyll sitemap gem
  - jekyll-feed # Create an Atom feed using the official Jekyll feed gem

# Exclude these files from your production _site
exclude:
  - Gemfile
  - Gemfile.lock
  - LICENSE
  - README.md
  - CNAME

最佳答案

问题不在 _config.yml 文件中,而是在一个完全不同的文件中。因此,如果您在构建 github-pages Jekyll 页面时收到此错误消息,请不要假设它位于唯一的“YAML”文件中。搜索您为第 3 行第 22 列添加的任何新文件,这将追踪错误。

在我的例子中,这是一篇文章的标题,前面有一个冒号,后面有一个空格——我需要用双引号引起来。

关于yaml - "There was a YAML syntax error"... "mapping values are not allowed in this context",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38926857/

相关文章:

ruby - 在 jekyll 中导入 wordpress 帖子

javascript - "file"参数必须是字符串类型。在 npm run deploy 到 gh-pages 时接收到类型未定义

jekyll - Markdown 中的目录,仅使用标准/开箱即用的 Github Pages 工具?

css - 如何在 github-pages 上使用 'self-host' 字体 - 网站字体未加载

amazon-web-services - 如何使用 Cloudformation 在 Route53 上创建私有(private)主机区

Jekyll - 在现有项目中创建新的站点脚手架

python - Snakemake:基于 jsonschema 验证嵌套 yaml

jquery - 制作具有倒置背景的 Jekyll 站点页面

git - Bitbucket 管道 - 具有相同步骤的多个分支

ruby - 一个 YAML 对象可以引用另一个吗?