Elixir Recipes 项目教程
1. 项目的目录结构及介绍
Elixir Recipes 项目的目录结构如下:
Elixir-Recipes.github.io/
├── _config.yml
├── _posts/
│ ├── 2016-11-20-cancel-a-multiline-command.md
│ ├── 2016-11-17-finding-matching-elements-in-a-list-or-a-map.md
│ ├── 2016-10-28-counting-words-in-a-file.md
│ ├── 2016-10-19-checking-if-a-string-includes-a-substring.md
│ ├── 2016-09-29-list-all-phoenix-routes.md
│ ├── 2016-09-11-monitoring-a-process.md
│ ├── 2016-09-02-convert-atoms-to-strings.md
│ ├── 2016-02-13-iterating-over-all-keys-of-the-map-while-keeping-key-order.md
│ ├── 2017-10-21-how-to-connect-and-debug-elixir-or-phoenix-app-at-heroku.md
│ └── 2016-11-20-create-an-array-containing-the-alphabet.md
├── assets/
│ ├── css/
│ └── images/
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
└── Rakefile
目录结构介绍
_config.yml
: Jekyll 配置文件。_posts/
: 包含所有文章的目录,文章以日期和标题命名。assets/
: 包含项目所需的静态资源,如 CSS 和图片。Gemfile
和Gemfile.lock
: 用于管理项目的依赖。LICENSE
: 项目的许可证文件。README.md
: 项目说明文件。Rakefile
: 用于自动化任务的 Rake 文件。
2. 项目的启动文件介绍
项目的启动文件主要是 _config.yml
和 Gemfile
。
_config.yml
这是 Jekyll 的主要配置文件,包含了网站的基本设置,如标题、描述、URL 等。
Gemfile
这个文件定义了项目所需的 Ruby 依赖包。通过运行 bundle install
命令,可以安装这些依赖包。
3. 项目的配置文件介绍
_config.yml
这个文件包含了 Jekyll 网站的各种配置选项,例如:
title: Elixir Recipes
description: A collection of Elixir programming language solutions to common problems
url: "http://elixir-recipes.github.io"
Gemfile
这个文件定义了项目所需的 Ruby 依赖包,例如:
source 'https://rubygems.org'
gem 'jekyll'
gem 'rake'
通过这些配置文件,可以定制和启动 Elixir Recipes 项目。