Skip to content

Commit 5514994

Browse files
committed
Update
1 parent 53bed7f commit 5514994

File tree

6 files changed

+45
-41
lines changed

6 files changed

+45
-41
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
podman run -v $PWD:/srv:z --workdir /srv/_build --rm rpm sh -c \
3838
"cmake .. && make man-html"
3939
40-
mv _build/docs/man/{*.html,index.md} docs/man/
40+
mv _build/docs/_man docs/
4141
4242
- name: Setup Pages
4343
id: pages

docs/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ plugins:
99
# - jekyll-readme-index
1010
- jekyll-titles-from-headings
1111
- jekyll-relative-links
12+
13+
collections:
14+
man:
15+
output: true

docs/man/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ foreach(man ${manuals})
1919
endforeach()
2020
add_custom_target(man ALL DEPENDS ${manuals})
2121

22-
set(manuals-html ${manuals})
23-
list(TRANSFORM manuals-html APPEND .html)
24-
configure_file(index.sh index.sh @ONLY)
22+
configure_file(index.md index.md @ONLY)
2523
configure_file(post.sh post.sh @ONLY)
2624
foreach(man ${manuals})
27-
add_custom_command(OUTPUT ${man}.html
25+
set(outfile ${CMAKE_BINARY_DIR}/docs/_man/${man}.html)
26+
add_custom_command(OUTPUT ${outfile}
27+
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/docs/_man
2828
COMMAND scd2html -f
2929
< ${CMAKE_CURRENT_SOURCE_DIR}/${man}.scd
30-
> ${man}.html
31-
COMMAND ./post.sh ${man}.html
30+
> ${outfile}
31+
COMMAND ./post.sh ${outfile}
3232
DEPENDS ${man}.scd)
33+
list(APPEND manuals-html ${outfile})
3334
endforeach()
34-
add_custom_command(OUTPUT index.md COMMAND ./index.sh)
35-
add_custom_target(man-html ALL DEPENDS ${manuals-html} index.md)
35+
add_custom_target(man-html ALL DEPENDS ${manuals-html})
3636

3737
# Install manuals for the enabled features
3838
set(manuals ${core})

docs/man/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: default
3+
title: rpm.org - RPM Manual Pages
4+
---
5+
6+
{% assign utils = site.man | where: 'topic', 'util' %}
7+
{% assign plugins = site.man | where: 'topic', 'plugin' %}
8+
9+
# RPM Manual Pages
10+
11+
## Tools
12+
13+
{% for page in utils -%}
14+
- [{{ page.name }}](rpm{{ page.url }})
15+
{% endfor %}
16+
17+
## Plugins
18+
19+
{% for page in plugins -%}
20+
- [{{ page.name }}](rpm{{ page.url }})
21+
{% endfor %}

docs/man/index.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/man/post.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
#!/bin/bash
22

33
FILE=$1
4-
NAME=$(echo "$FILE" | sed 's/^\(.\+\)\.\(.\+\)\.html$/\1(\2)/')
4+
NAME=$(basename "$FILE" | sed 's/^\(.\+\)\.\(.\+\)\.html$/\1(\2)/')
5+
6+
topic() {
7+
case $1 in
8+
rpm-plugin*) echo plugin ;;
9+
*) echo util ;;
10+
esac
11+
}
12+
513
FRONT_MATTER="\
614
---
715
layout: default
816
title: rpm.org - $NAME
17+
name: $NAME
18+
topic: $(topic $NAME)
919
---
1020
1121
<style type="text/css">

0 commit comments

Comments
 (0)