-
Notifications
You must be signed in to change notification settings - Fork 11
Add /quickstarts page to list latest quickstarts #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| layout: default | ||
| --- | ||
| <!-- _layouts/latest-quickstarts.html --> | ||
| {%- assign version = site.data.kroxylicious.latestRelease -%} | ||
| {%- assign underscored_version = version | replace: '.', '_' -%} | ||
| <div class="row align-items-start justify-content-center my-5"> | ||
| <div class="col-lg-6" role="main"> | ||
| <div class="row row-cols-1 row-cols-md-2 g-4"> | ||
| {%- assign docs_for_release = site.data.documentation[underscored_version].docs | sort: "rank" -%} | ||
| {%- for doc in docs_for_release -%} | ||
| {%- if doc.path contains 'quick' -%} | ||
| {%- assign first1 = doc.path | slice: 0, 1 -%} | ||
| {%- assign first7 = doc.path | slice: 0, 7 -%} | ||
| {%- assign first8 = doc.path | slice: 0, 8 -%} | ||
| {%- if first7 == 'http://' or first8 == 'https://' -%} | ||
| {%- assign linkTemplate = doc.path -%} | ||
| {%- elsif first1 == '/' -%} | ||
| {%- assign linkTemplate = doc.path | absolute_url -%} | ||
| {%- else -%} | ||
| {%- assign linkTemplate = "/documentation/" | append: version | append: "/" | append: doc.path | absolute_url -%} | ||
| {%- endif -%} | ||
| <div class="col"> | ||
| <div class="card shadow mb-2 h-100 mx-2 {%- for tag in doc.tags %} doctag-{{tag}}{%- endfor -%}"> | ||
| <div class="card-header"> | ||
| <h2 class="card-title fs-4"><a href='{{ linkTemplate | replace: "$(VERSION)", version}}'>{{ doc.title }}</a></h2> | ||
| </div> | ||
| <div class="card-body mx-3 my-2"> | ||
| {{ doc.description }} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {%- endif -%} | ||
| {%- endfor -%} | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| layout: latest-quickstarts | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I see that we've still got that old related nit: I don't like calling it |
||
| --- | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section is a little confusing to follow, I think we can simplify it a little (tested this locally and it looks like it works fine).
Unfortunately Liquid doesn't let us assign boolean values to variables from expressions, but we can get the same behaviour by splitting on the value we want to check if the string starts with, and then seeing if the first item in the resulting array (i.e. any characters that preceded the split) is an empty string. If the string just contained the value we were looking for but didn't start with it, then the first index won't be an empty string.
Could also be worth adding some comments to indicate what's going on here: