为什么我在 Netlify/Hugo 中修复“构建"的步骤不起作用? [英] Why are the steps I took to fix 'builds' in Netlify/Hugo not working?

查看:48
本文介绍了为什么我在 Netlify/Hugo 中修复“构建"的步骤不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Netlify/Hugo 没有更新我推送到 Github 的更改.这是一个奇怪的问题,因为就我而言,我没有做任何与出现此问题之前所做的事情不同的事情.

Netlify/Hugo is not updating the changes I have pushed to Github. This is a weird issue since I have, as far as I am concerned, not done anything different from what I have been doing before this problem occurred.

我遵循了这本本书的说明以及Netlify 但没有任何效果.

I have followed the instructions of this book and the one offered by of Netlify but none worked.

我也联系过 Netlify,但在他们回答我后无法完全理解我应该做什么.见下文.

I have also contacted Netlify but could not completely understand what I am supposed to do after they answered me. See below.

当我查看您的构建时,我看到了 Hugo 错误.如果您在本地使用 Hugo 0.53,我怀疑您也会在本地获取它们?当您克隆目录的新副本(而不是您在其中进行本地更改的副本)并尝试运行 Hugo 0.53/extended 时,构建效果会更好吗?如果是这样,那么您的下一个调试步骤将在这里:https://github.com/netlify/build-image#running-locally 自己运行我们的构建容器以尝试调试.

When I take a look at your builds, I see hugo errors. I suspect you'd get them locally too in case you use hugo 0.53 locally? When you clone a FRESH COPY of your directory (rather than one you've made local changes in), and try to run hugo 0.53/extended, do builds work better? If so then your next debugging steps will be here: https://github.com/netlify/build-image#running-locally to run our build container yourself to try to debug.

我根据此回复所做的如下:

What I did based on this response was the following:

i) 我去了 RStudio 并在Git"中打开了shell".我在那里写了 'git clone https://github.com/website_address.git'.

i) I went to RStudio and opened 'shell' in 'Git'. There I wrote 'git clone https://github.com/website_address.git'.

ii) 作为 Git 中此命令的结果,在存储库中打开了一个新文件夹.

ii) As a result of this command in Git, a new folder opened in the repository.

iii) 然后我在我的笔记本电脑中启动了命令提示符"来运行 Hugo '0.53/extended'.'C:\Users\NewUser>docker pull netlify/build:v0.53/extended'.这导致了以下错误消息:'docker' 不是内部或外部命令,也不是可运行的程序或批处理文件.

iii) Then I started 'command prompt' in my laptop to run hugo '0.53/extended'. 'C:\Users\NewUser>docker pull netlify/build:v0.53/extended'. This resulted in the following error message: 'docker' is not recognized as a internal or external command, operable program or batch file.

我对v.0.53/extended"做了些微修改,但错误仍然存​​在.我也在 Git 中尝试过这行代码,但无济于事.

I have made slight modifications to 'v.0.53/extended' but the error persists. I have also tried this line of code in Git but to no avail.

iv) 我还在我的 Github 存储库中创建了一个 README 文件夹,并复制了 Netlify 提供的这个片段:

iv) I have also created a README folder in my Github repository and copied this snippet provided by Netlify:

[![Netlify Status](https://api.netlify.com/api/v1/badges/b3749a18-96fa-4abc-bfc7-1d4a331ae78e/deploy-status)](https://app.netlify.com/sites/website_address/deploys)

但问题仍然存在.

这是 Netlify 显示的错误消息之一:

This is one of the error messages that Netlify shows:

2:31:20 PM:构建准备开始下午 2:31:21:构建映像版本:9e0f207a27642d0115b1ca97cd5e8cebbe492f63下午 2:31:21:构建镜像标签:v3.3.2下午 2:31:21:构建机器人版本:75cd99f62ada9e21edea53208e8baf0eab85a045下午 2:31:22:获取缓存的依赖项2:31:22 PM:开始下载 104.5MB 的缓存下午 2:31:22:在 626.785348 毫秒内完成下载缓存2:31:22 PM:开始提取缓存下午 2:31:25:在 3.003714699 秒内完成提取缓存下午 2:31:25:在 3.716551911 秒内完成获取缓存2:31:25 PM:开始准备构建的repo下午 2:31:26:准备 Git 参考 refs/heads/master下午 2:31:28:检查子模块时出错:致命:在 .gitmodules 中找不到子模块路径Blogdown"的 url下午 2:31:28:构建失败:无法准备回购下午 2:31:28:在准备回购"阶段失败:检查子模块时出错:致命:在 .gitmodules 中找不到子模块路径Blogdown"的 url: 退出状态 1282:31:28 PM:在 6.17222572s 内完成处理构建请求下午 2:31:28:关闭日志记录,0 条消息待处理

我怀疑这里暗示了解决我的问题的答案:

I suspect that the answer for solving my problem is hinted here:

检查子模块时出错:致命:在 .gitmodules 中找不到子模块路径Blogdown"的 url.

所以我检查了这个 answer 但我仍然对我应该做什么一无所知.

So I checked this answer but I am still in the dark about what I am supposed to do.

我显然在这里做错了一些(可能很多)事情.但我不知道这些错误在哪里以及是什么.

I am obviously doing some(probably many)things wrong here. But I have no idea where and what these mistakes are.

如果有人能引导像我这样的新手走出这个坑就好了.

It would be great if someone could guide a newbie like me out of this hole.

非常感谢.

ps.Github 和 RStudio 沟通良好.

ps. Github and RStudio are communicating well.

推荐答案

以前,我在不同的项目中遇到过类似的问题.经过一番尝试后,我找到了解决方案.我的解决方案是解耦子模块并将代码移动到我的代码库中(或为此使用托管包).

Previously, I've had similar issues in different projects. After trying a bit around I found a solution. My solution is to decouple the submodule and move the code into my codebase (or using a managed package for this).

要解耦模块,请进入您的子模块文件夹,删除 .git 文件夹并将文件添加到您的 git 存储库.在命令行上,我会这样做:

To decouple the module go into your submodule folder, delete the .git folder and add the files to your git repository. On the command line I would do it like this:

// going into the submodule - might need to tweaked, depending on the exact path
cd Blogdown

// delete the git submodule
rm -rf .git

// going out of the directory
cd ..

// adding everything to git
git add .

通过这些步骤(以及对路径的潜在微调),我已经能够为我解决这个问题.

With these steps (and potentially minor tweaks to the paths) I've been able to resolve this issue for me.

这篇关于为什么我在 Netlify/Hugo 中修复“构建"的步骤不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆