jlelse
/
hugo-micropub
Archived
1
Fork 0

Add support for bookmark-of

This commit is contained in:
Jan-Lukas Else 2020-01-01 20:39:16 +01:00
parent 5ecada8f54
commit 102f555cbc
2 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,9 @@ func createEntryFromValueMap(values map[string][]string) (*Entry, error) {
if likeOf, ok := values["like-of"]; ok {
entry.likeLink = likeOf[0]
}
if bookmarkOf, ok := values["bookmark-of"]; ok {
entry.link = bookmarkOf[0]
}
if syndicate, ok := values["mp-syndicate-to"]; ok {
entry.syndicate = syndicate
} else if syndicates, ok := values["mp-syndicate-to[]"]; ok {
@ -144,6 +147,9 @@ func createEntryFromMicroformat(mfEntry *MicroformatItem) (*Entry, error) {
if len(mfEntry.Properties.LikeOf) == 1 {
entry.likeLink = mfEntry.Properties.LikeOf[0]
}
if len(mfEntry.Properties.BookmarkOf) == 1 {
entry.link = mfEntry.Properties.BookmarkOf[0]
}
if len(mfEntry.Properties.MpSyndicateTo) > 0 {
entry.syndicate = mfEntry.Properties.MpSyndicateTo
}

View File

@ -14,6 +14,7 @@ type MicroformatProperties struct {
Url []string `json:"url,omitempty"`
InReplyTo []string `json:"in-reply-to,omitempty"`
LikeOf []string `json:"like-of,omitempty"`
BookmarkOf []string `json:"bookmark-of,omitempty"`
MpSlug []string `json:"mp-slug,omitempty"`
MpSyndicateTo []string `json:"mp-syndicate-to,omitempty"`
}