generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
based on new workflow data updated and necessary change simplemented
Signed-off-by: Ankita Sahu <[email protected]>
- Loading branch information
Showing
3 changed files
with
30 additions
and
124 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 |
---|---|---|
@@ -1,89 +1,3 @@ | ||
# name: Feature List Update | ||
|
||
# on: | ||
# schedule: | ||
# - cron: '0 0 * * *' # Run every night at midnight UTC | ||
# workflow_dispatch: | ||
|
||
# permissions: | ||
# contents: write | ||
# actions: read | ||
|
||
# jobs: | ||
# check-and-update-features: | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# FEATURES_FILE: 'data/features.json' | ||
|
||
# steps: | ||
# - name: Checkout current repository | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Restore cache | ||
# id: cache-sha | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: .sha-cache | ||
# key: feature-data-sha | ||
# restore-keys: | | ||
# feature-data-sha | ||
|
||
# - name: Check for updates in source repository | ||
# id: check-updates | ||
# uses: actions/github-script@v7 | ||
# with: | ||
# script: | | ||
# const { data: sourceFile } = await github.rest.repos.getContent({ | ||
# owner: 'layer5labs', | ||
# repo: 'meshery-extensions-packages', | ||
# path: 'feature_data.json', | ||
# ref: 'master' | ||
# }); | ||
|
||
# // Store the latest commit SHA | ||
# const latestSHA = sourceFile.sha; | ||
|
||
# const fs = require('fs'); | ||
|
||
# // Check if we have a previous SHA | ||
# let hasUpdates = true; | ||
# const shaCachePath = '.sha-cache/latest-sha'; | ||
# if (fs.existsSync(shaCachePath)) { | ||
# const lastSHA = fs.readFileSync(shaCachePath, 'utf8'); | ||
# hasUpdates = lastSHA !== latestSHA; | ||
# } | ||
|
||
# if (hasUpdates) { | ||
# // Save the new SHA | ||
# fs.mkdirSync('.sha-cache', { recursive: true }); | ||
# fs.writeFileSync(shaCachePath, latestSHA); | ||
|
||
# // Decode and save the content | ||
# const content = Buffer.from(sourceFile.content, 'base64').toString('utf8'); | ||
|
||
# // Create data directory if it doesn't exist | ||
# fs.mkdirSync('data', { recursive: true }); | ||
|
||
# // Write the new content | ||
# fs.writeFileSync(process.env.FEATURES_FILE, content); | ||
|
||
# core.setOutput('has-updates', 'true'); | ||
# } else { | ||
# core.setOutput('has-updates', 'false'); | ||
# } | ||
|
||
# - name: Commit changes | ||
# if: steps.check-updates.outputs.has-updates == 'true' | ||
# uses: stefanzweifel/git-auto-commit-action@v5 | ||
# with: | ||
# commit_message: "Updated feature data from source repository" | ||
# file_pattern: ${{ env.FEATURES_FILE }} | ||
# branch: master | ||
# commit_options: "--signoff" | ||
# commit_user_name: l5io | ||
# commit_user_email: [email protected] | ||
# commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
|
||
name: Feature List | ||
|
||
on: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,47 @@ | ||
{{ $currentPage := .Page.Permalink }} | ||
{{ $features := .Site.Data.features }} | ||
{{ $features := .Site.Data.feature_data }} | ||
{{ if not $features }} | ||
{{ $features = getJSON "features.json" }} | ||
{{ $features = getJSON "feature_data.json" }} | ||
{{ end }} | ||
|
||
{{ $currentPage := .Page.Permalink }} | ||
|
||
{{ if $features }} | ||
{{ $groupedFeatures := dict }} | ||
{{ range $features }} | ||
{{ $docUrl := .documentation | default "" }} | ||
{{ $docUrl := .docs | default "" }} | ||
{{ $cleanDocUrl := (index (split $docUrl "#") 0) }} | ||
{{ $currentPagePath := path.Clean (urls.Parse $currentPage).Path }} | ||
{{ $cleanDocUrlPath := path.Clean (urls.Parse $cleanDocUrl).Path }} | ||
|
||
{{ if eq $cleanDocUrlPath $currentPagePath }} | ||
{{ $tier := index .entire_row "Subscription Tier" }} | ||
{{ $feature := index .entire_row "Feature" }} | ||
{{ $currentFeatures := index $groupedFeatures $tier | default "" }} | ||
{{ $groupedFeatures = merge $groupedFeatures (dict $tier (printf "%s%s%s" $currentFeatures (cond (eq $currentFeatures | ||
"") "" ", ") $feature)) }} | ||
{{ if and (ne $docUrl "") (eq $cleanDocUrlPath $currentPagePath) }} | ||
{{ $tiers := slice }} | ||
|
||
{{ if .comparisonTiers.free }} | ||
{{ $tiers = $tiers | append "Free" }} | ||
{{ end }} | ||
|
||
{{ if .comparisonTiers.teamDesigner }} | ||
{{ $tiers = $tiers | append "Team Designer" }} | ||
{{ end }} | ||
|
||
{{ if ne (len $groupedFeatures) 0 }} | ||
{{ $maxTier := "" }} | ||
{{ $maxLength := 0 }} | ||
{{ range $tier, $features := $groupedFeatures }} | ||
{{ $length := len (split $features ", ") }} | ||
{{ if gt $length $maxLength }} | ||
{{ $maxTier = $tier }} | ||
{{ $maxLength = $length }} | ||
{{ if .comparisonTiers.teamOperator }} | ||
{{ $tiers = $tiers | append "Team Operator" }} | ||
{{ end }} | ||
|
||
{{ if .comparisonTiers.enterprise }} | ||
{{ $tiers = $tiers | append "Enterprise" }} | ||
{{ end }} | ||
|
||
{{ if len $tiers }} | ||
<div class="matterinfo"> | ||
<div class="plan-support all-plans {{ lower $maxTier }}-plan"> | ||
<div class="plan-support all-plans"> | ||
<img src="/images/subscription.svg" alt="Icon" class="support-icon adaptive-icon" data-modal="false"> | ||
Subscription: <a href="https://layer5.io/pricing" class="tier-link" target="_blank"><span class="tier">{{ $maxTier | ||
}}</span> </a> | ||
</div> | ||
{{ if gt (len $groupedFeatures) 1 }} | ||
<div class="add-ons"> | ||
<strong>Add-ons:</strong> | ||
{{ $first := true }} | ||
{{ range $tier, $features := $groupedFeatures }} | ||
{{ if ne $tier $maxTier }} | ||
{{ if not $first }}, {{ end }} | ||
{{ $first = false }} | ||
{{ $features }} [<a href="https://layer5.io/pricing" class="tier-link" target="_blank"><span class="tier">{{ $tier | ||
}}</span></a>] | ||
{{ end }} | ||
{{ end }} | ||
Subscription: <a href="https://layer5.io/pricing" class="tier-link" target="_blank"> | ||
<span class="tier">{{ delimit $tiers ", " }}</span> | ||
</a> | ||
</div> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |