presentation/views/methodology.view.ts

presentation/views/methodology.view.ts is a file in Bane's Lab Site. 52 lines of code and 4 definitions.

import { CREATIVE_COMMONS, METHODOLOGY_REPOSITORY, SITE_URL, pagePath } from "#core/assets/link.assets";
import {
    CREATIVE_COMMONS_LICENSE,
    METHODOLOGY_DESCRIPTION,
    METHODOLOGY_TITLE,
} from "#configuration/strings/page.strings";
import { mountTabSwitching, renderTabbedPage } from "#presentation/widgets/tab.widget";
import { AUTHOR } from "#configuration/constants/schema.constants";
import { METHODOLOGY_META } from "#configuration/strings/tab.strings";
import { METHODOLOGY_PAGE } from "#core/ids/page.ids";
import { METHODOLOGY_TABS } from "#core/generated/methodology.page.generated";
import { METHODOLOGY_TONE } from "#configuration/constants/tab.constants";
import type { PageDefinition } from "#types/page.types";
import type { SchemaEntity } from "#types/schema.types";
import type { TabbedPage } from "#types/tab.types";

const METHODOLOGY_ENTITY: SchemaEntity = {
    "@type": "CreativeWork",
    author: AUTHOR,
    description: METHODOLOGY_DESCRIPTION,
    license: CREATIVE_COMMONS,
    name: METHODOLOGY_META.title,
    sameAs: METHODOLOGY_REPOSITORY,
    url: SITE_URL + pagePath(METHODOLOGY_PAGE),
    version: METHODOLOGY_META.version,
};

const DEFINITION: TabbedPage = {
    layout: "chapter",
    meta: METHODOLOGY_META,
    page: METHODOLOGY_PAGE,
    tabs: METHODOLOGY_TABS,
    tone: METHODOLOGY_TONE,
};

const renderMethodology = function renderMethodology(): Element {
    return renderTabbedPage(DEFINITION);
};

void mountTabSwitching(DEFINITION);

export const PAGE: PageDefinition = {
    article: true,
    content: {
        kind: "tabbed",
        layout: DEFINITION.layout,
        meta: METHODOLOGY_META,
        tabs: METHODOLOGY_TABS,
        tone: DEFINITION.tone,
    },
    description: METHODOLOGY_DESCRIPTION,
    entities: [METHODOLOGY_ENTITY],
    id: METHODOLOGY_PAGE,
    license: CREATIVE_COMMONS_LICENSE,
    render: renderMethodology,
    title: METHODOLOGY_TITLE,
};