Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
songkg7 committed Jun 27, 2024
1 parent 708f1ce commit 76878d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/docusaurus/docusaurus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import fs from 'fs';
import path from 'path';
import { Notice } from 'obsidian';
import { O2PluginSettings } from '../settings';
import DocusaurusSettings from './settings/DocusaurusSettings';

const PREFIX = 'o2-temp.';

export const convertToDocusaurus = async (plugin: O2Plugin) => {
// get file name in ready folder
const markdownFiles = await copyMarkdownFile(plugin);
// TODO: prepare path related to docusaurus date extraction type
// e.g. directory candidates that should be created have to refer to date extraction type.

for (const file of markdownFiles) {
const contents: Contents = await plugin.app.vault.read(file);
const result = convertDateFrontMatter(true,
Expand Down Expand Up @@ -59,8 +63,6 @@ const cleanUp = (plugin: O2Plugin) => {
const moveFiles = async (plugin: O2Plugin, settings: O2PluginSettings) => {
const sourceFolderPath = `${(vaultAbsolutePath(plugin))}/${settings.readyFolder}`;
const targetFolderPath = settings.targetPath();
// refer to date extraction type


// only temp files
fs.readdir(sourceFolderPath, (err, files) => {
Expand Down
2 changes: 1 addition & 1 deletion src/docusaurus/settings/DocusaurusSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class DocusaurusSettings implements O2PluginSettings {
backupFolder: string;
docusaurusPath: string;
isAutoCreateFolder: boolean;
dateExtractionPattern: string;
public dateExtractionPattern: string;

targetPath(): string {
return `${this.docusaurusPath}/blog`;
Expand Down

0 comments on commit 76878d0

Please sign in to comment.