UNPKG

@mdfriday/foundry

Version:

The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.

171 lines 5.58 kB
import { Page as ContentPage, PageGroups, PageIdentity, PageMeta, PageOutput, Pager, PageSource, Position } from '../../../domain/content'; import { LanguageService, Template } from '../type'; import { Site } from './site'; import { Publisher } from './publisher'; import { SitePager } from "./pager"; import { Scratch } from "../../../../pkg/maps/scratch"; /** * Site Page - TypeScript equivalent of Go's Page entity in domain/site/entity/page.go * This wraps the content layer's Page and provides site-specific functionality */ export declare class Page implements ContentPage, PageMeta { private tmplSvc; private langSvc; private publisher; private contentPage; private pageOutput; private site; private resources; private _paginator; constructor(tmplSvc: Template, langSvc: LanguageService, publisher: Publisher, contentPage: ContentPage, site: Site); /** * Process page resources */ processResources(pageSources: PageSource[]): Promise<void>; /** * Render the page - main entry point for page rendering */ render(): Promise<void>; getPageOutput(): PageOutput; /** * Render page content to HTML * TypeScript equivalent of renderPage method from Go */ renderPage(): Promise<void>; /** * Render and write page content to files * TypeScript equivalent of renderAndWritePage method from Go */ private renderAndWritePage; /** * Render page resources * TypeScript equivalent of renderResources method from Go */ renderResources(): Promise<void>; /** * Create formatted error with context * TypeScript equivalent of errorf method from Go */ private errorf; /** * Simple sprintf implementation */ private sprintf; /** * Clone the page * TypeScript equivalent of clone method from Go */ clone(): Page; pageIdentity(): PageIdentity; pageFile(): import("../../../domain/content").File; staleVersions(): number[]; section(): string; paths(): import("../../paths").Path; path(): string; file(): import("../../../domain/content").File; name(): string; title(): string; kind(): string; scratch(): Scratch; IsAncestor(other: Page): boolean; get Title(): string; get Section(): string; get LinkTitle(): string; get IsSection(): boolean; get IsPage(): boolean; get Content(): Promise<any>; get Description(): string; get Date(): Date; get RelPermalink(): string; get GitInfo(): {}; get File(): { BaseFileName: string; Dir: string; }; isHome(): boolean; isPage(): boolean; isSection(): boolean; isAncestor(other: ContentPage): boolean; eq(other: ContentPage): boolean; isBundled(): boolean; layouts(): string[]; output(): PageOutput; pageOutputs(): PageOutput[]; truncated(): boolean; parent(): ContentPage | null; pages(): Promise<import("../../../domain/content").Pages>; isStale(): boolean; clearStale(): void; prevInSection(): ContentPage | null; nextInSection(): ContentPage | null; sections(langIndex: number): import("../../../domain/content").Pages; regularPages(): Promise<import("../../../domain/content").Pages>; regularPagesRecursive(): import("../../../domain/content").Pages; terms(langIndex: number, taxonomy: string): Promise<import("../../../domain/content").Pages | null>; isTranslated(): boolean; translations(): import("../../../domain/content").Pages; rawContent(): string; description(): string; params(): Record<string, any>; pageWeight(): number; pageDate(): Date; publishDate(): Date; relatedKeywords(cfg: any): Promise<import("../../../domain/content").Keyword[]>; shouldList(global: boolean): boolean; shouldListAny(): boolean; noLink(): boolean; current(): Promise<Pager>; setCurrent(current: Pager): void; posOffset(offset: number): Promise<Position>; paginator(): Promise<Pager>; paginate(groups: PageGroups): Promise<Pager>; Summary(): Promise<string>; get Plain(): string; get TableOfContents(): string; get Params(): Record<string, any>; get Site(): Site; get Sites(): { First: Site; Default: Site; }; get Lastmod(): Date | null; get Sitemap(): { ChangeFreq: string; Priority: number; Filename: string; }; get IsTranslated(): boolean; Paginator(): Promise<SitePager | null>; setupCurrentPaginator(): Promise<void>; get Language(): { Lang: string; LanguageName: string; Title: string; Weight: number; }; get Permalink(): string; /** * Site page conversion - convert content pages to site pages * Equivalent to golang's func (p *Page) sitePages(ps contenthub.Pages) []*Page */ sitePages(ps: any): Page[]; /** * Convert single content page to site page * Equivalent to golang's func (p *Page) sitePage(cp contenthub.Page) (*Page, error) */ private sitePage; private pathJoin; private joinURL; get Translations(): Page[]; GetTerms(taxonomy: string): Promise<Page[]>; Pages(): Promise<Page[]>; get Page(): ContentPage; get Kind(): string; get Parent(): Page | null; /** * Get site pages method - following Go's Page.Pages() pattern * Equivalent to golang's func (p *Page) Pages() []*Page */ getSitePages(): Promise<Page[]>; } //# sourceMappingURL=page.d.ts.map