mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 13:36:22 +05:30
Local lables in themes, comments functions improvements.
This commit is contained in:
parent
008ab9e11a
commit
8f1d51764b
5 changed files with 35 additions and 12 deletions
|
|
@ -2025,6 +2025,13 @@ function delete_comments($mdfile) {
|
|||
// regardless if file is content .md file or comments .json file
|
||||
function get_url_from_file($file)
|
||||
{
|
||||
// Ensure config is loaded - if not loads it
|
||||
$config_loaded = config('permalink.type');
|
||||
if (!$config_loaded) {
|
||||
if (file_exists('config/config.ini')) {
|
||||
config('source', 'config/config.ini');
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize path separators (Windows/Linux))
|
||||
$file = str_replace('\\', '/', $file);
|
||||
|
|
@ -2096,9 +2103,6 @@ function get_url_from_file($file)
|
|||
// return site_url() . $slug;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Check if it's a blog post: {username}/blog/{category}/{type}/[scheduled/]{date}_{tags}_{slug}.md
|
||||
if (count($parts) >= 5 && $parts[1] == 'blog') {
|
||||
$filename_parts = explode('_', pathinfo($basename, PATHINFO_FILENAME));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue