diff --git a/.github/workflows/deply.yml b/.github/workflows/deply.yml index d9a20d45..3aadf57e 100644 --- a/.github/workflows/deply.yml +++ b/.github/workflows/deply.yml @@ -27,6 +27,7 @@ jobs: mkdir _data/commands _includes/commands ln -s $(pwd)/_submodules/valkey/src/commands $(pwd)/_data/commands/latest ln -s $(pwd)/_submodules/valkey-doc/commands $(pwd)/_includes/commands/latest + ln -s $(pwd)/_submodules/valkey-doc/docs $(pwd)/_includes/docs - name: Setup Ruby uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 with: diff --git a/.gitignore b/.gitignore index 4f9c7cfc..f66c9a32 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ _site vendor .DS_Store /_data/commands/ -/_includes/commands/ \ No newline at end of file +/_includes/commands/ +/_includes/docs/ \ No newline at end of file diff --git a/_includes/docs b/_includes/docs new file mode 120000 index 00000000..a0984a08 --- /dev/null +++ b/_includes/docs @@ -0,0 +1 @@ +../_submodules/valkey-doc/docs/ \ No newline at end of file diff --git a/_layouts/doc-import.html b/_layouts/doc-import.html new file mode 100644 index 00000000..5820bf71 --- /dev/null +++ b/_layouts/doc-import.html @@ -0,0 +1,29 @@ +--- +layout: default +--- +{%- assign primary_title = page.primary_title -%} +{%- comment -%} + This template pulls in the file from `source` in the front matter. + + It detects if the script starts with front matter (delimited by `---`) by splitting and looking for the delimiter at the start of the file. + If the delimter is detected at the top of the file, it skips the the 3rd (zero based: 2) element and iterates over the remain sections. + If there delmiter is not detected (no front matter) it swallows the the whole file and markdownify's it. + +{%- endcomment -%} +{%- capture md -%}{% include {{ page.source }} %}{%- endcapture -%} +{%- assign stripped_front_matter = md | split: "---" -%} +{%- include page_title.html -%} +