Making Buttons On A Local Hugo Site To Edit The Files
`youtube: https://www.youtube.com/watch?v=l0k20Id3_iA`
I realized that doing streams is a lot like Rubber Duck Debugging
Also, I don't really use it for debugging, but instead of a duck, I have a Memento Mori.
Notes from the stream:
- Running PHP in MAMP, you can use this to launch a file in whatever editor it's defaulted to:
Code
shell_exec('open /path/to/file/index.md');
- Here's the stuff I tried that didn't work:
Code
;
;
;
;
;
;
;
;
;
;
;
### Links from the stream:
- https://exercism.io
- https://www.php.net/manual/en/reserved.variables.get.php
This is a great piece of code from stackify that setups up so you can send php messages to the console.
https://stackify.com/how-to-log-to-console-in-php/
Code
<?php
function console_log($output, $with_script_tags = true) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .
');';
if ($with_script_tags) {
$js_code = '<script>' . $js_code . '</script>';
}
echo $js_code;
}
- The final thing is that I ended up using parse-url instead of split based on feedback in chat. It's good stuff: https://www.php.net/manual/en/function.parse-url.php