generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 5
Content: Replace with data attribute grid system #304
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a6349a2
Content: Replace with data attribute grid system
nginx-jack 07f5ebb
Cards: Replace with data-grid
lamATnginx 9c23ffb
Cards: Small tweaks
lamATnginx c763f00
Codeblock: Make highlighted lines stretch to end + fix border
lamATnginx 20b3727
Homepage: Replace with data-grid and cards shortcode
lamATnginx fb65f5e
Scroll: Fixed issue with pages overflowing on mobile
lamATnginx 84ced42
Breadcrumb: Cleaned up unused code with wide
lamATnginx 2439193
Fixed redocly responsive on new grid (#307)
lamATnginx 4163859
Codeblock: Extend highlight to left side
lamATnginx 6d99370
Merge pull request #308 from nginxinc/codeblock-design
nginx-jack 54712a3
Cards: Make cards fully clickable + small bug fix with grid ordering
lamATnginx 1e7d0fa
Add new 'card' page to example site + new tests for cards (#305)
lamATnginx 3a3fe73
Grid: Resolved issue with grid on mobile
lamATnginx deb5574
Banner: Add spacing
lamATnginx 05245d4
Card: Fixed relative pathing
lamATnginx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Example Site for NGINX Hugo Theme | ||
description: | ||
--- | ||
|
||
## NGINX Hugo Theme Documentation | ||
Documentation for hugo theme | ||
{{<card-layout>}} | ||
{{<card-section showAsCards="true">}} | ||
{{<card title="Test Product" titleUrl="/test-product/" icon="test-tubes" isLanding="true">}} | ||
See explanations and usages of shortcodes | ||
{{</card >}} | ||
{{<card title="NGINX Plus" titleUrl="/nginx/" brandIcon="NGINX-Plus-product-icon-RGB" isLanding="true">}} | ||
See a live example of theme components | ||
{{</card >}} | ||
{{</card-section>}} | ||
{{</card-layout>}} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
description: Card usage | ||
title: Cards | ||
weight: 300 | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
description: Card usage | ||
title: Usage | ||
weight: 100 | ||
--- | ||
## General usage | ||
The structure of a card looks like the following: | ||
```plaintext | ||
<card-layout > | ||
<card-section> | ||
<card title="SOME_TITLE">SOME CONTENT icon="SOME_LUCIDE_ICON"><\card> | ||
... | ||
<card>SOME CONTENT<\card> | ||
</card-section> | ||
</card-layout > | ||
``` | ||
|
||
and will render as the following: | ||
<div data-testid="cards-test__basic"> | ||
{{<card-layout >}} | ||
{{<card-section>}} | ||
{{<card title="SOME_TITLE">}} | ||
SOME CONTENT | ||
{{</card >}} | ||
{{</card-section>}} | ||
{{</card-layout >}} | ||
</div> | ||
|
||
### Params | ||
To support customization, there are also some params you can add to the shortcode `<card>` such as `title`, `titleUrl`, `icon`, `brandIcon`, `isFeaturedCard`, `isFullSize`. | ||
|
||
* `title` (required) - Title of the card. | ||
<br> | ||
* `titleUrl` (optional) - URL for the card. | ||
<br> | ||
* `icon` (optional) - Custom icon using <a href="https://lucide.dev/icons/">lucide</a> icons. | ||
<br> | ||
* `brandIcon` (optional) - Custom icon using image from `nginx-hugo-theme/static/images/icons`. | ||
* Usage: `<card brandIcon="NGINX-App-Protect-WAF-product-icon"...>` | ||
<br> | ||
* `isFeaturedCard` (optional) - Boolean indicating whether or not the card should be the first one and full size. By default, false. | ||
* Usage: `<card isFeaturedCard="true"...>` | ||
<br> | ||
* `isFullSize` (optional) - Boolean indicating whether or not the card should be full size. By default, cards are half sized. | ||
* Usage: `<card isFullSize="true"...>` | ||
|
||
For the `<card-section>`, there are some params you can add such as `title`, `isFeaturedSection`, and `showAsCards`. | ||
* `title` - Title of the section. | ||
<br> | ||
* `isFeaturedSection` (optional) - Boolean indicating whether or not the section is a featured one - will discuss later down the page. By default, false. | ||
<br> | ||
* `showAsCards` (optional) - Boolean indicating whether or not the cards in the section should appear with borders. By default, false. | ||
|
||
### Additional Information | ||
While it may come immediate, you can't use a `<card>` shortcode on its own in your markdown or else the build will fail. This is because if you call a card, there is no way to structure it in a writer-friendly customizable way. | ||
|
||
## Show as cards | ||
As you can see from the above example in 'General usage', it renders as a plain box that does not resemble a card. To change the appearance and render as a card, use the param `showAsCards` in the shortcode `<card-section>`. The usage as seen below: | ||
```plaintext | ||
<card-layout > | ||
<card-section showAsCards="true"> | ||
<card title="SOME_TITLE">SOME CONTENT icon="SOME_LUCIDE_ICON"><\card> | ||
... | ||
<card>SOME CONTENT<\card> | ||
</card-section> | ||
</card-layout > | ||
``` | ||
and will render as the following: | ||
<div data-testid="cards-test__showAsCards"> | ||
{{<card-layout >}} | ||
{{<card-section showAsCards="true">}} | ||
{{<card title="SOME_TITLE">}} | ||
SOME CONTENT | ||
{{</card >}} | ||
{{</card-section>}} | ||
{{</card-layout >}} | ||
</div> | ||
|
||
## Featured Section | ||
Denoted by the param `isFeaturedSection` in the shortcode `<card-layout>`, this block of cards can contain only up to three cards. | ||
|
||
<div data-testid="cards-test__featuredSection"> | ||
{{<card-layout >}} | ||
{{<card-section showAsCards="true" isFeaturedSection="true">}} | ||
{{<card title="Everything" titleUrl="everything" icon="circle-dot-dashed">}} | ||
All shortcodes in one page. | ||
{{</card >}} | ||
{{<card title="Call Out usages" titleUrl="call-out/all-callouts/" icon="message-square">}} | ||
Examples for call-out shortcode | ||
{{</card >}} | ||
{{<card title="Code Block usages" titleUrl="code-blocks/code-blocks-highlighting/" icon="code">}} | ||
Examples for codeblock shortcode | ||
{{</card >}} | ||
{{<card title="Code Block usages" titleUrl="code-blocks/code-blocks-highlighting/" icon="code">}} | ||
Examples for codeblock shortcode | ||
{{</card >}} | ||
{{</card-section>}} | ||
{{</card-layout >}} | ||
</div> | ||
|
||
## Featured Card | ||
Denoted by the param `isFeaturedCard` in the shortcode `<card>`, this will push the card up to very top of the section and make it full length. | ||
<div data-testid="cards-test__featuredCard"> | ||
{{<card-layout >}} | ||
{{<card-section showAsCards="true">}} | ||
{{<card title="Everything" titleUrl="everything" icon="circle-dot-dashed">}} | ||
All shortcodes in one page. | ||
{{</card >}} | ||
{{<card title="Call Out usages" titleUrl="call-out/all-callouts/" icon="message-square">}} | ||
Examples for call-out shortcode | ||
{{</card >}} | ||
{{<card title="Code Block usages" titleUrl="code-blocks/code-blocks-highlighting/" icon="code" isFeaturedCard="true">}} | ||
Examples for codeblock shortcode | ||
{{</card >}} | ||
{{<card title="Code Block usages" titleUrl="code-blocks/code-blocks-highlighting/" icon="code">}} | ||
Examples for codeblock shortcode | ||
{{</card >}} | ||
{{</card-section>}} | ||
{{</card-layout >}} | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
{{ define "main" }} | ||
|
||
<h1>Homepage Example</h1> | ||
<p> | ||
<ul> | ||
<li> | ||
<a href="{{ relref . "nginx" }}">NGINX and NGINX Plus</a> | ||
</li> | ||
<li> | ||
<a href="{{ relref . "test-product" }}">Test Product</a> | ||
</li> | ||
</ul> | ||
</p> | ||
|
||
|
||
{{ partial "homepage.html" . }} | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="homepage"> | ||
<div class="homepage-section"> | ||
{{ .Content }} | ||
</div> | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<!-- Render the main content first with modifications, then render the custom content --> | ||
<div class="card-layout">{{- .Inner | markdownify -}}</div> | ||
<div class="card-layout" data-testid="card-layout">{{- .Inner | markdownify -}}</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.