Skip to content

Only keep "single" on type post or change template json to add "single-post" instead of single as key ? #124

Description

@snugglejuice

We discussed this in our previous dev meeting regarding how template-partshandles post types. Currently, default post template as "single" template key. As a result, the system fails to resolve this specific template and falls back incorrectly.

const type = `single-${node.__typename}`.toLowerCase();

Proposed Change:

const getTemplateData = async (node: any) => {
        const type = node.__typename === 'post' ? 'single' : `single-${node.__typename}`.toLowerCase();

	const { getData } = templatesDataList?.[type] ?? {};

	if (!getData) return {};

	return await getData(fetchAPI, node);
};
```

Metadata

Metadata

Labels

questionFurther information is requested

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions