-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Problem Description
I am using the encryptcontent plugin to protect specific pages in my MkDocs site. The plugin works correctly when navigating to an encrypted page directly, as it prompts for a password. However, I am also using the built-in blog plugin in mkdocs-material to create a blog-style index page, and it exposes excerpts of the encrypted posts on this homepage, completely bypassing the encryption.
Steps to Reproduce
- Set up an MkDocs project with both mkdocs-material's built-in
blogplugin andmkdocs-encryptcontent-plugin. - Create a post with
encryptcontentmetadata (e.g.,level: secret). - Build the site and serve it. (
mkdocs serve) - Observe the blog index page (homepage). The excerpt/content from the encrypted post will be visible without any password prompt.
- Click the "Read more" link for that same post. You will be correctly prompted for a password, and the full content is encrypted.
Expected Behavior
Encrypted posts should not reveal their content in any form on listing pages (like the blog index) generated by other plugins. The expected behavior could be implemented in one of two ways:
- Preferred: The plugin should intercept the content processing for listings and replace the content of encrypted pages with a placeholder (e.g., "This post is encrypted" or a custom message).
- Alternative: Provide a configuration option (e.g.,
summary_placeholder: "This content is protected.") to allow users to define what text is shown in place of encrypted content on summary pages.
Environment
- Python 3.13.5
- mkdocs-encryptcontent-plugin 3.0.5
- mkdocs 1.6.1
- mkdocs-material 9.6.15
Configuration Example (mkdocs.yml)
theme:
name: material
language: 'zh'
custom_dir: overrides
plugins:
- search
- encryptcontent:
password_inventory:
title_prefix: '[Protected]'
summary: 'This passage is protected by password.'
decryption_failure_message: 'Invalid user name or password.'
password_button: True
password_button_text: 'Enter'
placeholder_user: 'User'
placeholderplaceholder: 'Password'
password_file: 'passwords.yml'
remember_keys: false
remember_password: false
threshold_warning_min_entropy: 100
search_index: 'dynamically'
encrypted_something:
md-sidebar__inner: [div, class]
- toggle-sidebar:
toggle_button: navigation
- blog:
post_slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds:
case: lower
blog_dir: "./"
post_url_format: "{categories}/{file}"
post_date_format: medium
post_url_max_categories: 1
blog_toc: trueThank you for developing and maintaining this essential plugin. I would be happy to provide more details or assist in testing any potential fixes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists