Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print does no longer work #451

Closed
laszewsk opened this issue Feb 16, 2021 · 8 comments
Closed

print does no longer work #451

laszewsk opened this issue Feb 16, 2021 · 8 comments

Comments

@laszewsk
Copy link

I just created a new docsy site from the template.
I switched it to the main branch
I changed the toml file to include the main branch

However I get now the error on the vanilla templete with no modifications.

When I however out comment the print in the toml file it works

Here the error

hugo serve
Building sites … ERROR 2021/02/16 15:46:44 render of "section" failed: execute of template failed: template: blog/section.print.html:2:3: executing "main" at <partial "print/render" .>: error calling partial: execute of template failed: template: partials/print/render.html:10:4: executing "recurse-toc" at <partial "print/toc-li.html" (dict "sid" $sid "Page" .)>: error calling partial: ".... /themes/docsy/layouts/partials/print/toc-li.html:3:5": execute of template failed: template: partials/print/toc-li.html:3:5: executing "partials/print/toc-li.html" at <partial $tpl .>: error calling partial: partial "/print/toc-li-blog.html" not found

@gwatts
Copy link
Contributor

gwatts commented Feb 17, 2021

I can't reproduce the issue atm; i'm probably missing a step - Here's what I did (per the docs)

$ git clone https://github.com/google/docsy-example.git
...
$  cd docsy-example
$ git checkout -b main

I then changed config.toml and set github_branch= "main"

$  hugo server

Print works for me with that setup; can you tell me if you're doing something different?

@laszewsk
Copy link
Author

In addition, I need to set the baseURL from / to my github repo as it is not run on SITENAME.github.io but SITENAME.github.io/reponame

@laszewsk
Copy link
Author

Also I do use the template copy into github, and than do the recursive checkout on depth 1 as documented in the user manual.

@laszewsk
Copy link
Author

Here is my script following your setup description:

#
# carefull erases docsy-example to start new
#
hugo version
rm -rf docsy-example
git clone https://github.com/google/docsy-example.git
cd docsy-example
git checkout -b main
mv config.toml config.toml-orig
sed  's/# github_branch/github_branch/g' config.toml-orig > config.toml
diff config.toml-orig config.toml
npm install    # i added this 
hugo serve

the output I get is

Hugo Static Site Generator v0.79.0/extended darwin/amd64 BuildDate: unknown
Cloning into 'docsy-example'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1253 (delta 1), reused 3 (delta 0), pack-reused 1247
Receiving objects: 100% (1253/1253), 2.50 MiB | 4.79 MiB/s, done.
Resolving deltas: 100% (626/626), done.
Switched to a new branch 'main'
128c128
< # github_branch= "main"
---
> github_branch= "main"

added 117 packages, and audited 118 packages in 1s

found 0 vulnerabilities
Error: from config: failed to resolve output format "print" from site config

@laszewsk
Copy link
Author

I just confirmed the following works. I am not sure why it did not work earlier today.

carefull erases docsy-example to start new

hugo version
rm -rf docsy-example
git clone --recurse-submodules --depth 1 https://github.com/google/docsy-example.git
cd docsy-example
git checkout -b main
mv config.toml config.toml-orig
sed 's/# github_branch/github_branch/g' config.toml-orig > config.toml
diff config.toml-orig config.toml
hugo serve

@Nitinbabariya
Copy link

I just confirmed the following works. I am not sure why it did not work earlier today.

carefull erases docsy-example to start new

hugo version
rm -rf docsy-example
git clone --recurse-submodules --depth 1 https://github.com/google/docsy-example.git
cd docsy-example
git checkout -b main
mv config.toml config.toml-orig
sed 's/# github_branch/github_branch/g' config.toml-orig > config.toml
diff config.toml-orig config.toml
hugo serve

Thanks for sharing these commands @laszewsk, it helped me as well.

@jonesnc
Copy link

jonesnc commented Nov 12, 2021

Thanks @laszewsk! I was getting this error as well. I think my issue was that I did a plain git clone of the docsy-example repo, rather than doing the git clone --recurse-submodules --depth 1 version of the command you provided.

@laszewsk
Copy link
Author

laszewsk commented Feb 4, 2022

On ubuntu 20.04 you also need to update

nodejs, i used v 16.x as v 10.x did not work for me

cd ~
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt -y install nodejs
node -v

the i did in the hugo dir

npm install -D autoprefixer
npm install -D postcss-cli
npm install -D postcss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants