使用Hugo可以创建类似博客的网站,用md编辑文章后,hugo可以用网页展示出来。 另外需要添加第三方themes, 而第三方themes是也是一个项目
所以需要在本项目里添加子模块, 添加submodule很简单,但是需要原来的module名字叫hugo-themes, 而hugo在生成网页的时候,只认themes目录

创建hugo项目

hugo new site demo

执行后会在demo目录创建如下结构,为了添加自己的themes, 先将themes目录删除

ls 
archetypes  config.toml  content  docker_compose static  themes

添加git后,再添加hugo-themes子模块

git submodule add https://gitlab.xxxx.com/xxxx/hugo-themes.git

然后目录就多了hugo-themes目录,作为submodule 存在

更名并同步

git mv hugo-themes themes

git submodule sync

git add -u
git commit
git push 

即可完成submodule 更名

相关文章:

  • 2022-12-23
  • 2021-08-10
  • 2021-12-20
  • 2021-12-05
猜你喜欢
  • 2022-01-31
  • 2021-06-12
  • 2021-06-17
  • 2023-03-27
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案