From e9cfe352b065092fe5a7d583d251a9873ba4194d Mon Sep 17 00:00:00 2001 From: Jake Date: Mon, 29 Nov 2021 16:41:00 -0700 Subject: [PATCH] Testing moving back sidebar to left nav --- dactyl-config.yml | 5 +- template/base.html.jinja | 5 ++ .../component-code-sample-filter.html.jinja | 21 +++++++ template/page-code-samples.html.jinja | 61 ++++++------------- 4 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 template/component-code-sample-filter.html.jinja diff --git a/dactyl-config.yml b/dactyl-config.yml index 7c61c3db75..2f90874f84 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -3926,9 +3926,10 @@ pages: # Code Samples page (final location TBD) - name: Code Samples html: code-samples.html - # parent: docs.html + parent: docs.html template: page-code-samples.html.jinja - sidebar: disabled + sidebar: left_only + codesamples: true filters: - code_samples top_nav_grouping: Online Tools diff --git a/template/base.html.jinja b/template/base.html.jinja index 01d21f651d..464b0a9a5e 100644 --- a/template/base.html.jinja +++ b/template/base.html.jinja @@ -109,6 +109,11 @@ {% endif %} {% include "component-tree-nav.html.jinja" %} {% endblock %} + + {% if currentpage.codesamples is defined %} + {% include "component-code-sample-filter.html.jinja" %} + {% endif %} + {% endif %} diff --git a/template/component-code-sample-filter.html.jinja b/template/component-code-sample-filter.html.jinja new file mode 100644 index 0000000000..102a0fbb63 --- /dev/null +++ b/template/component-code-sample-filter.html.jinja @@ -0,0 +1,21 @@ +
+
+

Code Language

+
+ +
+
+ +
+
+ +
+
+ +
+
+{# #} +
+
+
+

diff --git a/template/page-code-samples.html.jinja b/template/page-code-samples.html.jinja index 6f59deef11..ea8ac769d9 100644 --- a/template/page-code-samples.html.jinja +++ b/template/page-code-samples.html.jinja @@ -6,9 +6,9 @@ {% block main %}
-
+{#
-
+
#}
@@ -21,9 +21,9 @@
-
+{#
-
+
#}
@@ -31,36 +31,8 @@
{% trans %}Explore Code Samples{% endtrans %}
-
-
- - -
-
-

Code Language

-
- -
-
- -
-
- -
-
- -
-
-{# #} -
-
-
-

- -
- {# {% set code_samples = [ { "href": "https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/checks", @@ -74,6 +46,7 @@ "description": _("Create, cash, and cancel Checks for exact or flexible amounts.") }, ] %} #} + {% set code_samples = all_code_samples() %} {% set lang_icons = { @@ -84,7 +57,8 @@ "py": "assets/img/logos/python.svg", "http": "assets/img/logos/globe.svg", } %} -
+ + @@ -106,18 +82,21 @@
-
+ +
{% trans %}Help the XRPL community by submitting your own code samples{% endtrans %}

{% trans %}Contribute Code Samples{% endtrans %}

-
-
Fork and clone

Fork the xrpl-dev-portal repo. Using git, clone the fork to your computer.

-
Add to folder

Add your sample code to the content/_code-samples folder. Be sure to include a README.md that summarizes what it does and anything else people should know about it.

-
Commit and push

Commit your changes and push them to your fork on GitHub.

-
Open a pull request

Open a pull request to the original repo. Maintainers will review your submission and suggest changes if necessary. If the code sample is helpful, it’ll be merged and added to XRPL.org!

-
+ +
+
Fork and clone

Fork the xrpl-dev-portal repo. Using git, clone the fork to your computer.

+
Add to folder

Add your sample code to the content/_code-samples folder. Be sure to include a README.md that summarizes what it does and anything else people should know about it.

+
Commit and push

Commit your changes and push them to your fork on GitHub.

+
Open a pull request

Open a pull request to the original repo. Maintainers will review your submission and suggest changes if necessary. If the code sample is helpful, it’ll be merged and added to XRPL.org!

+
Submit Code Samples +