-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from mpourismaiel/feat/pricing/create
Add support for pricing fragment
- Loading branch information
Showing
8 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,11 @@ | ||
+++ | ||
fragment = "pricing" | ||
weight = 100 | ||
# background = "light" | ||
|
||
title = "Pricing fragment" | ||
subtitle = "Can be linked to 3rd party payment services" | ||
+++ | ||
|
||
Pricing fragment supports **markdown** as it's subtitle. | ||
Supports feature listing of different plans and links to a payment service. |
This file contains 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,20 @@ | ||
+++ | ||
weight = 10 | ||
|
||
title = "Starting plan" | ||
subtitle = "starting at" | ||
|
||
price = "Free" | ||
# highlight = true | ||
|
||
button_text = "Start for free" | ||
button_url = "#" | ||
|
||
[[features]] | ||
text = "**Basic** feature" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Email** support" | ||
icon = "fas fa-check" | ||
+++ |
This file contains 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,28 @@ | ||
+++ | ||
weight = 20 | ||
|
||
title = "Premium plan" | ||
subtitle = "starting at" | ||
|
||
price = "$9.99/mo" | ||
highlight = true | ||
|
||
button_text = "Get started" | ||
button_url = "#" | ||
|
||
[[features]] | ||
text = "**Basic** feature" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Premium** feature" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Email** support" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Chat** support" | ||
icon = "fas fa-check" | ||
+++ |
This file contains 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,32 @@ | ||
+++ | ||
weight = 30 | ||
|
||
title = "Enterprise plan" | ||
# subtitle = "" | ||
|
||
price = "Custom" | ||
# highlight = true | ||
|
||
button_text = "Contact us" | ||
button_url = "#" | ||
|
||
[[features]] | ||
text = "**Basic** feature" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Premium** feature" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Email** support" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Chat** support" | ||
icon = "fas fa-check" | ||
|
||
[[features]] | ||
text = "**Additional enterprise stuff**" | ||
icon = "fas fa-check" | ||
+++ |
This file contains 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,82 @@ | ||
{{- $items := where (.resources.Match (printf "%s/*.md" .Name)) ".Name" "ne" .self.Name -}} | ||
{{- $self := . -}} | ||
{{- $bg := .Params.background | default "light" }} | ||
|
||
{{ "<!-- Pricing -->" | safeHTML }} | ||
<section id="{{ .Name }}"> | ||
<div class="overlay container-fluid | ||
{{- printf " bg-%s" $bg -}} | ||
"> | ||
<div class="container py-5"> | ||
{{- with .Params.title }} | ||
<div class="row"> | ||
<div class="col text-center | ||
{{- if or (eq $bg "white") (eq $bg "light") (eq $bg "secondary") (eq $bg "primary") -}} | ||
{{- printf " text-%s" "dark" -}} | ||
{{- else -}} | ||
{{- printf " text-%s" "light" -}} | ||
{{- end -}} | ||
{{- if and (not (isset $self.Params "subtitle")) (not $self.Content) -}} | ||
{{- printf " pb-4" -}} | ||
{{- end -}} | ||
"> | ||
<h2> | ||
{{- . | markdownify -}} | ||
</h2> | ||
</div> | ||
</div> | ||
{{- end -}} | ||
{{- with .Params.subtitle -}} | ||
<div class="row"> | ||
<div class="col text-center pt-2 pb-4 | ||
{{- if or (eq $bg "secondary") (eq $bg "primary") -}} | ||
{{- printf " text-%s" "dark" -}} | ||
{{- else -}} | ||
{{- printf " text-muted text-%s" "secondary" -}} | ||
{{- end -}} | ||
"> | ||
<h6> | ||
{{- . | markdownify -}} | ||
</h6> | ||
</div> | ||
</div> | ||
{{- end }} | ||
{{- with .Content -}} | ||
<div class="row"> | ||
<div class="col text-center pt-4 pb-5 | ||
{{- if or (eq $bg "secondary") (eq $bg "primary") -}} | ||
{{- printf " text-%s" "dark" -}} | ||
{{- else -}} | ||
{{- printf " text-muted text-%s" "secondary" -}} | ||
{{- end -}} | ||
"> | ||
{{- . -}} | ||
</div> | ||
</div> | ||
{{- end }} | ||
<div class="row"> | ||
{{- range (sort $items ".Params.weight") }} | ||
<div class="col-lg-4 col-md-6 col-12 py-2 pricing-plan {{- if .Params.highlight }} pricing-plan-highlight {{- end -}}"> | ||
<div class="card"> | ||
<div class="card-header | ||
{{- printf " bg-%s" (.Params.header_bg | default "primary") -}} | ||
{{- printf " text-%s" (.Params.header_text_color | default "light") -}}"> | ||
<h4 class="mt-0 font-weight-normal text-center">{{ .Title }}</h4> | ||
<div class="mt-0 h6 font-weight-normal text-center">{{ (.Params.subtitle | default "") | markdownify }}</div> | ||
<h2 class="card-title mb-0 pricing-card-title text-center">{{ .Params.price }}</h2> | ||
</div> | ||
<div class="card-body {{ printf "bg-%s" (.Params.bg | default "light") }}"> | ||
<div class="mb-4 features"> | ||
{{- range .Params.features }} | ||
<p><i class="{{ .icon }}"></i>{{ .text | markdownify }}</p> | ||
{{- end }} | ||
</div> | ||
<a href="{{ .Params.button_url }}" class="btn btn-lg btn-block btn-primary">{{ .Params.button_text }}</a> | ||
</div> | ||
</div> | ||
</div> | ||
{{- end }} | ||
</div> | ||
</div> | ||
</div> | ||
</section> |
This file contains 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,50 @@ | ||
.pricing-plan { | ||
display: flex; | ||
|
||
.card { | ||
flex: 1 0 auto; | ||
overflow: hidden; | ||
} | ||
|
||
.card-header { | ||
height: 125px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
|
||
&-highlight { | ||
@include media-breakpoint-up(md) { | ||
margin: -20px -10px 0; | ||
|
||
.card-header { | ||
height: 145px; | ||
} | ||
} | ||
|
||
@include media-breakpoint-down(md) { | ||
order: -1; | ||
} | ||
} | ||
|
||
.card-body { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1 0 auto; | ||
|
||
.features { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1 0 auto; | ||
} | ||
|
||
p { | ||
margin-bottom: 0; | ||
|
||
i { | ||
color: $green; | ||
margin-right: 10px; | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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