diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 858414d1..f705efc3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,6 +57,34 @@ jobs: source: ./ destination: ./_site + - name: Copy raw markdown files to output directory + run: | + rsync -a \ + --exclude='/README.md' \ + --exclude='/SECURITY.md' \ + --exclude='/CODEOWNERS' \ + --exclude='/contributing.md' \ + --include='/*.md' \ + --exclude='/*' \ + ./ _site/ + rsync -am --include='*/' --include='*.md' --exclude='*' _implementors/ _site/implementors/ + for f in _posts/*.md; do + [ -e "$f" ] || continue + filename=$(basename "$f") + cp "$f" "_site/guide/${filename#????-??-??-}" + done + + - name: Generate llms-full.txt + run: | + OUTPUT_FILE="_site/llms-full.txt" + > "$OUTPUT_FILE" + echo "This document contains the full Markdown documentation for DevContainers." >> "$OUTPUT_FILE" + echo "The files are separated by lines of dashes, and each starts with its file path." >> "$OUTPUT_FILE" + find _site -type f -name "*.md" -print0 | sort -z | while IFS= read -r -d '' filepath; do + echo -e "\n\n-----------------------------------------------------------------\n" >> "$OUTPUT_FILE" + cat "$filepath" >> "$OUTPUT_FILE" + done + - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/llms.txt b/llms.txt new file mode 100644 index 00000000..e2671b86 --- /dev/null +++ b/llms.txt @@ -0,0 +1,24 @@ +--- +layout: null +permalink: /llms.txt +--- +# {{ site.title | default: "DevContainers Documentation" }} + +> {{ site.description | strip_html | strip_newlines | default: "Development containers documentation and specification." }} + +## General Pages +{%- for page in site.pages %} +{%- unless page.path contains "/" %}{%- if page.path contains ".md" %}{%- if page.name != 'README.md' and page.name != 'SECURITY.md' and page.name != 'contributing.md' %} +- [{{ page.title | default: page.name }}]({{ site.url }}{{ site.baseurl }}/{{ page.name }}) +{%- endif %}{%- endif %}{%- endunless %} +{%- endfor %} + +## Implementors Guide +{%- for implementor in site.implementors %}{%- assign filename = implementor.path | split: "/" | last %} +- [{{ implementor.title | default: filename }}]({{ site.url }}{{ site.baseurl }}/implementors/{{ filename }}) +{%- endfor %} + +## Posts (Guides) +{%- for post in site.posts %} +- [{{ post.title }}]({{ site.url }}{{ site.baseurl }}{{ post.url }}.md) +{%- endfor %}