rss

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: 10 Imported by: 0

Documentation

Overview

Package rss generates Atom XML feeds from blog post metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atom

func Atom(posts []core.BlogPost, outPath, baseURL string) error

Atom builds the Atom XML and writes it to outPath.

Parameters:

  • posts: Blog posts to include in the feed
  • outPath: Output file path for the generated XML
  • baseURL: Base URL for entry links

Returns:

  • error: Non-nil if marshalling or writing fails

Types

type AtomAuthor

type AtomAuthor struct {
	Name string `xml:"name"`
}

AtomAuthor represents an author element in an Atom feed.

Fields:

  • Name: Author name

type AtomCategory

type AtomCategory struct {
	Term string `xml:"term,attr"`
}

AtomCategory represents a category element in an Atom feed.

Fields:

  • Term: Category term

type AtomEntry

type AtomEntry struct {
	Title      string         `xml:"title"`
	Links      []AtomLink     `xml:"link"`
	ID         string         `xml:"id"`
	Updated    string         `xml:"updated"`
	Summary    string         `xml:"summary,omitempty"`
	Author     *AtomAuthor    `xml:"author,omitempty"`
	Categories []AtomCategory `xml:"category,omitempty"`
}

AtomEntry represents a single entry in an Atom feed.

Fields:

  • Title: Entry title
  • Links: Entry links
  • ID: Unique entry identifier
  • Updated: Entry update timestamp
  • Summary: Optional entry summary
  • Author: Optional entry author
  • Categories: Optional entry categories

type AtomFeed

type AtomFeed struct {
	XMLName xml.Name    `xml:"feed"`
	NS      string      `xml:"xmlns,attr"`
	Title   string      `xml:"title"`
	Links   []AtomLink  `xml:"link"`
	ID      string      `xml:"id"`
	Updated string      `xml:"updated"`
	Entries []AtomEntry `xml:"entry"`
}

AtomFeed represents an Atom 1.0 feed document.

Fields:

  • XMLName: XML element name ("feed")
  • NS: Atom namespace URI
  • Title: Feed title
  • Links: Feed links (self and alternate)
  • ID: Unique feed identifier
  • Updated: Last update timestamp
  • Entries: Feed entries
type AtomLink struct {
	Href string `xml:"href,attr"`
	Rel  string `xml:"rel,attr,omitempty"`
}

AtomLink represents a link element in an Atom feed.

Fields:

  • Href: Link URL
  • Rel: Link relation type (e.g., "self", "alternate")

Jump to

Keyboard shortcuts

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