Install and create with hugo

Hello,

I would like to create a site with hugo.
In the installation phase, I am stuck with an error message. Could you please help me?

Thanks in advance.

Here is the message:
Deltas resolution: 100% (1467/1467), done.
m9@m9-Lenovo-B50-50:~$ echo “theme = ‘ananke’” >> config.toml
m9@m9-Lenovo-B50-50:~$ hugo server
Error: add site dependencies: create deps: failed to create file caches from configuration: mkdir /tmp/hugo_cache/m9: permission denied
m9@m9-Lenovo-B50-50:~$ hugo new site quickstart
Error: /home/m9/quickstart already exists and is not empty. See --force.
)

There may be a couple of thing going on here. Let’s start with this…

From what you posted, it looks like you didn’t cd into the project directory (quickstart). If true, delete what you have created, and start over.

https://gohugo.io/getting-started/quick-start/#create-a-site

Thank you for your answer.

I deleted and reinstalled everything, but the same error comes back.
Uploading: 1.png…
Uploading: 2.png…

Your screenshots are broken (not upload completed).

Sorry

voici :slight_smile:

According to the error message, the configuration isn’t correct, duplicate keys are not allowed: theme.

Could you please check the configuration? I guess you’ve executed the echo "theme = 'ananke'" >> config.toml command twice on the same site.

$ cat config.toml | grep theme
theme = 'ananke'
theme = 'ananke'

If so, remove one of them and try again (hugo server).

I only copied the commands (Install and create with hugo - #6 by razon)
apparently, I still have the same message.

The quickstart folder already exists, so there are multiple theme keys inside the config file, since you performed the echo command multiple times on the same folder.

image

You can remove or rename the quickstart folder and try again. Or remove the duplicate theme keys from the config.toml file.

I am a beginner and do not understand everything.
Could you please correct what is wrong with this command? It will be easier for me.
Thanks in advance.

hugo new site quickstart
cd quickstart
git init
git submodule add GitHub - theNewDynamic/gohugo-theme-ananke: Ananke: A theme for Hugo Sites themes/ananke
echo “theme = ‘ananke’” >> config.toml
hugo server

In short, rename or remove the previous folder first, and then perform the commands you posted should work.

mv quickstart quickstart-bak

hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> config.toml
hugo server

Explanations:

You’re performing the same commands on the same folder multiple times, and the echo "theme = 'ananke'" >> config.toml appends the content at the end of the config file, so that there are multiple theme key inside the configuration, which is not allowed. You can fix it by one of following ways:

  • Rename or remove the previous folder.
  • Modify the config.toml to remove the duplicate theme keys.

Thanks, now it works!

The step to add content:
hugo new posts/my-first-post.md

How does it work?
Do I have to restart the terminal or access a special file?

j’ai compris la suite avec crtl +C

I understand the next with crtl +C

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.