Diffstat (limited to 'internal/b2')
| -rw-r--r-- | internal/b2/client.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/internal/b2/client.go b/internal/b2/client.go index fda79e0..d712736 100644 --- a/internal/b2/client.go +++ b/internal/b2/client.go @@ -33,11 +33,10 @@ func NewB2Client(cfg *config.B2Config) (*B2Client, error) { } type BlogPage struct { - Link string - FileName string - Lang string - ModifiedTime time.Time - Metadata *frontmatter.Metadata + Link string + FileName string + Lang string + Metadata *frontmatter.Metadata } func (c *B2Client) Scan(prefix string) ([]*BlogPage, error) { @@ -80,13 +79,9 @@ func (c *B2Client) Scan(prefix string) ([]*BlogPage, error) { tags := strings.Split(attrs.Info["tags"], ",") slices.Sort(tags) - lang, _ := strings.CutPrefix(linkParts[0], c.prefix) - filePaths = append(filePaths, &BlogPage{ - Link: obj.Name(), - FileName: fileName, - Lang: lang, - ModifiedTime: attrs.LastModified, + Link: obj.Name(), + FileName: fileName, Metadata: &frontmatter.Metadata{ Title: attrs.Info["title"], ShortDescription: attrs.Info["short-description"], |