scan

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package scan reads blog post directories, parses frontmatter, and returns sorted post metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSummary

func ExtractSummary(body string) string

ExtractSummary finds the first non-empty paragraph after a heading line.

Parameters:

  • body: Post body text after frontmatter

Returns:

  • string: First paragraph text, or empty if none found

func ParsePost

func ParsePost(path, filename string) (core.BlogPost, core.PostStatus)

ParsePost reads a single blog post file and extracts metadata.

Parameters:

  • path: Absolute path to the blog post file
  • filename: Base filename of the blog post

Returns:

  • BlogPost: Parsed blog post metadata
  • PostStatus: Whether the post was included, skipped, or warned

func ScanBlogPosts

func ScanBlogPosts(blogDir string) ([]core.BlogPost, core.FeedReport, error)

ScanBlogPosts reads blog posts from blogDir, parses metadata, and returns them sorted by date descending.

Parameters:

  • blogDir: Path to the blog posts directory

Returns:

  • []BlogPost: Parsed blog posts sorted by date descending
  • FeedReport: Report of skipped and warned entries
  • error: Non-nil if directory access fails

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL