-
Notifications
You must be signed in to change notification settings - Fork 93
Feat/skills hub #4948
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?
Feat/skills hub #4948
Changes from all commits
33ceee1
e9315c7
4cbf771
0835ba0
701ab97
73eeae2
7d8f779
8213dfc
71c567b
1a11fdc
3a8c236
e540c8b
8560bbf
9ac2740
0163901
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 @@ | ||
| name: Sync Skills Submodule | ||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
| repository_dispatch: | ||
| types: [SKILLS_UPDATED] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| sync-skills-submodule: | ||
| name: Sync Skills Submodule | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0 | ||
| with: | ||
| egress-policy: audit | ||
| - name: Create GitHub App Token | ||
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 | ||
| id: app-token | ||
| with: | ||
| app-id: ${{ vars.GH_APP_KONG_DOCS_ID }} | ||
| private-key: ${{ secrets.GH_APP_KONG_DOCS_SECRET }} | ||
| owner: Kong | ||
|
|
||
| - name: Submodule Sync | ||
| uses: mheap/submodule-sync-action@a06903a4e38f042f6f52cc88d184ec1c930ee12d # v1 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| path: app/.repos/skills | ||
| ref: main | ||
| pr_branch: automated-skills-update | ||
| base_branch: main | ||
| target_branch: main |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| [submodule "app/.repos/kuma"] | ||
| path = app/.repos/kuma | ||
| url = https://github.com/kumahq/kuma-website.git | ||
| [submodule "app/.repos/skills"] | ||
| path = app/.repos/skills | ||
| url = git@github.com:Kong/skills.git | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||
| class SkillsIndex { | ||||||
| constructor() { | ||||||
| this.searchInput = document.getElementById("skills-search"); | ||||||
| this.skillsGrid = document.getElementById("skills-grid"); | ||||||
| this.emptyState = document.getElementById("skills-empty"); | ||||||
| this.cards = this.skillsGrid.querySelectorAll('[data-card="skill"]'); | ||||||
|
|
||||||
| this.searchQuery = ""; | ||||||
|
|
||||||
| this.addEventListeners(); | ||||||
| this.preventCopyNavigation(); | ||||||
| this.readURL(); | ||||||
| this.filterCards(); | ||||||
| } | ||||||
|
|
||||||
| preventCopyNavigation() { | ||||||
| this.skillsGrid.addEventListener("click", (e) => { | ||||||
| if (e.target.closest("clipboard-copy")) { | ||||||
|
||||||
| if (e.target.closest("clipboard-copy")) { | |
| if (e.target instanceof Element && e.target.closest("clipboard-copy")) { |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| {% assign skill = include.skill %} | ||||||||||||||||||||||||||||||||||||||||||||||
| {% capture quick_install %}{% include skills/quick_install.md slug=skill.slug %}{% endcapture %} | ||||||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||||
| class="card card__bordered min-h-[220px]" | ||||||||||||||||||||||||||||||||||||||||||||||
| data-card="skill" | ||||||||||||||||||||||||||||||||||||||||||||||
| data-title="{{ skill.title | downcase }}" | ||||||||||||||||||||||||||||||||||||||||||||||
| data-description="{{ skill.description | downcase | truncate: 200 }}" | ||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||
| <a href="{{ skill.url }}" class="flex flex-col gap-5 hover:no-underline text-secondary w-full p-6"> | ||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex items-center justify-between"> | ||||||||||||||||||||||||||||||||||||||||||||||
| <h3 class="font-mono">/{{ skill.title }}</h3> | ||||||||||||||||||||||||||||||||||||||||||||||
| {% if skill.version %}<span class="badge w-fit text-xs">{{ skill.version }}</span>{% endif %} | ||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col gap-3 flex-grow"> | ||||||||||||||||||||||||||||||||||||||||||||||
| <p class="text-sm line-clamp-3">{{ skill.description }}</p> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+16
|
||||||||||||||||||||||||||||||||||||||||||||||
| data-title="{{ skill.title | downcase }}" | |
| data-description="{{ skill.description | downcase | truncate: 200 }}" | |
| > | |
| <a href="{{ skill.url }}" class="flex flex-col gap-5 hover:no-underline text-secondary w-full p-6"> | |
| <div class="flex items-center justify-between"> | |
| <h3 class="font-mono">/{{ skill.title }}</h3> | |
| {% if skill.version %}<span class="badge w-fit text-xs">{{ skill.version }}</span>{% endif %} | |
| </div> | |
| <div class="flex flex-col gap-3 flex-grow"> | |
| <p class="text-sm line-clamp-3">{{ skill.description }}</p> | |
| data-title="{{ skill.title | downcase | escape }}" | |
| data-description="{{ skill.description | downcase | truncate: 200 | escape }}" | |
| > | |
| <a href="{{ skill.url }}" class="flex flex-col gap-5 hover:no-underline text-secondary w-full p-6"> | |
| <div class="flex items-center justify-between"> | |
| <h3 class="font-mono">/{{ skill.title | escape }}</h3> | |
| {% if skill.version %}<span class="badge w-fit text-xs">{{ skill.version }}</span>{% endif %} | |
| </div> | |
| <div class="flex flex-col gap-3 flex-grow"> | |
| <p class="text-sm line-clamp-3">{{ skill.description | escape }}</p> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">Source</div> | ||
| {% assign repo_parts = site.repos.skills | split: 'github.com/' %} | ||
| <div class="flex gap-1.5 items-center"> | ||
| {% include_svg '/assets/icons/github.svg' width="16" height="16" %} | ||
| <a href="{{ site.repos.skills }}/tree/main/skills/{{ page.slug }}">{{ repo_parts[1] }}</a> | ||
| </div> | ||
| </div> | ||
|
|
||
| {% if page.version %} | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">Version</div> | ||
| <div class="flex gap-1.5"> | ||
| {% include badge.html text=page.version %} | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if page.author %} | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">Author</div> | ||
| <div class="flex gap-1.5"> | ||
| <span>{{ page.author }}</span> | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if page.license %} | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">License</div> | ||
| <div class="flex gap-1.5"> | ||
| {% if page.license_is_file %} | ||
| <a href="{{ site.repos.skills }}/blob/main/skills/{{ page.slug }}/{{ page.license }}">{{ page.license }}</a> | ||
| {% else %} | ||
| <span>{{ page.license }}</span> | ||
| {% endif %} | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if page.allowed_tools %} | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">Allowed tools</div> | ||
| <div class="flex gap-1.5 flex-wrap"> | ||
| {% assign tools = page.allowed_tools | split: ' ' %} | ||
| {% for tool in tools %} | ||
| <span>{{ tool }}</span> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if page.scripts or page.references or page.assets %} | ||
| <div class="flex flex-col gap-2 w-full"> | ||
| <div class="text-primary font-medium">Contains</div> | ||
| <div class="flex flex-col gap-1.5 flex-wrap"> | ||
| {% if page.scripts %} | ||
| <a href="{{ site.repos.skills }}/tree/main/skills/{{ page.slug }}/scripts" class="flex items-center gap-2 hover:no-underline"> | ||
| <div class="flex text-brand shrink-0">{% include_svg '/assets/icons/skills/scripts.svg' width="16" height="16" %}</div> | ||
| <span>Scripts</span> | ||
| </a> | ||
| {% endif %} | ||
| {% if page.references %} | ||
| <a href="{{ site.repos.skills }}/tree/main/skills/{{ page.slug }}/references" class="flex items-center gap-2 hover:no-underline"> | ||
| <div class="flex text-brand shrink-0">{% include_svg '/assets/icons/skills/references.svg' width="16" height="16" %}</div> | ||
| <span>References</span> | ||
| </a> | ||
| {% endif %} | ||
| {% if page.assets %} | ||
| <a href="{{ site.repos.skills }}/tree/main/skills/{{ page.slug }}/assets" class="flex items-center gap-2 hover:no-underline"> | ||
| <div class="flex text-brand shrink-0">{% include_svg '/assets/icons/skills/assets.svg' width="16" height="16" %}</div> | ||
| <span>Assets</span> | ||
| </a> | ||
| {% endif %} | ||
| </div> | ||
| </div> | ||
| {% endif %} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||
| {% if site.data.skill_install_tabs.size > 0 %} | ||||||
|
||||||
| {% if site.data.skill_install_tabs.size > 0 %} | |
| {% if site.data.skill_install_tabs and site.data.skill_install_tabs.size > 0 %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ## Installation | ||
|
|
||
| {% include skills/quick_install.md slug=page.slug %} | ||
|
|
||
| ## Description | ||
|
|
||
| {{ page.description }} | ||
|
|
||
| ## SKILL.md | ||
|
|
||
| {{ page.skill_content }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ```bash | ||
| npx skills@latest add {{site.repos.skills | remove: "https://github.com/" | remove_last: "/"}}{% if include.slug%} --skill {{ include.slug }}{% endif %} | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| layout: with_aside | ||
| uses: false | ||
| --- | ||
|
|
||
| {{ content }} | ||
|
|
||
| {% contentfor info_box %} | ||
| {% include info_box/skill.html %} | ||
| {% endcontentfor %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Jekyll | ||
| class SkillsGenerator < Jekyll::Generator | ||
| priority :high | ||
|
|
||
| def generate(site) | ||
| site.data['skills'] ||= {} | ||
| Jekyll::SkillPages::Generator.run(site) | ||
| end | ||
| end | ||
| end |
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.
The skills submodule uses an SSH URL (
git@github.com:...), which will fail in environments without an SSH key (CI/Netlify/submodule sync); switch this to an HTTPS URL like the existing kuma submodule.