Commit b5f74654 authored by Jee's avatar Jee

auto rebuild site

parent 7cecb0ef
......@@ -49,7 +49,10 @@ return (object) array(
'defaultLoc' => 'London',
// Set Frontmatter Format -- json or yaml
'frontFormat' => 'json'
'frontFormat' => 'json',
// Hugo commande to rebuild the site
'hugoRebuildcmd' => '/usr/local/bin/hugo --quiet --config /var/www/mysite/config.toml -s /var/www/mysite/ -d /var/www/mysite/public'
);
?>
......@@ -261,6 +261,11 @@ function write_file($frontmatter, $content, $fn)
file_put_contents($fn, $content, FILE_APPEND | LOCK_EX);
}
function build_site()
{
exec( $configs->hugoRebuildcmd );
}
// This variable is used for the json_encode() functions later in the script.
// You can change these depending on your needs.
......@@ -713,6 +718,9 @@ if (!empty($data)) {
write_file($frontmatter, $content, $fn);
// Build the site
exec( $configs->hugoRebuildcmd );
// Some way of triggering Site Generator needs to go in here.
// ping! First one to micro.blog
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment