willofindie / vscode-gohugo

Hugo Static Site Generator Commandline Helpers
https://marketplace.visualstudio.com/items?itemName=phoenisx.gohugo
MIT License
2 stars 2 forks source link

Extension does not seem to recognize Hugo site #3

Open balaji-dutt opened 3 years ago

balaji-dutt commented 3 years ago

Hi,

I'm a little confused on how to get the extension to work with my local Hugo environment.

Extension version:

0.1.0

My Environment

Expected Behavior

Actual Behavior

Steps to reproduce the problem:

Steps to reproduce:

phoenisx commented 3 years ago

Hi @balaji-dutt

I tried this on my end, with the same theme you are using, but couldn't replicate the issue. Following are my Extension and Software details:

Following are my configs:

And I also tried replicating the same scenarios you mentioned above, but they are working for me on the custom port set.

Can you verify if you have properly setup the extension. One thing to note here, this extension is meant to work with hugo command-line tool (You can see the windows installation here - https://gohugo.io/getting-started/installing#chocolatey-windows) and thus the cmd tool should be installed before working with this extension.

Also, if everything is setup properly, it would be great if you can share a reproduction of this issue, by either creating a small test hugo project which replicates this issue or else if your source code is open, you can share me your project's link which I can use to verify the same.

balaji-dutt commented 3 years ago

Also, if everything is setup properly, it would be great if you can share a reproduction of this issue, by either creating a small test hugo project which replicates this issue

So I'm still having a problem with getting the extension to work, even with a brand new hugo site. Steps I followed so far:

newhugo>cd themes && git submodule add https://github.com/halogenica/beautifulhugo.git beautifulhugo Cloning into 'C:/path/to/newhugo/themes/beautifulhugo'... remote: Enumerating objects: 2865, done. remote: Total 2865 (delta 0), reused 0 (delta 0), pack-reused 2865 Receiving objects: 100% (2865/2865), 6.39 MiB | 3.92 MiB/s, done. Resolving deltas: 100% (1661/1661), done. warning: LF will be replaced by CRLF in .gitmodules. The file will have its original line endings in your working directory


* Add a vscode settings file
``` shell
newhugo> mkdir .vscode && cd .vscode
newhugo>(
echo {
echo    "gohugo.showTerminal": true
echo }
)>"settings.json"

Built in 1854 ms Watching for changes in C:\path\to\newhugo{archetypes,content,data,layouts,static,themes} Watching for config changes in C:\path\to\newhugo\config.toml Environment: "development" Serving pages from memory Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop



The only difference I can see right now is your Operating System seems to be macOS compared to my Windows environment.

> or else if your source code is open, you can share me your project's link which I can use to verify the same.

You can check out this repo: https://github.com/balaji-dutt/tech-notebook
balaji-dutt commented 3 years ago

I think that the extension does not work in Windows.

I tried using the extension with VSCode on macOS with the same "tech-notebook" repo. I was able to get use the commands like "GoHugo: Start Server" and "GoHugo: Create New Content" without any errors.

balaji-dutt commented 3 years ago

After toggling Developer Tools in VSCode on Windows, when I try the command "GoHugo: Start Server", I seee the following error message in Console:

  ERR spawn C:\Windows\system32\cmd.exe ENOENT: Error: spawn C:\Windows\system32\cmd.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) 

The above error message occurs irrespective of whether I run the command for a Hugo site that's in a VSCode workspace (tech-notebook repo) or just by adding a folder to a VSCode Window (tested with "newhugo" reproduction case).

phoenisx commented 3 years ago

Thanks, @balaji-dutt for providing these details. Currently, I don't have access to any Windows system, thus it would be difficult to debug and figure out the error.

I will keep this issue open to be fixed later in some time. I will update once done. Apologies for the inconvenience caused till then!

balaji-dutt commented 3 years ago

Thanks, @balaji-dutt for providing these details. Currently, I don't have access to any Windows system, thus it would be difficult to debug and figure out the error.

I will keep this issue open to be fixed later in some time. I will update once done. Apologies for the inconvenience caused till then!

If you have the ability to run virtualization software in your development environment, it is possible to install Windows in a VM and use it for atleast 180 days without a license key.