diff --git a/_plugins/copy_markdown.rb b/_plugins/copy_markdown.rb new file mode 100644 index 00000000..982c522c --- /dev/null +++ b/_plugins/copy_markdown.rb @@ -0,0 +1,14 @@ +Jekyll::Hooks.register :site, :post_write do |site| + site.collections.each do |label, collection| + next unless label == 'articles' + collection.docs.each do |doc| + source_path = File.join(site.source, doc.relative_path) + next unless File.exist?(source_path) + + dest_path = doc.destination(site.dest).sub(/\.html$/, '.md') + dest_dir = File.dirname(dest_path) + FileUtils.mkdir_p(dest_dir) + FileUtils.cp(source_path, dest_path) + end + end +end diff --git a/llms.txt b/llms.txt index d6fe83c5..253a61dd 100644 --- a/llms.txt +++ b/llms.txt @@ -7,7 +7,7 @@ sitemap: false ## Docs -{% for article in site.articles %}- [{{article.title}}](https://www.dynamsoft.com{{ article.url | relative_url }}): {{ article.description }} +{% for article in site.articles %}- [{{article.title}}](https://www.dynamsoft.com{{ article.url | relative_url | replace: '.html', '.md' }}): {{ article.description }} {% endfor %} ## Samples