gethyas / doks

Everything you need to build a stellar documentation website. Fast, accessible, and easy to use.
https://getdoks.org
MIT License
1.99k stars 352 forks source link

Images in assets folder are not present in public or resources after build #1213

Closed dario-genga closed 2 months ago

dario-genga commented 3 months ago

Description

The images added in the folder assets/ are not mounted in the public/ or resources folder after a npm run build, with the exception of the favicon who is the only image present after a build or run.

Steps to reproduce

  1. Create a new project npm create hyas@latest -- --template doks
  2. Go to the folder created and run npm install
  3. Add an image in the assets/images folder with a name like my_image.jpg.
  4. Execute npm run build
  5. Search the image in the generated folders (public/ and resources)

Expected result

You should be able to find the image in the generated folder after a build.

Actual result

The image is missing.

Environment

> hyas-project@0.0.0 preinfo
> npm version

{
  'hyas-project': '0.0.0',
  npm: '10.5.0',
  node: '21.1.0',
  acorn: '8.10.0',
  ada: '2.7.2',
  ares: '1.20.1',
  base64: '0.5.0',
  brotli: '1.0.9',
  cjs_module_lexer: '1.2.2',
  cldr: '43.1',
  icu: '73.2',
  llhttp: '9.1.2',
  modules: '120',
  napi: '9',
  nghttp2: '1.57.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.10+quic',
  simdutf: '3.2.18',
  tz: '2023c',
  undici: '5.26.4',
  unicode: '15.0',
  uv: '1.46.0',
  uvwasi: '0.0.19',
  v8: '11.8.172.15-node.14',
  zlib: '1.2.13.1-motley'
}

> hyas-project@0.0.0 info
> npm list

hyas-project@0.0.0 /home/dario/Documents/gogs/test/hyas-project
├── @hyas/doks-core@1.4.1
├── @hyas/images@3.1.0
├── @hyas/inline-svg@1.0.5
├── @hyas/seo@2.2.0
├── @tabler/icons@2.47.0
├── exec-bin@1.0.0
├── gethyas@2.2.2
├── hugo-installer@4.0.1
└── shx@0.3.4

> hyas-project@0.0.0 postinfo
> exec-bin node_modules/.bin/hugo/hugo version

hugo v0.123.7-312735366b20d64bd61bff8627f593749f86c964+extended linux/amd64 BuildDate=2024-03-01T16:16:06Z VendorInfo=gohugoio
h-enk commented 3 months ago

You'll need to reference (use) the image for it to be processed — and be copied over to public

For example:

![Alt text](images/dylan-shaw-XNOGg2MsGpk-unsplash.jpg)

Snag_210211c

public directory:

├── images
│   └── dylan-shaw-XNOGg2MsGpk-unsplash_hu05e9368bbbdd4df7268c6b3177992462_682799_2400x1600_resize_q85_h2_lan

See also: https://images.gethyas.com/