A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

28 rader
627 B

  1. /*
  2. * Copyright © 2018 A Bunch Tell LLC.
  3. *
  4. * This file is part of WriteFreely.
  5. *
  6. * WriteFreely is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License, included
  8. * in the LICENSE file in this source code package.
  9. */
  10. package config
  11. import (
  12. "strings"
  13. )
  14. // FriendlyHost returns the app's Host sans any schema
  15. func (ac AppCfg) FriendlyHost() string {
  16. return ac.Host[strings.Index(ac.Host, "://")+len("://"):]
  17. }
  18. func (ac AppCfg) CanCreateBlogs(currentlyUsed uint64) bool {
  19. if ac.MaxBlogs <= 0 {
  20. return true
  21. }
  22. return int(currentlyUsed) < ac.MaxBlogs
  23. }