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

Is full width still possible with Doks 1.0? #1091

Closed Yvand closed 9 months ago

Yvand commented 9 months ago

I'm upgrading my site to @hyas/doks-core 1.0.5. One thing I cannot do is to show my site with full width. This was introduced in https://github.com/h-enk/doks/pull/636

I tried to enable it in my config/_default/hugo.toml but it doesn't help:

[options]
  fullWidth = true

Am I doing something wrong?

Side note: your links in https://github.com/h-enk/doks/issues/new/choose are broken, so I had to open a blank issue.

h-enk commented 9 months ago

Thx. You're right — I will re-add this (soon)

h-enk commented 9 months ago

Fixed — see also @hyas/doks-core v1.0.6

  1. In your project directory, run npm i @hyas/doks-core@latest
  2. In config/_default/hyas/doks.toml set containerBreakpoint = "fluid"
  3. In config/_default/params.yml add mainSections: [docs]
Yvand commented 9 months ago

Thank you, I tested and it works, but not as in previous Doks versions: The width of the text in the middle column did not increase.

To illustrate, here is a screenshot before setting this config: image

After applying this config: image

My goal for the full width is that the extra space benefits mostly to the text in the middle column, similar to here (which still uses Doks 0.5.0). Can I apply a config to do this?

h-enk commented 9 months ago

Not a config setting (yet), but you can override the fixed width in your _custom.scss:

.container-fw {
  // max-width: 1200px;
  max-width: 100%;

  .docs-toc {
    margin-left: 3rem;
  }
}
Yvand commented 9 months ago

Ok, I created assets/scss/_custom.scss copied your content inside, deleted dir resources/_gen/assets/scss, ran npm run dev but it has no effect, I guess my scss is just not used. Do I need to reference my new _custom.scss somewhere? Sorry if I ask dumb questions, my knowledge on Hugo / UI design is very low

h-enk commented 9 months ago

In config/_default/module.toml make sure you have:



[[mounts]]
  source = "node_modules/@hyas/doks-core/assets"
  target = "assets"
  excludeFiles = "scss/common/_custom.scss"
h-enk commented 9 months ago

And assets/scss/_custom.scss s/b assets/scss/common/_custom.scss

Yvand commented 9 months ago

Hmm, still no luck, I think I do not understand correctly your last message. I will try again later, FYI I made all the changes in this commit, maybe you can see quickly my mistake.

h-enk commented 9 months ago

You've placed your _custom.scss in assets/scss/

But you should place it in assets/scss/common/ to be picked up

h-enk commented 9 months ago

Also, in your package.json bump "@hyas/doks-core": "^1.0.6" to "@hyas/doks-core": "^1.0.7"

Yvand commented 9 months ago

Yes it uses it successfully now ! Thank you !