首页
/ Jekyll Embed Video 项目使用教程

Jekyll Embed Video 项目使用教程

2024-08-27 09:26:55作者:蔡丛锟

1. 项目的目录结构及介绍

Jekyll Embed Video 项目的目录结构如下:

jekyll-embed-video/
├── _includes/
│   ├── youtubePlayer.html
│   └── ...
├── assets/
│   ├── css/
│   │   └── video-embed.css
│   └── ...
├── _config.yml
├── index.md
└── ...

目录结构介绍

  • _includes/:包含用于嵌入视频的 HTML 文件,如 youtubePlayer.html
  • assets/:包含项目所需的静态资源,如 CSS 文件 video-embed.css
  • _config.yml:Jekyll 项目的配置文件。
  • index.md:项目的主页 Markdown 文件。

2. 项目的启动文件介绍

项目的启动文件主要是 index.md,它是项目的主页文件。在这个文件中,你可以看到如何引用 _includes 目录下的视频嵌入文件,并展示嵌入的视频。

index.md 文件示例

---
layout: default
title: Jekyll Embed Video
---

## 嵌入 YouTube 视频

{% include youtubePlayer.html id="lDi9uFcD7XI" %}

3. 项目的配置文件介绍

项目的配置文件是 _config.yml,它包含了 Jekyll 项目的各种配置选项。

_config.yml 文件示例

title: Jekyll Embed Video
description:  Jekyll 网页中嵌入视频而不使用插件
baseurl: ""
url: ""
plugins:
  - jekyll-feed

配置文件介绍

  • title:网站的标题。
  • description:网站的描述。
  • baseurl:项目的基准 URL。
  • url:网站的完整 URL。
  • plugins:使用的 Jekyll 插件,如 jekyll-feed

以上是 Jekyll Embed Video 项目的基本使用教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望对你有所帮助!

登录后查看全文
热门项目推荐