• 【hexo博客配置】hexo icarus主题配置


    配置icarus

    步骤一:下载icarus

    github网址:[hexo-theme-icarus](ppoffice/hexo-theme-icarus: A simple, delicate, and modern theme for the static site generator Hexo. (github.com))

    可以从这个网址上下载zip文件,解压后,重命名为icarus,并将这个文件夹放置到hexo的theme文件夹下面

    也可以通过git命令获取

    git clone https://github.com/ppoffice/hexo-theme-icarus.git themes/icarus -b <version number> --depth 1
    
    • 1

    或者

    git submodule add https://github.com/ppoffice/hexo-theme-icarus.git themes/icarus
    
    • 1

    步骤二:修改_config.yml文件

    需要将_config.yml文件中的theme进行修改

    theme: icaurs
    
    • 1

    步骤三:使用shell命令,来配置主题

    在对应的文件夹下面,使用Git Bash Here打开shell窗口

    hexo config theme icarus
    
    • 1

    配置中可能会出现的错误(主要就是缺库):

    缺少semver

    Error: Cannot find module 'semver'
    
    • 1

    该错误是缺少’semver’库,使用npm命令安装即可

    npm install semver
    
    • 1

    缺少相应的依赖

    ERROR Package bulma-stylus is not installed.
    ERROR Package hexo-component-inferno is not installed.
    ERROR Package hexo-pagination's version (3.0.0) does not satisfy the required version (^2.0.0).
    ERROR Package hexo-renderer-inferno is not installed.
    ERROR Package inferno is not installed.
    ERROR Package inferno-create-element is not installed.
    ERROR Please install the missing dependencies your Hexo site root directory:
    ERROR npm install --save bulma-stylus@0.8.0 hexo-component-inferno@^2.0.2 hexo-pagination@^2.0.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3
    ERROR or:
    ERROR yarn add bulma-stylus@0.8.0 hexo-component-inferno@^2.0.2 hexo-pagination@^2.0.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    使用npm命令进行安装即可

    npm install --save bulma-stylus@0.8.0 hexo-component-inferno@^2.0.2 hexo-pagination@^2.0.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3
    
    • 1

    安装好这一切后,就可以进行相应的配置

    icarus配置

    配置icarus,主要参考了以下的内容

    Getting Started with icarus

    [icarus用户配置](Icarus用户指南 - 主题配置 - Icarus (ppoffice.github.io))

    Hexo主题配置

    搭建自己的技术博客系列(六)酷炫主题icarus常用配置整合版,快速搞定博客首页 - 知乎 (zhihu.com)

    首先,要在hexo目录下的_config.yml目录进行修改,主要是对theme设置。

    theme: icarus
    
    • 1

    然后需要根据这个配置文件重新配置hexo,在git bash中输入

    hexo config theme icarus
    
    • 1

    命令执行后,可以发现会在_config.yml文件中生成一个 _config.icarus.yml 文件,这是icarus的配置文件。

    # Version of the Icarus theme that is currently used
    version: 5.1.0 # Icarus的版本
    # 你的网站图标,可以搜索在线图标制作,并将其放在images文件夹中
    favicon: /images/favicon.svg
    # Additional HTML meta tags in an array.
    meta: 
    # Path or URL to RSS atom.xml
    rss: /atom.xml
    # 显示在导航栏左侧的网站logo,同样可以自己制作
    logo: /images/hxx.jpg
    # Open Graph metadata
    # https://hexo.io/docs/helpers.html#open-graph
    open_graph:
        # Facebook App ID
        fb_app_id: 
        # Facebook Admin ID
        fb_admins: 
        # Twitter ID
        twitter_id: 
        # Twitter site
        twitter_site: 
        # Google+ profile link
        google_plus: 
    # Navigation bar link settings
    navbar:
        #菜单(显示名称:对应文件夹)
        menu:
            主页: /
            归档: /archives
            分类: /categories
            标签: /tags
            关于: /about
        # 导航栏右侧图标链接
        links:
            My GitHub:
                icon: fab fa-github
                url: 'https://github.com/h2pl/'
    # Footer section link settings
    footer:
        # 页脚图标链接
        links:
            Creative Commons:
                icon: fab fa-creative-commons
                url: 'https://creativecommons.org/'
            Attribution 4.0 International:
                icon: fab fa-creative-commons-by
                url: 'https://creativecommons.org/licenses/by/4.0/'
            Download on GitHub:
                icon: fab fa-github
                url: 'https://github.com/ppoffice/hexo-theme-icarus'
    # 文章显示设置
    article:
        #代码主题atom-one-light亮色,atom-one-dark暗色
        highlight:
            # Code highlight themes
            # https://github.com/highlightjs/highlight.js/tree/master/src/styles
            theme: atom-one-dark
            # Show code copying button
            clipboard: true
            # Default folding status of the code blocks. Can be "", "folded", "unfolded"
            fold: unfolded
        # 是否显示文章主图
        thumbnail: true
        # 是否显示估算阅读时间
        readtime: true
    # 搜索插件设置
    # https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Search
    search:
        # Name of the search plugin
        type: insight
    # 评论插件设置
    # https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Comment
    comment:
        #可选valine,disqus(科学上网)等
        # Name of the comment plugin
        avatar: retro # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
        placeholder: 要不要说点啥... # Comment Box placeholder
        type: valine
        shortname: 黄小斜
    # 打赏功能
    # https://ppoffice.github.io/hexo-theme-icarus/categories/Donation/
    donate:
        -
            # 阿里巴巴支付宝
            type: alipay
            # 二维码图片
            qrcode: '/images/hxx.jpg'
        -
            # 微信
            type: wechat
            # 二维码图片
            qrcode: '/images/hxx.jpg'
    
    # 分享插件设置
    # https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Share
    share:
        # Share plugin name
        type: sharejs
    # Sidebar settings.
    # Please be noted that a sidebar is only visible when it has at least one widget
    sidebar:
        # 左侧边栏设置
        left:
            # 是否不随页面滚动
            # https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/make-a-sidebar-sticky-when-page-scrolls/
            sticky: false
        # right sidebar settings
        right:
            # 是否不随页面滚动
            # https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/make-a-sidebar-sticky-when-page-scrolls/
            sticky: false
    # 边栏小部件设置
    # https://ppoffice.github.io/hexo-theme-icarus/categories/Widgets/
    widgets:
        -
            # Widget name
            type: profile
            # Where should the widget be placed, left or right
            position: left
            # Author name to be shown in the profile widget
            author: 黄小斜
            # Title of the author to be shown in the profile widget
            author_title: 蚂蚁金服Java工程师
            # Author's current location to be shown in the profile widget
            location: 浙江 杭州
            # Path or URL to the avatar to be shown in the profile widget
            avatar: /images/gzh.jpg
            # Email address for the Gravatar to be shown in the profile widget
            gravatar: 
            # Whether to show avatar image rounded or square
            avatar_rounded: false
            # 关注我的链接,可设为你的GitHub主页
            follow_link: 'https://github.com/h2pl/'
            # 个人介绍部件底部图标社交链接
            social_links:
                Github:
                    icon: fab fa-github
                    url: 'https://github.com/h2pl'
                RSS:
                    icon: fas fa-rss
                    url: /
        -
            # Widget name
            type: toc
            # Where should the widget be placed, left or right
            position: left
        -
            # Widget name
            type: links
            # Where should the widget be placed, left or right
            position: left
            # Links to be shown in the links widget
            links:
                CSDN: 'https://blog.csdn.net/a724888'
                知乎: 'https://www.zhihu.com/people/h2pl/activities'
                简书: 'https://www.zhihu.com/people/h2pl/activities'
        -
            # Widget name
            type: category
            # Where should the widget be placed, left or right
            position: left
        -
            # Widget name
            type: tagcloud
            # Where should the widget be placed, left or right
            position: left
        -
            # Widget name
            type: recent_posts
            # Where should the widget be placed, left or right
            position: right
        -
            # Widget name
            type: archive
            # Where should the widget be placed, left or right
            position: right
        -
            # Widget name
            type: tag
            # Where should the widget be placed, left or right
            position: right
    # Other plugin settings
    plugins:
        # Enable page animations
        animejs: true
        # Enable the lightGallery and Justified Gallery plugins
        # https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/gallery-plugin/
        gallery: true
        # Enable the Outdated Browser plugin
        # http://outdatedbrowser.com/
        outdated-browser: true
        # Enable the MathJax plugin
        # https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/mathjax-plugin/
        mathjax: true
        # Show the back to top button on mobile devices
        back-to-top: true
        # Google Analytics plugin settings
        # https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Google-Analytics
        google-analytics:
            # Google Analytics tracking id
            tracking_id: 
        # Baidu Analytics plugin settings
        # https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Baidu-Analytics
        baidu-analytics:
            # Baidu Analytics tracking id
            tracking_id: 2289335dd443797b5867abbd156e7575
        # Hotjar user feedback plugin
        # https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Hotjar
        hotjar:
            # Hotjar site id
            site_id: 
        # Show a loading progress bar at top of the page
        progressbar: true
        # BuSuanZi site/page view counter
        # https://busuanzi.ibruce.info
        busuanzi: true
    busuanzi:
        enable: true
    # CDN provider settings
    # https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/speed-up-your-site-with-custom-cdn/
    # Show PV/UV of the website/page with busuanzi.
    # Get more information on http://ibruce.info/2015/04/04/busuanzi/
    busuanzi_count:
      # count values only if the other configs are false
      enable: true
      # custom uv span for the whole site
      site_uv: true
      site_uv_header: 访客数
      site_uv_footer:# custom pv span for the whole site
      site_pv: true
      site_pv_header: 总访问量
      site_pv_footer:# custom pv span for one page only
      page_pv: true
      page_pv_header: -file-o">>  阅读数
      page_pv_footer:
    
    
    providers:
        # Name or URL of the JavaScript and/or stylesheet CDN provider
        cdn: jsdelivr
        # Name or URL of the webfont CDN provider
        fontcdn: google
        # Name or URL of the webfont Icon CDN provider
        iconcdn: fontawesome
    
    • 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
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246

    Hexo配置好后,使用命令进行更新,并在本地进行查看

    hexo g
    hexo s
    
    • 1
    • 2

    当一切配置完成后,需要讲配置好的文件,传输到gitee上,并进行更新。

    hexo clean
    hexo g
    hexo d
    
    • 1
    • 2
    • 3

    然后需要在gitee上进行更新,才能在gitee上看出来。

    更新

    这样就可以完成icarus主题配置。

  • 相关阅读:
    Python学习笔记--自定义容器(Container)
    三剑客之 awk
    如何通过低代码平台来实现移动办公
    python二级该怎么准备,考前一个月,2023年12月份
    SDL2 播放音频数据(PCM)
    抓住金三银四的尾巴,解锁程序员面试《刷题神器》
    如何利用AirDroid远程访问安卓设备屏幕?
    eclipse启动一个Springboot项目
    SAP 教程之 SAP 中的 IDOC
    使用 @antfu/eslint-config 配置 eslint (包含兼容uniapp方法)
  • 原文地址:https://blog.csdn.net/weixin_43571647/article/details/134267450