I also want to centralized my theme but I am getting this error :
Error: error building site: process: readAndProcessContent: “C:\RIA\centralization\example-site\content\en_index.md:5:1”: failed to extract shortcode: template for shortcode “blocks/cover” not found
Do anyone have any clue?
I have imported my theme using config.toml in module
Yes. Hugo cannot find the “blocks/cover” shortcode.
See Requesting Help.
Let us see your code
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Is there any proper document where I can find how to create a theme and push it to github then use the same theme in another project and installed the theme using this :
[module]
[[module.imports]]
path = “github/somerepo/sometheme”
theme=''sometheme"
in config.toml
this is my config.toml file in my site which is I am using theme
:
baseURL = ‘https://example.org/’
languageCode = ‘en-us’
title = ‘My New Hugo Site’
[module]
[[module.imports]]
path = “github.com/sometheme”
theme=‘themes/sometheme’
[[module.mounts]]
source = ‘sometheme/content’
target = ‘content’
[[module.mounts]]
source = ‘sometheme/static’
target = ‘static’
[[module.mounts]]
source = ‘sometheme/layouts’
target = ‘layouts’
[[module.mounts]]
source = ‘sometheme/data’
target = ‘data’
[[module.mounts]]
source = ‘sometheme/assets’
target = ‘assets’
[[module.mounts]]
source = ‘sometheme/i18n’
target = ‘i18n’
[[module.mounts]]
source = ‘sometheme/archetypes’
target = ‘archetypes’
It looks like you’re a Windows user, so make sure to use PowerShell when running the commands below. Do not use the Command Prompt. Do not use Windows PowerShell, which is an old implementation of PowerShell.
# create new site
hugo new site foo
# cd into new directory
cd foo
# initialize the site as a module
hugo mod init github.com/user/foo
# import the ananke theme as a module
echo "[[module.imports]]" >> hugo.toml
echo "path = 'github.com/theNewDynamic/gohugo-theme-ananke/v2'" >> hugo.toml
# add new content
hugo new content content/posts/my-first-post.md
# build and serve the site
hugo server -D
Take a look at the Ananke theme to see how it’s structured:
https://github.com/theNewDynamic/gohugo-theme-ananke
I have one more error :
Error: error building site: TOCSS: failed to transform “/scss/main.scss” (text/x-scss): “\modules\pkg\mod\github.com\google\docsy@v0.11.0\assets\scss\main.scss:11:1”: File to import not found or unreadable: …/vendor/Font-Awesome/scss/fontawesome.scss.
can you help me in this issue
This works fine:
# create new site
hugo new site foo
# cd into new directory
cd foo
# initialize the site as a module
hugo mod init github.com/user/foo
# automatically define a menu entry for each top-level section
echo "sectionPagesMenu = 'main'" >> hugo.toml
# import the docsy theme as a module
echo "[[module.imports]]" >> hugo.toml
echo "path = 'github.com/google/docsy'" >> hugo.toml
# add new content
hugo new content content/docs/my-first-doc-page.md
# build and serve the site
hugo server -D
Then visit http://localhost:1313/docs/my-first-doc-page/