章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

  • 系统

    • vmware

    • ftp

    • nexus

    • harbor

    • confluence&jira

    • loki

    • sonarqube

    • svn

    • other

    • openldap

    • influxdb

    • wordpress

    • kvm

    • argocd

    • jfrog

    • nextcloud

    • RustDesk

    • mail

    • ghost

      • linux服务器部署ghost
        • 1、主题选择
        • 2、修改导航栏
        • 3、修改首页横幅内容
        • 4、修改footer底部页面内容
        • 5、添加文章内容
        • 6、效果展示
      • ghost后台tag页面可以展示pages文章
  • docker

  • other

  • 监控

  • 运维
  • 系统
  • ghost
章工运维
2024-12-12
目录

linux服务器部署ghost

# 安装docker

#rocky linux执行:
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

#把软件仓库地址替换为 TUNA:

sudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo

yum install docker-ce

#**启动**

systemctl start docker

systemctl enable docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# docker compose部署ghost

version: '3'
services:
  ghost:
    image: ghost:5.104.2-alpine
    restart: always
    ports:
      - 2368:2368
    environment:
      # Ghost 数据库配置
      - database__client=mysql
      - database__connection__host=mysql
      - database__connection__user=ghost
      - database__connection__password=202dsf343
      - database__connection__database=ghost
      - NODE_ENV=production
      - url=http://192.168.153.134:2368
    depends_on:
      - mysql
    networks:
      - ghost_network

  mysql:
    image: mysql:8.0.39
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=202dsf343
      - MYSQL_DATABASE=ghost
      - MYSQL_USER=ghost
      - MYSQL_PASSWORD=202dsf343
    volumes:
      - ./mysql-data:/var/lib/mysql
    networks:
      - ghost_network

networks:
  ghost_network:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

启动

docker compose up -d

# 访问web

http://192.168.153.134:2368/

7b49e3e6bc3e85d8.png

后台:Ghost Admin (opens new window)

ce1b2a28f591578b.png

# casper主题优化

# 1、主题选择

点击后台设置,选择casper主题

1081ed2d927ca436.png

4e822c614774a369.png

# 2、修改导航栏

49d349931022501f.png

3d7366f27d340ffa.png

去掉sign in和订阅

将Subscription access改成nobody

1fbf69a199e53c2e.png

# 3、修改首页横幅内容

3659bab3727fbd57.png

# 4、修改footer底部页面内容

/var/lib/ghost/content/themes/casper/default.hbs

搜索footer,将下面内容注释掉或者删除,删掉重启服务:docker restart ghost-ghost-1

注意先备份

    <footer class="site-footer outer">
        <div class="inner">
            <section class="copyright"><a href="{{@site.url}}">{{@site.title}}</a> © {{date format="YYYY"}}</section>
            <nav class="site-footer-nav">                                                                                                                 
                {{navigation type="secondary"}}
            </nav>
            <div class="gh-powered-by"><a href="https://ghost.org/" target="_blank" rel="noopener">Powered by Ghost</a></div>
        </div>                           
    </footer>
1
2
3
4
5
6
7
8
9

登录后台页面,点击代码注入,点击site footer

<footer class="site-footer custom-footer">
    <div class="footer-container">
        <div class="footer-content">
            <div class="footer-section">
                <h4>关于我们</h4>
                <p>这里是网站简介</p>
            </div>
            <div class="footer-section">
                <h4>联系方式</h4>
                <p>邮箱:example@email.com</p>
                <p>电话:123-456-7890</p>
            </div>
            <div class="footer-section">
                <h4>友情链接</h4>
                <a href="#">链接1</a>
                <a href="#">链接2</a>
            </div>
        </div>
        <div class="footer-bottom">
            <p>© {{date format="YYYY"}} 您的网站名称. 版权所有.</p>
        </div>
    </div>
</footer>

<style>
.custom-footer {
    background-color: #5a5454;
    padding: 20px 0;
    text-align: center;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-content {
    display: flex;
    justify-content: space-around;
}
.footer-section {
    flex: 1;
    margin: 0 15px;
}
.footer-bottom {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

c5e83311102ca9d1.png

7f5a539449f35975.png

# 5、添加文章内容

点击后台的Posts->Published

c248b6fc8eed3008.png

# 6、效果展示

6f08ee55af3f2ff7.jpg

微信 支付宝
上次更新: 2024/12/30, 14:46:54

← 使用iRedMail在Ubuntu 20.04上搭建邮件服务 ghost后台tag页面可以展示pages文章→

最近更新
01
shell脚本模块集合
05-13
02
生活小技巧(认知版)
04-29
03
生活小技巧(防骗版)
04-29
更多文章>
Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式