docserver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedDoc

type CachedDoc struct {
	Doc      *markdown.Document
	ETag     string
	Modified time.Time
}

CachedDoc represents a cached document

type CachedIndex

type CachedIndex struct {
	Data     []byte
	ETag     string
	Modified time.Time
}

CachedIndex represents the cached document index

type DocServer

type DocServer struct {
	// contains filtered or unexported fields
}

DocServer handles markdown document requests

func NewDocServer

func NewDocServer(contentDir, fallbackURL string, indexLimit int) *DocServer

NewDocServer creates a new document server

func (*DocServer) GetIndexDocument added in v0.6.0

func (ds *DocServer) GetIndexDocument() (*markdown.Document, error)

GetIndexDocument returns the parsed index.md document, or nil if not found

func (*DocServer) GetIndexJSONLD

func (ds *DocServer) GetIndexJSONLD() ([]byte, error)

GetIndexJSONLD returns the JSON-LD index data without setting HTTP headers This is used for embedding JSON-LD in HTML pages

func (*DocServer) HandleDoc

func (ds *DocServer) HandleDoc(w http.ResponseWriter, r *http.Request, slug string)

HandleDoc handles GET /posts/:slug - render a single document

func (*DocServer) HandleDocJSONLD

func (ds *DocServer) HandleDocJSONLD(w http.ResponseWriter, r *http.Request, slug string)

HandleDocJSONLD handles GET /posts/:slug.jsonld - return JSON-LD only

func (*DocServer) HandleDocList

func (ds *DocServer) HandleDocList(w http.ResponseWriter, r *http.Request)

HandleDocList handles GET /posts - list all posts

func (*DocServer) HandleIndexJSONLD

func (ds *DocServer) HandleIndexJSONLD(w http.ResponseWriter, r *http.Request)

HandleIndexJSONLD handles GET /posts/index.jsonld - return collection index

func (*DocServer) HandleRSSList

func (ds *DocServer) HandleRSSList(w http.ResponseWriter, r *http.Request)

HandleRSSList handles GET /rss - return HTML page listing all available RSS feeds

func (*DocServer) HandleSearch added in v0.7.0

func (ds *DocServer) HandleSearch(w http.ResponseWriter, r *http.Request)

HandleSearch handles GET /search - client-side search page

func (*DocServer) HandleSiteRSS

func (ds *DocServer) HandleSiteRSS(w http.ResponseWriter, r *http.Request)

HandleSiteRSS handles GET /posts.rss - return RSS feed for all blog posts

func (*DocServer) HandleSitemap added in v0.7.0

func (ds *DocServer) HandleSitemap(w http.ResponseWriter, r *http.Request)

HandleSitemap handles GET /sitemap.xml - return XML sitemap for all pages

func (*DocServer) HandleTagPage added in v0.5.0

func (ds *DocServer) HandleTagPage(w http.ResponseWriter, r *http.Request, tag string)

HandleTagPage handles GET /tags/{tag} - show posts with a specific tag

func (*DocServer) HandleTagsPage added in v0.5.0

func (ds *DocServer) HandleTagsPage(w http.ResponseWriter, r *http.Request)

HandleTagsPage handles GET /tags - display word cloud of all tags

func (*DocServer) HandleUserRSS

func (ds *DocServer) HandleUserRSS(w http.ResponseWriter, r *http.Request, userName string)

HandleUserRSS handles GET /u/{user}/posts.rss - return RSS feed for user's blog posts

type DocumentCache

type DocumentCache struct {
	// contains filtered or unexported fields
}

DocumentCache caches rendered documents

type TagInfo added in v0.5.0

type TagInfo struct {
	Tag   string
	Count int
}

TagInfo represents a tag with its frequency

Jump to

Keyboard shortcuts

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