diff --git a/config/config.go b/config/config.go index f860c82..d00c185 100644 --- a/config/config.go +++ b/config/config.go @@ -54,23 +54,24 @@ type Config struct { Id string `toml:"id"` } -func (c Config) GetIcon() vocab.IRI { - // @todo return a media object, instead of an IRI +func (c Config) GetIcon() *vocab.Object { + var link = vocab.ObjectNew(vocab.ImageType) + link.URL = vocab.IRI(c.IconUrl) + // @todo figure out actual mime type + link.MediaType = vocab.MimeType("image/jpeg") - return vocab.IRI(c.IconUrl) + return link } -func (c Config) GetActor() vocab.Actor { - return vocab.Actor{ - // Id: - Name: vocab.NaturalLanguageValues{ - vocab.LangRefValue{ - Ref: "en", - Value: []byte(c.Name), - }, - }, - Icon: c.GetIcon(), - } +func (c Config) GetActor() *vocab.Actor { + var me = vocab.PersonNew(vocab.IRI(c.Id)) + me.Name = vocab.DefaultNaturalLanguageValue(c.Name) + me.Icon = c.GetIcon() + + // @todo parse markdown into html + me.Summary = vocab.DefaultNaturalLanguageValue(c.Summary) + + return me } var config Config