brand.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package basics
  2. import (
  3. "github.com/qor5/docs/docsrc/examples/e21_presents"
  4. "github.com/qor5/docs/docsrc/generated"
  5. "github.com/qor5/docs/docsrc/utils"
  6. . "github.com/theplant/docgo"
  7. "github.com/theplant/docgo/ch"
  8. )
  9. var Brand = Doc(
  10. Markdown(`
  11. Brand refers to the top area of the left menu bar, we provide two functions ~BrandTitle~ and ~BrandFunc~ to customize it.
  12. ## Simple customization
  13. If you want only to change the brand string, you can use ~BrandTitle~ to set the string, the string will be displayed in the brand area with ~<H1>~ tag.
  14. `),
  15. ch.Code(generated.BrandTitleSample).Language("go"),
  16. utils.Demo("Brand Title", e21_presents.PresetsBrandTitlePath+"/brands", "e21_presents/brand.go"),
  17. Markdown(`
  18. ## Full customization
  19. When you opt-in to full brand customization, you can use ~BrandFunc~ to be responsible for drawing for the entire brand area, such as you can put your own logo image in it.
  20. `),
  21. ch.Code(generated.BrandFuncSample).Language("go"),
  22. utils.Demo("Brand Func", e21_presents.PresetsBrandFuncPath+"/brands", "e21_presents/brand.go"),
  23. Markdown(`
  24. ## Profile
  25. Profile is below the brand area, where you can put the current user's information or others. We provide ~ProfileFunc~ to customize it.
  26. `),
  27. ch.Code(generated.ProfileSample).Language("go"),
  28. utils.Demo("Profile", e21_presents.PresetsProfilePath+"/brands", "e21_presents/profile.go"),
  29. ).Title("Brand").
  30. Slug("basics/brand")