Skip to content

Commit 2715415

Browse files
committed
Add Documentation landing page and sub-pages for libimobiledevice+libplist
1 parent 657c96a commit 2715415

File tree

8 files changed

+83
-3
lines changed

8 files changed

+83
-3
lines changed

.github/workflows/build-deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ jobs:
7474
with:
7575
repository: libimobiledevice/libimobiledevice
7676

77+
- name: Write release tags for libimobiledevice
78+
shell: bash
79+
run: |
80+
mkdir -p data/github/libimobiledevice/libimobiledevice
81+
echo '${{ steps.get_releases_libimobiledevice.outputs.releases }} > data/github/libimobiledevice/libimobiledevice/tags.json
82+
83+
- name: Write release tags for libplist
84+
shell: bash
85+
run: |
86+
mkdir -p data/github/libimobiledevice/libplist
87+
echo '${{ steps.get_releases_libplist.outputs.releases }} > data/github/libimobiledevice/libplist/tags.json
88+
7789
- name: Get libplist releases
7890
uses: yakubique/[email protected]
7991
id: get_releases_libplist

content/docs/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Documentation
3+
layout: docs
4+
menu:
5+
main:
6+
weight: 1000
7+
---
8+
API documentation is currently available for the following projects:
9+
- libimobiledevice API: [Latest](docs/libimobiledevice/latest) | [All](docs/libimobiledevice)
10+
- libplist API: [Latest](docs/libplist/latest) | [All](docs/libplist)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: libimobiledevice API documentation
3+
component: libimobiledevice
4+
layout: documentation
5+
hidden: true
6+
---
7+
The libimobiledevice API documentation is available for the following releases:

content/docs/libplist/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: libplist API documentation
3+
component: libplist
4+
layout: documentation
5+
hidden: true
6+
---
7+
The libplist API documentation is available for the following releases:

layouts/_default/list.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
{% extends '_default/page.html.twig' %}
1010

1111
{% block content %}
12-
{% if page.title != 'index' %}
12+
{% if page.title and page.title != 'index' %}
1313
<header>
1414
<h1>{{ page.title }}</h1>
1515
</header>
1616
{% endif %}
1717
<main>
1818
{{ page.content }}
19-
{% for p in pages.all|filter(p => p.exclude is not defined or p.exclude == false) %}
19+
{% for p in page.pages|filter(p => (p.hidden is not defined or p.hidden == false) and (p.exclude is not defined or p.exclude == false)) %}
2020
<article>
2121
<h2><a href="{{ url(p) }}">{{ p.title|e }}</a></h2>
2222
<time>{{ p.date|date("j M Y") }}</time>

layouts/docs.html.twig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends '_default/page.html.twig' %}
2+
3+
{% block content %}
4+
5+
{% include 'partials/section.html.twig' with {"id": "docs", "attr": " bg-white", "heading": "h1"} %}
6+
7+
{% endblock content %}

layouts/documentation.html.twig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% extends '_default/page.html.twig' %}
2+
3+
{% block content %}
4+
5+
{%- set heading = heading is defined ? heading: 'h2' -%}
6+
{%- set section_title = section_title is defined ? section_title: page.title -%}
7+
{% block section %}
8+
<section {% if id is defined %}id="{{ id }}" {% endif %}class="{% block section_classes %}container-fluid{% endblock section_classes %}{% if attr is defined %}{{ attr }}{% endif %}"{% block section_attr %}{% endblock section_attr %}>
9+
<div class="container py-4 p-lg-5 px-0">
10+
{% block section_header %}
11+
<div class="row section-heading mb-4">
12+
<div class="col-12">
13+
{{ '<%s class="section-title">%s</%s>' | format(heading, section_title, heading) | raw }}
14+
<hr>
15+
</div>
16+
</div>
17+
{% endblock section_header %}
18+
{% block section_content %}
19+
<div class="row">
20+
<article class="col-12">
21+
<div class="entry-content">{{ page.content }}</div>
22+
{% set component = page.component %}
23+
{% set tags = site.data.github.libimobiledevice[component].tags %}
24+
{% for tag in tags.releases %}
25+
<div class="entry-content">
26+
<a href="{{ component }}/{{ tag }}/">{{ component }} {{ tag }}</a>
27+
</div>
28+
{% endfor %}
29+
</article>
30+
</div>
31+
{% endblock section_content %}
32+
{% block section_footer %}{% endblock section_footer %}
33+
</div>
34+
</section>
35+
{% endblock section %}
36+
37+
{% endblock content %}

layouts/partials/navbar.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<ul class="navbar-nav mr-auto">
2424
{% if site.menus.main is defined %}
25-
{% for entry in site.menus.main | sort_by_weight %}
25+
{% for entry in site.menus.main | sort_by_weight | filter(e => e.weight is not defined or e.weight < 1000) %}
2626
<li class="nav-item{% if (url(page) == url(entry.url)) or (entry.url starts with page.section) %} active{% endif %}">
2727
<a class="nav-link" href="{{ url(entry.url) }}">{{ entry.name }}{% if url(page) == url(entry.url) %} <span class="sr-only">(current)</span>{% endif %}</a>
2828
</li>

0 commit comments

Comments
 (0)