Skip to content

Commit

Permalink
Merge pull request #7 from martymcguire/external-media
Browse files Browse the repository at this point in the history
Allow external media endpoint via config
  • Loading branch information
skpy authored Oct 17, 2018
2 parents ff1c761 + 29af067 commit d182246
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ $config = array(
# whether or not to copy uploaded files to the source /static/ directory.
'copy_uploads_to_source' => true,

# an external micropub media endpoint to use.
# 'media_endpoint' => 'https://example.com/my-media-endpoint/',

# an array of syndication targets; each of which should contain the
# necessary credentials.
'syndication' => array(
Expand Down
5 changes: 4 additions & 1 deletion inc/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ function show_config($show = 'all') {
}
}

$conf = array("media-endpoint" => $config['base_url'] . 'micropub/index.php');
$media_endpoint = isset($config['media_endpoint']) ?
$config['media_endpoint'] :
($config['base_url'] . 'micropub/index.php');
$conf = array("media-endpoint" => $media_endpoint);
if ( ! empty($syndicate_to) ) {
$conf['syndicate-to'] = $syndicate_to;
}
Expand Down

0 comments on commit d182246

Please sign in to comment.