Skip to content

feat: add markdown source publishing and linking#291

Merged
rochacbruno merged 5 commits intomainfrom
feat/markdown-source-publishing
Jul 18, 2025
Merged

feat: add markdown source publishing and linking#291
rochacbruno merged 5 commits intomainfrom
feat/markdown-source-publishing

Conversation

@rochacbruno
Copy link
Copy Markdown
Owner

Summary

  • Implements issue [feat] Publish source markdown #81 for markdown source publishing and linking
  • Adds publish_md config option to copy markdown files to output directory
  • Adds source_repository config option to link to external repository
  • Includes CLI arguments --publish-md and --source-repository

Features

  • Repository links: When source_repository is configured, links point to the external repository (e.g., GitHub)
  • Local links: When only publish_md is enabled, links point to local .md files in the output directory
  • Smart behavior: Repository links take precedence over local links when both are configured
  • Post-only: Source links only appear on posts (content with dates), not on static pages
  • Visual indicator: Links include 📄 emoji and "View source" text with rel="nofollow"

Configuration Examples

# Repository linking
publish_md: true
source_repository: https://github.com/user/repo/tree/main/content

# Local linking only  
publish_md: true

Test plan

  • Test with repository URL configuration
  • Test with local-only configuration
  • Verify markdown files are copied to output directory
  • Confirm links only appear on posts, not pages
  • Test CLI argument overrides
  • Verify build succeeds without errors

🤖 Generated with Claude Code

rochacbruno and others added 5 commits July 18, 2025 20:30
- Add publish_md config option to copy markdown files to output directory
- Add source_repository config option to link to external repository
- Implement SourceLink template function for generating appropriate URLs
- Update content.html template to display source links with 📄 icon
- Add CLI arguments for --publish-md and --source-repository
- Source links prioritize repository URLs over local files
- Links only appear on posts (content with dates), not pages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update CLI documentation with new --publish-md and --source-repository options
- Add comprehensive guide explaining the markdown source publishing feature
- Include usage examples, configuration options, and use cases
- Document behavior and precedence rules for repository vs local links

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rochacbruno rochacbruno merged commit dbddf3e into main Jul 18, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/markdown-source-publishing branch July 18, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant