【问题标题】:Redundant files and folder on jekyll sitejekyll 站点上的冗余文件和文件夹
【发布时间】:2016-12-29 04:16:55
【问题描述】:

我正在用 github 学习 jekyll。当我跑步时:

jekyll new portfolio

它只是正常工作。假设 portfolio 是我的根项目文件夹。当我将我的 favicon 复制到根文件夹时,该文件会自动复制到 _site 文件夹,然后当我在根文件夹上创建新主题时:

jekyll new minimalist-design

它给了我多余的文件夹和文件:它是在根文件夹和_site 文件夹中创建的。它还在我的主题文件夹中再次给了我一个.git 文件夹。

为什么会这样?

这是我的根文件夹中的完整树

portfolio/
├──.gitignore
├──about.md
├──Gemfile
├──Gemfile.lock
├──index.md
├──LICENSE
├──README.md
├──_config.yml
│
├──.git
│  └──//list of repository files
│
├──.sass-cache
│  ├──_base.scssc
│  ├──_layout.scssc
│  ├──_syntax-highlighting.scssc
│  └──minima.scssc
│
├──minimalist-design
│  ├──//It's my created theme folder 
│  ├──.gitignore
│  ├──Gemfile
│  ├──LICENSE.txt
│  ├──minimalist-design.gemspec
│  ├──README.md
│  │
│  ├──.git
│  │  └──//Another repository folder????
│  ├──assets
│  ├──_includes
│  ├──_layouts
│  │  ├──default.html
│  │  ├──page.html
│  │  └──post.html
│  │
│  └──_sass
│
├──_posts
│  └──2016-12-29-welcome-to-jekyll.markdown
│
└──_site
   ├──feed.xml
   ├──feed.xslt.xml
   ├──index.html
   ├──LICENSE
   ├──README.md
   │
   ├──about
   │  └──index.html
   │
   ├──assets
   │  └──main.css
   │
   ├──jekyll
   │
   └──minimalist-design
      ├──//Another my theme folder again????
      ├──Gemfile
      ├──LICENSE.txt
      ├──minimalist-design.gemspec
      └──README.md

【问题讨论】:

    标签: git directory jekyll


    【解决方案1】:

    来自documentation关于_site目录:

    这是 Jekyll 完成转换后生成的站点将放置的位置(默认情况下)。将其添加到您的 .gitignore 文件中可能是个好主意。

    换句话说,当运行 jekyll build 命令之一(例如jekyll buildjekyll serve)时,您放在根文件夹中的每个文件都将被复制到_site,因为它基本上是生成构建文件的地方.

    对于通常的、不被解析和解释的文件(例如,没有流动代码的文件或不是 Markdown 格式帖子的文件),文件只是被复制而没有像你注意到的那样进行转换。


    子目录中的.git文件夹表示它们是独立的git仓库:你可以查看它们的内容是否不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-04
      • 1970-01-01
      • 2013-11-19
      • 1970-01-01
      • 2014-10-07
      • 1970-01-01
      相关资源
      最近更新 更多