roger pence

Potentially, each day is crucial in the total development

Search
Advanced Search
Folder to search:
Limit search to one of these properties:

    Creating site objects from markdown

    flowchart TB linkStyle default stroke:#ff3,stroke-width:4px,color:white,background-color:gray %% Colors classDef blue fill:#2374f7,color:white,stroke:white classDef green fill:green,color:white,stroke:white classDef darkblue fill:#151B54,color:white,stroke:white classDef redbrown fill:#622F22,color:white,stroke:white classDef purple fill:#800080,color:white,stroke:white %% Clickable links %% click markdown_objects markdown_files[(1.<br>MD files)]:::green --> create_md_objects([create-markdown-objects.ts]) --> |Core objects| markdown_objects[(2a.<br>posts-markdown-objects.ts)]:::blue markdown_objects --> create-spanish-markdown-objects([create-spanish-markdown-objects.ts]) --> |Add Spanish objects|markdown_objects_updated[(2b.<br>posts-markdown-objects.ts)]:::blue page_markdown_updates[(4.<br>page-meta-data.ts)]:::purple --> create_index_objects markdown_objects_updated --> create_tag_objects([create-tag-objects.ts]) --> |Shows tag counts| tag_objects[(3.<br>posts-tag-objects.ts)]:::darkblue markdown_objects_updated --> create_index_objects([create-index-objects.ts]) --> |Input to search engine| index_objects[(5.<br>posts-index-objects.ts)]:::redbrown click markdown_objects "/posts/markdown-post-object" "Click"

    1. Markdown files

    Posts are stored as markdown files in several directories under the markdown directory. The number and name of the children directories varies from app to app. The markdown files across all of the children directories share the same frontmatter schema.

    These markdown files create the "post" content for the site. Post content is the dynamic, article-centric content of the site. Knowledge base articles and case studies are examples of posts.

    "Page" content is the more static content for the foundational site sections (ie, product and services information). Page content is not made with markdown files.

    .
    └── src
        └── lib
            └── markdown
                ├── about
                ├── blog
                └── contact me
    

    For single-language sites, the markdown files hvae an .md exension. For multi-language sites, the extension will be the locale specifier and .md. For example, English documents have an .em.md extension and Spanish documemts jvae .es.md extension. Generally, English is the base language for a site and there must be a en.md markdown fo

    2a. A Json representation of the markdown

    The create-markdown-objects.ts file reads all of the markdown files present under the markdown folder and creates an array of Json objects from their frontmatter and content. This frontmatter schema is type-checked (via a Zod object) and files with invalid frontmatter are flagged during this process.