Documentation
¶
Index ¶
- func GoogleAnalyticsTag(id string) string
- func SEOMetaTags(pageType, title, description, canonicalURL, image, siteName string, ...) string
- type CachedDoc
- type CachedIndex
- type DocServer
- func (ds *DocServer) GetFaviconPath() string
- func (ds *DocServer) GetIndexDocument() (*markdown.Document, error)
- func (ds *DocServer) GetIndexJSONLD() ([]byte, error)
- func (ds *DocServer) HandleContentAsset(w http.ResponseWriter, r *http.Request, filename string)
- func (ds *DocServer) HandleDoc(w http.ResponseWriter, r *http.Request, slug string)
- func (ds *DocServer) HandleDocJSONLD(w http.ResponseWriter, r *http.Request, slug string)
- func (ds *DocServer) HandleDocList(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleFavicon(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleIndexJSONLD(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleRSSList(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleSearch(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleSiteRSS(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleSitemap(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleTagPage(w http.ResponseWriter, r *http.Request, tag string)
- func (ds *DocServer) HandleTagsPage(w http.ResponseWriter, r *http.Request)
- func (ds *DocServer) HandleUserRSS(w http.ResponseWriter, r *http.Request, userName string)
- type DocumentCache
- type TagInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoogleAnalyticsTag ¶
GoogleAnalyticsTag returns the Google Analytics tracking code for the given ID. Returns empty string if id is empty.
func SEOMetaTags ¶ added in v0.9.3
func SEOMetaTags(pageType, title, description, canonicalURL, image, siteName string, publishedTime, modifiedTime string, videoURL ...string) string
SEOMetaTags generates meta description, Open Graph, Twitter Card, and canonical URL tags. pageType should be "article" for posts or "website" for index/listing pages. videoURL is optional; when non-empty, og:video tags are included.
Types ¶
type CachedIndex ¶
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, googleAnalyticsID, fediHandle string) *DocServer
NewDocServer creates a new document server fediHandle is optional - if provided, adds a "Follow on Mastodon" button (e.g., "@user@domain.com")
func (*DocServer) GetFaviconPath ¶
GetFaviconPath returns the path to favicon if one exists, empty string otherwise
func (*DocServer) GetIndexDocument ¶
GetIndexDocument returns the parsed index.md document, or nil if not found
func (*DocServer) GetIndexJSONLD ¶
GetIndexJSONLD returns the JSON-LD index data without setting HTTP headers This is used for embedding JSON-LD in HTML pages
func (*DocServer) HandleContentAsset ¶
HandleContentAsset serves static assets (images) from the content directory
func (*DocServer) HandleDocJSONLD ¶
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 with pagination
func (*DocServer) HandleFavicon ¶
func (ds *DocServer) HandleFavicon(w http.ResponseWriter, r *http.Request)
HandleFavicon serves favicon from content directory Looks for favicon.ico, favicon.png, or favicon.svg in content parent directory
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 ¶
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 ¶
func (ds *DocServer) HandleSitemap(w http.ResponseWriter, r *http.Request)
HandleSitemap handles GET /sitemap.xml - return XML sitemap for all pages
func (*DocServer) HandleTagPage ¶
HandleTagPage handles GET /tags/{tag} - show posts with a specific tag
func (*DocServer) HandleTagsPage ¶
func (ds *DocServer) HandleTagsPage(w http.ResponseWriter, r *http.Request)
HandleTagsPage handles GET /tags - display word cloud of all tags
func (*DocServer) HandleUserRSS ¶
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