mkusz / mkdocs-publisher

Publisher for MkDocs - a set of plugins for content creators
https://mkusz.github.io/mkdocs-publisher/
MIT License
44 stars 1 forks source link

mkdocs build slug error #81

Closed canu0205 closed 1 week ago

canu0205 commented 1 week ago

Bug description

When i build my site w/ mkdocs build i got problem w/ url path of my blog contents.

Below is part of my mkdocs.yml.

site_name: chris park

copyright: >
  © 2024 Chanwoo Chris Park

docs_dir: "docs"
site_dir: "site"

use_directory_urls: true

plugins:
  - pub-debugger:
      console_log:
        enabled: true
  - search
  - pub-blog:
      blog_dir: 02_blog
  - pub-obsidian
  - pub-social
  - pub-meta

And this is my blog directory.

Screenshot 2024-07-04 at 6 17 23 PM

I think i setup what official docs of mkdocs-publisher suggest, but there's a problem. Below is error msg.

❯ mkdocs build
INFO    -  DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects
           to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
             File "/Users/chanwoopark/Library/Mobile
           Documents/iCloud~md~obsidian/Documents/Public/.venv/lib/python3.12/site-packages/mkdocs_publisher/debugger/plugin.py", line 60, in
           __init__
               self._mkdocs_log_file_handler: loggers.DatedFileHandler = loggers.DatedFileHandler(
             File "/Users/chanwoopark/Library/Mobile
           Documents/iCloud~md~obsidian/Documents/Public/.venv/lib/python3.12/site-packages/mkdocs_publisher/debugger/loggers.py", line 50, in
           __init__
               dated_filename = datetime.utcnow().strftime(str(filename))
18:18:27.641 [INFO ] Read files and directories metadata [mkdocs.plugins.publisher.meta.plugin]
18:18:27.646 [INFO ] Ignored directories: ['.obsidian', '_templates'] [mkdocs.plugins.publisher.meta.plugin]
18:18:27.646 [INFO ] Draft files and directories: [] [mkdocs.plugins.publisher.meta.plugin]
18:18:27.646 [INFO ] Hidden files and directories: [] [mkdocs.plugins.publisher.meta.plugin]
18:18:27.662 [INFO ] Parsing blog posts from '02_blog' directory [mkdocs.plugins.publisher.blog.parsers]
18:18:27.663 [INFO ] Creating blog posts index files [mkdocs.plugins.publisher.blog.creators]
18:18:27.673 [INFO ] Reorder blog posts from newest to oldest [mkdocs.plugins.publisher.blog.modifiers]
18:18:27.673 [INFO ] Cleaning site directory [mkdocs.commands.build]
18:18:27.689 [INFO ] Building documentation to directory: /Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/site [mkdocs.commands.build]
18:18:27.733 [INFO ] Removing blog posts pages and section from direct navigation [mkdocs.plugins.publisher.blog.modifiers]
18:18:27.734 [INFO ] Removing blog sub index pages from navigation menu [mkdocs.plugins.publisher.blog.modifiers]
18:18:27.734 [INFO ] Parsing backlinks [mkdocs.plugins.publisher.obsidian.plugin]
18:18:27.752 [ERROR] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs") [mkdocs.plugins.publisher._shared.links]
18:18:27.755 [ERROR] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs") [mkdocs.plugins.publisher._shared.links]
18:18:27.770 [ERROR] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs") [mkdocs.plugins.publisher._shared.links]
18:18:27.772 [ERROR] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs") [mkdocs.plugins.publisher._shared.links]
18:18:27.775 [ERROR] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs") [mkdocs.plugins.publisher._shared.links]
18:18:27.994 [INFO ] Documentation built in 0.35 seconds [mkdocs.commands.build]
18:18:28.7.0 [INFO ] Platform: macOS-14.5-arm64-arm-64bit [mkdocs.plugins.publisher.debug.plugin]
18:18:28.8.0 [INFO ] Python version: 3.12.2 (using virtual environment: true) [mkdocs.plugins.publisher.debug.plugin]
18:18:28.8.0 [INFO ] Build log file: /Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/20240704_091827_mkdocs_build.log [mkdocs.plugins.publisher.debug.plugin]
18:18:28.289 [INFO ] Debugger ZIP file: 20240704_091827_mkdocs_debug.zip [mkdocs.plugins.publisher.debug.plugin]

I rly don't have idea what's wrong w/ my blog.. can someone help me save up ma time?

Expected behaviour

When i hit title of a blog post, it should be directed to "https://canu0205.github.io/public-canu-blog/blog/welcome2", but it didn't. And also, when i hit "Read more", it directed to "https://canu0205.github.io/public-canu-blog/index-0/Noneblog/welcome2/" which is not exist. When i use mkdocs serve in my local environment, it directed to the path "http://127.0.0.1:8000/blog/welcome2/".

I have no idea Noneblog came from.

Screenshot 2024-07-04 at 6 20 43 PM

Reproduction steps

No response

Operating system

macOS

Python version

3.12

Link to git repository

https://github.com/canu0205/public-canu-blog

Log output

[1720079115.382][INFO ][mkdocs_publisher/meta/plugin.py:71] Read files and directories metadata
[1720079115.386][INFO ][mkdocs_publisher/meta/plugin.py:86] Ignored directories: ['.obsidian', '_templates']
[1720079115.386][INFO ][mkdocs_publisher/meta/plugin.py:90] Draft files and directories: []
[1720079115.386][INFO ][mkdocs_publisher/meta/plugin.py:91] Hidden files and directories: []
[1720079115.404][INFO ][mkdocs_publisher/blog/parsers.py:77] Parsing blog posts from '02_blog' directory
[1720079115.405][INFO ][mkdocs_publisher/blog/creators.py:68] Creating blog posts index files
[1720079115.417][INFO ][mkdocs_publisher/blog/modifiers.py:42] Reorder blog posts from newest to oldest
[1720079115.417][INFO ][mkdocs/commands/build.py:271] Cleaning site directory
[1720079115.429][INFO ][mkdocs/commands/build.py:281] Building documentation to directory: /Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/site
[1720079115.473][INFO ][mkdocs_publisher/blog/modifiers.py:56] Removing blog posts pages and section from direct navigation
[1720079115.473][INFO ][mkdocs_publisher/blog/modifiers.py:60] Removing blog sub index pages from navigation menu
[1720079115.474][INFO ][mkdocs_publisher/obsidian/plugin.py:98] Parsing backlinks
[1720079115.490][ERROR][mkdocs_publisher/_shared/links.py:90] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs")
[1720079115.492][ERROR][mkdocs_publisher/_shared/links.py:90] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs")
[1720079115.504][ERROR][mkdocs_publisher/_shared/links.py:90] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs")
[1720079115.507][ERROR][mkdocs_publisher/_shared/links.py:90] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs")
[1720079115.509][ERROR][mkdocs_publisher/_shared/links.py:90] File: "Noneblog/start" doesn't exists (from: "/Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/docs")
[1720079115.738][INFO ][mkdocs/commands/build.py:353] Documentation built in 0.36 seconds
[1720079115.778][INFO ][mkdocs_publisher/debugger/plugin.py:113] Platform: macOS-14.5-arm64-arm-64bit
[1720079115.778][INFO ][mkdocs_publisher/debugger/plugin.py:114] Python version: 3.12.2 (using virtual environment: true)
[1720079115.778][INFO ][mkdocs_publisher/debugger/plugin.py:118] Build log file: /Users/chanwoopark/Library/Mobile Documents/iCloud~md~obsidian/Documents/Public/20240704_074515_mkdocs_build.log
[1720079116.075][INFO ][mkdocs_publisher/debugger/plugin.py:151] Debugger ZIP file: 20240704_074515_mkdocs_debug.zip


### Contact details

chancold123@gmail.com
mkusz commented 1 week ago

Hi @canu0205,

Thanks for this report. It seems that I have added some not needed problem into the code of blog creation. I'm planning to rewrite a blog engine in one of the next releases (probably v1.5 or some further one). As an temporary workaround please add a full url of your documentation to you mkdocs.yml file like this: site_url: https://canu0205.github.io/public-canu-blog/.

canu0205 commented 1 week ago

Oh thx for ur support! Btw, I rly enjoy ur plugin:)