Skip to content
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

added data to app breadcrumb #157

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/register.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
mkdir -p $dir
cp {metadata,submission}.json index.md $dir/
python scripts/index_page_data.py $dir
python scripts/app_pages.py

- name: "🫙 Commit and push docs with generated files"
id: create_branch
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/#installing-the-theme

#theme : "minimal-mistakes-jekyll"
remote_theme : "mmistakes/minimal-mistakes@4.24.0"
remote_theme : "https://github.com/clamsproject/website-theme-minimal-mistakes"
minimal_mistakes_skin : "default" # "air", "aqua", "contrast", "dark", "dirt", "neon", "mint", "plum", "sunrise"

# Site Settings
Expand Down
23 changes: 20 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,30 @@ toc_sticky: true
## App Directory

{% for app in site.data.app-index %}
{%- assign check = app[0] | split:'http://apps.clams.ai/' -%}
{% assign check = app[0] | split:'http://apps.clams.ai/' %}
{% if check.size == 2 %}
{% assign versions = app[1]["versions"] %}
{% capture numstr %} {{ versions.size }},3 {% endcapture %}
{% assign numstrs = numstr | split: "," %}
{% assign nums = "" | split: "" %}
{% for num in numstrs %}
{% assign cast = num | to_integer %}
{% assign nums = nums | push: cast %}
{% endfor %}
{% assign to_display = nums | sort | first | to_i %}
{% assign end_loop = to_display | minus: 1 %}

### {{ check[1] }}

{{ app[1]["description"] }}
{% for version in app[1]["versions"] %}
* [{{ version[0] }}]({{ check[1] }}/{{ version[0] }}) ([`@{{ version[1] }}`](https://github.com/{{ version[1] }}))

{% for i in (0..end_loop) %}
* [{{ versions[i][0] }}]({{ check[1] }}/{{ versions[i][0] }}) ([`@{{ versions[i][1] }}`](https://github.com/{{ versions[i][1] }}))
{% endfor %}
{% if versions.size > to_display %}

* [all {{ versions.size }} releases]({{ check[1] }})
{% endif %}
{% else %}
### {{ app[0] }}
{% for version in app[1] %}
Expand Down
27 changes: 27 additions & 0 deletions scripts/app_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
import json

docs_dir = os.path.join(os.path.dirname(__file__), '..', 'docs')

apps = json.load(open(os.path.join(docs_dir, '_data', 'app-index.json')))

for app_uri, app_details in apps.items():
app_title = app_uri.rsplit('/', 1)[1]
app_submitters = {ver: submitter for ver, submitter in app_details['versions']}
app_description = app_details['description']

file_name = os.path.join(docs_dir, '_apps', app_title, 'index.md')

f = open(file_name, "w")

f.write('---\n')
f.write("layout: posts\n")
f.write("classes: wide\n")
f.write(f"title: {app_title}\n")
f.write("---\n")
f.write(f"{app_description}\n")

for app_ver, app_submitter in app_submitters.items():
f.write(f"- [{app_ver}]({app_ver}) ([`@{app_submitter}`](https://github.com/{app_submitter}))\n")

f.close()
Loading