mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-05 16:33:04 +02:00
#449 - Show filename if the title is not set
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
- [#428](https://github.com/estruyf/vscode-front-matter/issues/428): Improved UX for inserting images to your content
|
||||
- [#430](https://github.com/estruyf/vscode-front-matter/issues/430): Support for HEXO its `post_asset_folder` setting (image location)
|
||||
- [#434](https://github.com/estruyf/vscode-front-matter/issues/434): Webview errors are logged in the extension output
|
||||
- [#449](https://github.com/estruyf/vscode-front-matter/issues/449): Show `filename` if the `title` is not set
|
||||
|
||||
### ⚡️ Optimizations
|
||||
|
||||
|
||||
@@ -126,8 +126,9 @@ export class PagesParser {
|
||||
*/
|
||||
public static async processPageContent(filePath: string, fileMtime: number, fileName: string, folderTitle: string): Promise<Page | undefined> {
|
||||
const article = await ArticleHelper.getFrontMatterByPath(filePath);
|
||||
const articleTitle = article?.data.title || fileName;
|
||||
|
||||
if (article?.data.title) {
|
||||
if (article?.data) {
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
const descriptionField = Settings.get(SETTING_SEO_DESCRIPTION_FIELD) as string || DefaultFields.Description;
|
||||
|
||||
@@ -139,7 +140,7 @@ export class PagesParser {
|
||||
|
||||
const staticFolder = Folders.getStaticFolderRelativePath();
|
||||
|
||||
let escapedTitle = article?.data.title;
|
||||
let escapedTitle = articleTitle;
|
||||
if (escapedTitle && typeof escapedTitle !== "string") {
|
||||
escapedTitle = "<invalid title>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user