我想使用Jekyll从头开始创建一个网站。我使用以下命令:'jekyll new mysite'。它吐出这个:
repo> jekyll new mysite
Running bundle install in /Users/johntowery/repo/kbsite...
Bundler: Fetching gem metadata from https://rubygems.org/...........
Bundler: Fetching gem metadata from https://rubygems.org/.
Bundler: Resolving dependencies...
Bundler: Using public_suffix 4.0.1
Bundler: Using addressable 2.7.0
Bundler: Using bundler 2.0.2
Bundler: Using colorator 1.1.0
Bundler: Using concurrent-ruby 1.1.5
Bundler: Using eventmachine 1.2.7
Bundler: Using http_parser.rb 0.6.0
Bundler: Using em-websocket 0.5.1
Bundler: Using ffi 1.11.1
Bundler: Using forwardable-extended 2.6.0
Bundler: Using i18n 1.6.0
Bundler: Using sassc 2.2.0
Bundler: Using jekyll-sass-converter 2.0.0
Bundler: Using rb-fsevent 0.10.3
Bundler: Using rb-inotify 0.10.0
Bundler: Using ruby_dep 1.5.0
Bundler: Using listen 3.1.5
Bundler: Using jekyll-watch 2.2.1
Bundler: Using kramdown 2.1.0
Bundler: Using kramdown-parser-gfm 1.1.0
Bundler: Using liquid 4.0.3
Bundler: Using mercenary 0.3.6
Bundler: Using pathutil 0.16.2
Bundler: Using rouge 3.10.0
Bundler: Using safe_yaml 1.0.5
Bundler: Using unicode-display_width 1.6.0
Bundler: Using terminal-table 1.8.0
Bundler: Using jekyll 4.0.0
Bundler: Using jekyll-feed 0.12.1
Bundler: Using jekyll-seo-tag 2.6.1
Bundler: Using minima 2.5.1
Bundler: Bundle complete! 6 Gemfile dependencies, 31 gems now installed.
Bundler: Use `bundle info [gemname]` to see where a bundled gem is installed.
New jekyll site installed in /Users/johntowery/repo/mysite.
它创建了一些文件和目录。我了解到,这个新站点使用基于宝石的主题“ Minima”。
repo> cd mysite
mysite> ls
404.html Gemfile Gemfile.lock _config.yml _posts about.markdown index.markdown
到目前为止,一切都很好。我确实知道_layout,_include等已包含在Minima主题中,因此可以预期。我目前尚未添加或更改任何内容。现在,我使用以下命令运行它:bundle execjekyll serve
我明白了
mysite> bundle exec jekyll serve
Configuration file: /Users/johntowery/repo/kbsite/_config.yml
Source: /Users/johntowery/repo/kbsite
Destination: /Users/johntowery/repo/kbsite/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
Build Warning: Layout 'post' requested in _posts/2019-09-12-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in 404.html does not exist.
Build Warning: Layout 'page' requested in about.markdown does not exist.
Build Warning: Layout 'home' requested in index.markdown does not exist.
done in 0.402 seconds.
Auto-regeneration: enabled for '/Users/johntowery/repo/kbsite'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
为什么不认识到那些“缺失”的布局在Minima gem中?
_config.yml
文件夹:(由jekyll new
自动生成,我没有对其进行修改。)
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
#
# If you need help with YAML syntax, here are some quick references for you:
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/
#
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Your awesome title
email: your-email@example.com
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
# Build settings
theme: minima
plugins:
- jekyll-feed
# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
# - Gemfile
# - Gemfile.lock
# - node_modules/
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
我了解到,使用jekyll new <newstie>
创建新站点时,它将创建所有基本文件(脚手架)。而且我确实知道未创建某些文件夹,因为它已经位于主题gem(最小)中。我确实知道,如果您要覆盖“默认”,则只需要创建文件夹(_layouts,_includes或_sass等)。我知道。但是我希望jekyll new <sitename>
创建必要的内容并能够成功bundle exec jekyll serve
。但事实并非如此。无法识别那些“丢失”的文件夹在Minima gem中。为什么无法识别?如果Jekyll无法识别出主题文件夹中的文件夹,那该有什么意义呢?
是否缺少某些东西?
我正在使用:
谢谢
答案 0 :(得分:0)
好吧,我明白了。
问题是已安装的最低宝石为空白。
我通过进行cd $(bundle show minima)
来查看极小的宝石的内容。看到里面的宝石是空白的,没有文件夹或任何文件。
因此,我卸载了gem,然后重新安装。之后,它现在可以工作了。
我不知道为什么安装的最低版本(2.5.1)是空白的gem,也许只是fl幸,或者最初在安装gem期间发生了错误。