Skip to content

Commit

Permalink
Ready to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
edgrosvenor committed May 25, 2024
1 parent adb7350 commit f442aff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/EmbeddedMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ public function make(string $path)
]);

$this->uri = implode('/', [
str_replace(public_path(), '', $this->config['media_path']),
str_replace(public_path(), '', rtrim($this->config['media_path'], '/')),
$path,
]);

dump($this->path, $this->uri);

throw_if(!file_exists($this->source_path), "{$this->source_path} does not exist");


Expand Down
8 changes: 3 additions & 5 deletions src/ObsidianConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ public function __construct(array $configuration)
{
// Calculate the full path to the Obsidian configuration folder
$configuration_path = data_get($configuration, 'obsidian_config');
if (! str_starts_with($configuration_path, base_path())) {
$configuration_path = base_path($configuration_path);
}


$config = [
'app' => json_decode(file_get_contents(implode('/', [$configuration_path, 'app.json'])), true),
'appearance' => json_decode(file_get_contents(implode('/', [$configuration_path, 'appearance.json'])), true),
];

$this->attachment_path = implode('/', [
$this->attachment_path = implode('/', array_filter([
data_get($configuration, 'md_path'),
str_replace('./', '', data_get($config, 'app.attachmentFolderPath')),
]);
]));

$this->css = implode('/', [
$configuration_path,
Expand Down

0 comments on commit f442aff

Please sign in to comment.