Publish HTML quickly. https://html.house
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
679 B

  1. package htmlhouse
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. type (
  7. PublicHouse struct {
  8. ID string `json:"id"`
  9. Title string `json:"title"`
  10. URL string `json:"url"`
  11. thumbHost string `json:"-"`
  12. ThumbURL string `json:"thumb_url"`
  13. Created time.Time `json:"created"`
  14. Updated time.Time `json:"updated"`
  15. Views int `json:"views"`
  16. }
  17. HouseStats struct {
  18. ID string
  19. Stats []Stat
  20. }
  21. Stat struct {
  22. Data string
  23. Label string
  24. }
  25. )
  26. func (h *PublicHouse) process(app *app) {
  27. h.URL = fmt.Sprintf("%s/%s.html", app.cfg.HostName, h.ID)
  28. if h.ThumbURL != "" {
  29. h.ThumbURL = fmt.Sprintf("%s/%s", app.cfg.PreviewsHost, h.ThumbURL)
  30. }
  31. }