Hugo:从GitHub导入sass/代码的最佳方法?

Hugo:从GitHub导入sass/代码的最佳方法?,sass,module,hugo,Sass,Module,Hugo,我试图弄清楚Hugo在运行Hugo server时如何(自动)从Github文件夹中提取最新的文件。特别是,我喜欢从GitHub中提取css文件。实现这一点的最佳方法是什么,这样我就不必总是在Git上手动更新初级CSS了 我认为模块是一种方式(config.yaml): 但是,将其添加到config.yaml时,它似乎不起作用: Error: module "github.com/primer/css" not found; either add it as a Hugo M

我试图弄清楚Hugo在运行
Hugo server
时如何(自动)从Github文件夹中提取最新的文件。特别是,我喜欢从GitHub中提取css文件。实现这一点的最佳方法是什么,这样我就不必总是在Git上手动更新初级CSS了

我认为模块是一种方式(config.yaml):

但是,将其添加到
config.yaml
时,它似乎不起作用:

Error: module "github.com/primer/css" not found; either add it as a Hugo Module or store it in "/Users/user/code/my-theme/themes".: module does not exist
自动从(/src)中提取最新文件并将其加载到
/assets
文件夹中,是否有简单的最佳实践?或者是使用npm节点模块的唯一方法,如下所示:


提前谢谢

我为此挣扎了很长时间。关键是通过运行
hugo mod init{anything}
将您的站点初始化为“go模块”。这将创建一个
go.mod
文件。因此,如果运行
hugo mod init mywebsite
,生成一个
go.mod
,如下所示:

modulemywebsite
去1.14
需要github.com/primer/css v1.0.0//indirect

在那之后,这些模块应该适合您。

我为此奋斗了很长一段时间。关键是通过运行
hugo mod init{anything}
将您的站点初始化为“go模块”。这将创建一个
go.mod
文件。因此,如果运行
hugo mod init mywebsite
,生成一个
go.mod
,如下所示:

modulemywebsite
去1.14
需要github.com/primer/css v1.0.0//indirect
在那之后,这些模块应该适合您

Error: module "github.com/primer/css" not found; either add it as a Hugo Module or store it in "/Users/user/code/my-theme/themes".: module does not exist