生活在宁静的角落
Attachments
History
Blame
View Source
A - Z
Changelog
Documentation
About An Otter Wiki
Toggle dark mode
Login
Home
Menu
IT运维
MarkDown语法
Pelican安装简要配置说明
ad8263
Commit
ad8263
2026-01-30 02:11:02
Terry
: -/-
pelican安装简要配置说明.md
..
@@ 1,26 1,24 @@
# Pelican安装简要配置说明
-
# Pelican 安装简要配置说明
-
## 环境准备
### 安装miniconda
下载最新版本miniconda
-
```bash
+
```shell
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
```
### 建立虚拟环境
-
```bash
+
```shell
conda create -n pelicanenv # pelicanenv 为环境名称
```
### 激活虚拟环境
-
```bash
+
```shell
conda ativate pelicanenv
```
@@ 30,19 28,19 @@
此处使用最新版:
-
```bash
+
```shell
conda install conda-forge::pelican
```
### 安装nginx
-
```bash
+
```shell
apt-get install nginx
```
## 创建项目
-
```bash
+
```shell
mkdir /xxx/xxx # 创建项目目录
cd /xxx/xxx # 进入项目目录
pelican-quickstart # 生成pelican 项目
@@ 52,7 50,7 @@
创建完成后生成的目录结构如下:
-
```
+
```shell
.
├── Makefile
├── content/
@@ 69,13 67,13 @@
### 创建第一篇文章
-
```
+
```shell
touch xxx.md
```
模板参考
-
```模板参考
+
```shell
Title: 这是我的第一篇技术博客
Date: 2019-04-24 13:47:06
Category: 技术
@@ 89,7 87,7 @@
### 生成静态文件
-
```bash
+
```shell
pelican content
```
@@ 97,13 95,13 @@
Pelican 自己内置了一个HTTP Server,但是除非是本地开发和测试环境,否则不建议直接使用测试服务
-
```bash
+
```shell
pelican --listen
```
### 配置nginx
-
```bash
+
```shell
vim /etc/nginx/sites-available/default
```
@@ 111,13 109,13 @@
### 下载主题
-
```bash
+
```shell
git clone --recursive https://github.com/getpelican/pelican-themes ~/pelican-themes
```
### 安装主题
-
```bash
+
```shell
pelican-themes -i pelican-themes/gum
```
@@ 125,7 123,7 @@
编辑 pelicanconf.py
-
```bash
+
```shell
vim pelicanconf.py
```
@@ 135,13 133,13 @@
重新生成静态文件
-
```bash
+
```shell
pelican-themes -l
```
查看已经安装可用的主题
-
```bash
+
```shell
pelican-themes -l
```
@@ 151,7 149,7 @@
然后导入pelican
-
```bash
+
```shell
pelican-import --blogger -o ~/output ~/posts.xml
```
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9