layout.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package basics
  2. import (
  3. "github.com/qor5/docs/docsrc/generated"
  4. . "github.com/theplant/docgo"
  5. "github.com/theplant/docgo/ch"
  6. )
  7. var Layout = Doc(
  8. Markdown(`
  9. Presets comes with a built-in layout that works out of the box.
  10. And there are some ways to customzie the layout/theme.
  11. ## Theme
  12. Presets UI is based on [Vuetify](https://v2.vuetifyjs.com/en/), you can modify the Admin theme by configuring the [Vuetify options](https://v2.vuetifyjs.com/en/features/presets/#default-preset)
  13. `),
  14. ch.Code(generated.CustomizeVuetifyOptions).Language("go"),
  15. Markdown(`
  16. ## Assets
  17. If you need third-party front-end libraries to achieve some functions,
  18. you can inject them via the *ExtraAsset* method, and they will be automatically served.
  19. `),
  20. ch.Code(generated.InjectAssetViaExtraAsset).Language("go"),
  21. Markdown(`
  22. you can also call Injector in AssetFunc to add meta, add custom HTML in HEAD and TAIL.
  23. `),
  24. ch.Code(generated.InjectAssetViaAssetFunc).Language("go"),
  25. Markdown(`
  26. ## Layout
  27. You can change the entire layout via *LayoutFunc*. The default layout is https://github.com/qor5/admin/blob/1e97c0dd45615fb7593245575ab0fea4f98c58b3/presets/presets.go#L860-L969
  28. ### Layout Options
  29. We also provide some options to tweak the layout
  30. `),
  31. ch.Code(generated.ModelBuilderLayoutOptions).Language("go"),
  32. Markdown(`
  33. ### Plain Layout
  34. And We provide [PlainLayout](https://github.com/qor5/admin/blob/1e97c0dd45615fb7593245575ab0fea4f98c58b3/presets/presets.go#L972) which has no UI content except necessary assets.
  35. It will be helpful when there are some pages completely independent of Presets layout but still need to be consistent with the Presets theme.
  36. `),
  37. ).Slug("basics/layout").Title("Layout")