So I have the following structure:
hugo-site:
content-dir
config
archetype
themes
my-hugo-theme
site config for mounts:
mounts:
- source: content
target: content
# - source: node_modules
# target: assets
- source: assets
target: assets
- source: static
target: static
....
theme:
- my-hugo-theme
in my-hugo-theme
i have:
layouts
images
exampleSite
config
package.json
node_modules
assets
theme.yaml
theme.yaml
is at the moment only placeholders:
name : 'Theme name'
license : 'MIT'
licenselink : 'https://github.com/owner/repo/LICENSE'
description : 'Theme description'
# The home page of the theme, where the source can be found
homepage : 'https://github.com/owner/repo'
# If you have a running demo of the theme
demosite : 'https://owner.github.io/repo'
# Taxonomy terms
tags : ['blog', 'company']
features : ['some', 'awesome', 'features']
# If the theme has a single author
author:
name: 'Your name'
homepage: 'Your website'
the config is:
module:
mounts:
- source: node_modules
target: assets/vendor
so far.
I know how to mount the files, at least in theory BUT here is the thing.
I don’t really understand if I can use hugo-modules-mounts without using and initializing(?)
my theme as a module e.g. hugo mod init github.com/<your_user>/<your_project>
i only used:
hugo new theme my-hugo-theme --config "config.yaml"
My Problem and question
I want to mount the node_modules
folder to the assets
folder like in the docs.
But I cant really see that it worked. Neither the public build has the node_modules folder in it, or I can use the modules in my js files.
My idea was just using symlinks, but then I saw that the support was dropped a while a go.
So how do I do it ?
And are there any commands that give me some more information than hugo config mounts
?
Cause that command shows the mount of the theme.
What I want to achieve:
I want to use node_modules in my theme and give that then as a “theme” then to the main site.
So, can a theme use mounts and does hugo know of them when I am using them in a layout file ?
I still get errors and searched 3 hours to get my head around hugo modules but I just don’t get that work.
So thank you for your patience, and my tldr is:
- can a theme use mounts and does hugo know of them when I am using them in a layout file ?
- And are there any commands that give me some more information than
hugo config mounts
? - How do I mount the node_modules folder ?
- Do i need to do any more setup commands or config changes, that theme-mounts are possible ?
Best Regards and many thanks in advance,
Blackeye