lyz-code / mkdocs-newsletter

Automatically create newsletters from the changes in a mkdocs repository
https://lyz-code.github.io/mkdocs-newsletter
GNU General Public License v3.0
31 stars 3 forks source link

Commits not showing in the NewsLetter Section #93

Closed JamesRivers closed 2 years ago

JamesRivers commented 2 years ago

Question

First of all - thanks for a great plugin. Love it!

Question, I have committed with message in the format feat(article name): article reviewing straight and pre-multiplied- but nothing is listed in the RSS feed (daily) nor am I seeing listings in the Newsletter section.

mkdocs.yml has the following(ignore my rnu):

1 markdown_extensions:
2   - toc:
3       baselevel: 2

&

19 plugins:
18     - search: {}
17     - encryptcontent:
16         global_password: '######'
15         remember_password: True
14         default_expire_dalay: 12
13         password_button: True
12         password_button_text: 'login'
11     - git-revision-date-localized:
10       type: timeago
 9     - autolinks
 8     - section-index
 7     - mkdocs-newsletter

GitHub actions hold:

name: mkdocs_publish
1 on:
2   push:
3     branches:
4       - main
5 jobs:
6   deploy:
7     runs-on: ubuntu-latest
8     steps:
9       - uses: actions/checkout@v2
10       - uses: actions/setup-python@v2
11         with:
12           python-version: 3.x
13       - run: pip install \
14               mkdocs-material \
15               mkdocs-encryptcontent-plugin \
16               mkdocs-newsletter \
17               mkdocs-git-revision-date-localized-plugin \
18               mkdocs-autolinks-plugin \
19               mkdocs-section-index \
 20       - run: mkdocs gh-deploy --force

Action passes with no failures...

What have I missed, 2nd question related, does the article name - feat(article name): article reviewing straight and pre-multiplied'- need to be the relative path from docs folder or will any name suffice here there is no link to actual md file?

lyz-code commented 2 years ago

Hi @JamesRivers, thanks for taking the time to open an issue. I have many doubts about your setup, if you could show me the git repository of your documentation that would speed a lot the debugging. If you can't, can you share your whole mkdocs.yml file?

Let's go step by step, before debugging if it's a CI issue, have you tried building the site locally after you did the commit? if you run mkdocs serve and access localhost:5000 you should see the newsletters, or if it fails, you may have an error traceback to share here.

Just to make sure, do you have a nav section in the mkdocs.yml? mkdocs-newsletter won't work without one.

Regarding your second question, the article name part of the commit message is in fact the key to make the links in the newsletters, you don't need to specify the full path, just the name of the file where you made the change without the .md(we assume they are unique!), to get more information you can check the Commit message guidelines section of the documentation, if you already read it and you still didn't get that clear, I'll be glad if you helped me reformulate it so that it would be clearer to you either through a pull request or through a comment here. Here is one of my commits in case it helps you understand better the syntax.

Finally, I'm not familiar with the mkdocs gh-deploy --force command, so I'm not sure what's it doing, if you want to see a working CI you can look at my site workflow.

So if it's fine for you, let's first try to see the newsletters locally and then we can debug the CI.

I'm glad you liked the plugin! :)

JamesRivers commented 2 years ago

@lyz-code apologies for the delay, had some time off.

I did run through a local mkdocs serve and tested.... So I can be clear as to what is an issue here.

  1. Yes mkdocs.yml has nav
  2. new md file added to docs
  3. listed in mkdocs.yml nav
  4. committed with feat(article name): article ... etc...

feat(123):test with new item and in nav

snippet from mkdocs.yml

nav:
 - Notes:
   - "new" : newsletter.md
   - "123" : 123.md
  1. new newsletter section is now shown ... but

image

cannot access the newsletter detail as the aes encryption as added via the encryptcontent: plugin, the password is not recognised on this page - which is odd.

image

However even with encryption switched off I am not seeing any entries in the newsletter section.

image

lyz-code commented 2 years ago

Hi @JamesRivers, now it's your time to apologize me, we all need time off :).

I'm not familiar with the encryptcontent plugin, but it may be the case that it's encrypting the content of the files before mkdocs-newsletter can process it, and the other way around, mkdocs-newsletter creates some files, and if they are processed after encryptcontent does it's magic they may not be processed by the plugin, so that something it needs is not there, thus the error. Can you try using mkdocs-newsletter above encryptcontent in your mkdocs.yml?

plugins:
    - search: {}
    - git-revision-date-localized:
      type: timeago
    - autolinks
    - section-index
    - mkdocs-newsletter
    - encryptcontent:
        global_password: '######'
        remember_password: True
        default_expire_dalay: 12
        password_button: True
        password_button_text: 'login'

If that doesn't work, to be sure that it's not an issue with the interaction with that plugin, can you remove it completely from your plugins section and try to do mkdocs serve?

Also, mkdocs-newsletter tweaks your nav to add the newsletters, so you don't need the new entry in the nav:

nav:
 - Notes:
   - "new" : newsletter.md
lyz-code commented 2 years ago

Hey @JamesRivers were you able to work on this issue?

lyz-code commented 2 years ago

I'm closing the issue as stale, feel free to reopen if you work again on this