Jekyll Learning #03 - Windows 系统上安装 Jekyll

本地Windows上搭建一个服务,方便调试由 Jekyll 生成的网站效果。

Posted by WENEW on February 24, 2024

搭建完个人的博客网站之后,想修改网站内容,使用代码修改提交的方式有点麻烦。所以可以本地Windows上搭建一个服务,方便调试由 Jekyll 生成的网站效果。

Jekyll 是由 Ruby 语言开发而成的网站搭建工具,其可完成由 Markdown 代码仓库生成网站的流程。

安装 Ruby 环境

官网 下载RubyInstaller(WITH DEVKIT)。

注意:所有的勾都要选上(默认)。

无难点安装后 验证命令:

ruby -v

安装RubyGems

Windows中下载ZIP, 下载后解压到任意路径。打开Windows的cmd界面, 输入命令:

$ cd 解压的路径

切换镜像源

gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/

gem sources -l

安装Jekyll

gem install jekyll

安装jekyll-paginate

gem install jekyll-paginate

验证 jekyll

jekyll -v

安装 Bundler

gem install bundler 

安装 一个名为 Bundler 的程序 —— 用于自动安装其他所需的程序

本地启动服务

直接找到加载服务的文件夹,选中后,右键进入cmd界面

jekyll serve 

查看网站

浏览器直接输入127.0.0.1:4000localhost:4000

注意:如端口被占用修改端口

jekyll serve -P 5555

参考

Jekyll搭建个人博客


Author: WENEW
Link: https://www.wepro.uk/2024/02/24/Windows-%E7%B3%BB%E7%BB%9F%E4%B8%8A%E5%AE%89%E8%A3%85-Jekyll/
Liscense: All work at this site, unless otherwise noted, are not allowed to be reproduced, all rights reserved. If any post accidentally infringes your copyright, it will be removed shortly after being informed.

本站所有文章,除非另有声明,均不允许以任何形式转载,本站保留所有权利。如果本站内容不小心侵犯了您的著作权,侵权内容会在收到通知后立即删除。