当前位置: 首页 > news >正文

零成本搞定静态博客——十分钟安装hugo与主题

文章目录

  • hugo介绍
  • hugo安装与使用
  • 方式一:新建站点自建主题
  • 方式二:新建站点使用系统推荐的主题

hugo介绍

通过 Hugo 你可以快速搭建你的静态网站,比如博客系统、文档介绍、公司主页、产品介绍等等。相对于其他静态网站生成器来说,Hugo 具备如下特点: 1. 极快的页面编译生成速度。( ~1 ms 每页面) 2. 完全跨平台支持,可以运行在 Mac OS X, Linux, Windows, 以及更多! 3. 安装方便 Installation 4. 本地调试 Usage 时通过 LiveReload自动即时刷新页面。 5. 完全的皮肤支持。

hugo安装与使用

本文使用Chocolatey安装hugo工具。

Chocolatey 是一款 Windows 软件管理自动化工具,它将安装程序、可执行文件、压缩文件和脚本打包成编译好的包。这个应用程序与 SCCM、Puppet、Chef 等集成,并得到了企业信任来管理软件部署。

# 搜索
choco search hugo
# 安装
choco install hugo-extended
# 卸载
choco uninstall hugo-extended

接下来有两种方式

方式一:新建站点自建主题

hugo new site mysite
cd mysite

看一下目录结构

mysite
├─archetypes
├─assets
├─content
├─data
├─i18n
├─layouts
├─static
└─themes

新建主题

# 新建主题,名称为mytheme
hugo new theme mytheme
# 设置主题,名称为mytheme
echo "theme = 'mytheme'" >> hugo.toml
# 启动服务
hugo server

方式二:新建站点使用系统推荐的主题

系统推荐的主题

hugo new site myblog
# 或者
hugo new site myblog --format "yaml"

输出

Congratulations! Your new Hugo site was created in D:\hugoweb\mysite001.Just a few more steps...1. Change the current directory to D:\hugoweb\mysite001.
2. Create or install a theme:- Create a new theme with the command "hugo new theme <THEMENAME>"- Or, install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>\<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".

安装主题

cd myblog
# 会在当前目录下生成一个.git文件夹
git init
# 添加子模块
git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
echo "theme = 'PaperMod'" >> hugo.toml
hugo server
http://www.lryc.cn/news/431695.html

相关文章:

  • windows C++ 并行编程-转换使用取消的 OpenMP 循环以使用并发运行时
  • 经验笔记:跨站脚本攻击(Cross-Site Scripting,简称XSS)
  • 演示:基于WPF的DrawingVisual和谷歌地图瓦片开发的地图(完全独立不依赖第三方库)
  • 【C++】static作用总结
  • 视频提取字幕的软件有哪些?高效转录用这些
  • (4)SVG-path中的椭圆弧A(绝对)或a(相对)
  • docker国内镜像源报错解决方案
  • 《C++进阶之路:探寻预处理宏的替代方案》
  • 【综合案例】使用鸿蒙编写掘金评论列表案例
  • 【springboot】使用缓存
  • <Linux> 基础IO
  • OpenFeign的使用(一)
  • 【Python报错已解决】`AttributeError: move_to requires a WebElement`
  • 数据结构(邓俊辉)学习笔记】排序 2——快速排序:性能分析
  • 在postman中使用javascript脚本生成sign签名
  • 设计模式—2—单例模式
  • 服务器数据恢复—磁盘坏扇区导致raid6阵列崩溃的数据恢复案例
  • 原码、反码、补码
  • 排序算法之计数排序详细解读(附带Java代码解读)
  • Linux:如何使用 Crontab
  • AI模型:追求全能还是专精?-- 之7 智能工厂程序设计
  • 如何在本地服务器部署SeaFile自托管文件共享服务结合内网穿透打造私有云盘?
  • 学习记录:js算法(二十五):合并两个有序链表
  • 43. 1 ~ n 整数中 1 出现的次数【难】
  • K8S - 理解volumeMounts 中的subpath
  • java工程师成功转型大数据
  • visual studio 2022更新以后,之前的有些工程编译出错,升级到Visual studio Enterprise 2022 Preview解决
  • Linux 性能调优技巧
  • 【网络安全】WordPress Uncontrolled Resource Consumption
  • gitee绑定公钥后依旧无法使用_gitee push添加公钥无效