diff --git a/copy_markdown.php b/copy_markdown.php index 80bb117..3121125 100644 --- a/copy_markdown.php +++ b/copy_markdown.php @@ -3,8 +3,8 @@ * Copies the source Markdown files into the generated site, so every page is * also available in its original Markdown form. * - * `doc/book/v7/introduction/introduction.md` is copied to - * `doc/html/v7/introduction/introduction.md`, making it available as + * `docs/book/v7/introduction/introduction.md` is copied to + * `docs/html/v7/introduction/introduction.md`, making it available as * `/v7/introduction/introduction.md`, next to the generated * `/v7/introduction/introduction/` page. * @@ -12,7 +12,7 @@ * directory. */ -$docPath = isset($argv[1]) ? $argv[1] : 'doc'; +$docPath = $argv[1] ?? 'docs'; $docPath = sprintf('%s/%s', getcwd(), $docPath); $docPath = realpath($docPath); diff --git a/theme/partials/content.html b/theme/partials/content.html index f1369d1..529c92a 100644 --- a/theme/partials/content.html +++ b/theme/partials/content.html @@ -24,15 +24,46 @@ {% endif %} - {# Link to the Markdown source, published next to this page by copy_markdown.php #} + {# Markdown Controls #} {% if page.file and page.file.src_uri %} -

- - - View as Markdown - -

+ {% set markdown_url = page.file.src_uri|url %} + {% if config.site_url %} + {% set markdown_full_url = config.site_url ~ page.file.src_uri %} + {% else %} + {% set markdown_full_url = markdown_url %} + {% endif %} + {% set claude_prompt = 'Read from ' ~ markdown_full_url ~ ' so I can ask questions about it.' %} +
+
+ + +
+
{% endif %} {{ page.content }}