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

Automatic page history links porting from 2489 #2490

Merged
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
37 changes: 31 additions & 6 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Website
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/website.yml'
- 'doc/**'
- 'locale/**'
- 'CMakeLists.txt'
branches:
- main
- develop
Expand Down Expand Up @@ -87,15 +92,35 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"


- name: Update Users Documentation
- name: Update Users Documentation on develop
if: ${{ github.ref == 'refs/heads/develop' }}
run: |

git checkout origin/gh-pages
git checkout -b gh-pages
DIRECTORY="${PROJECT_VERSION%.*}"
rm -rf ${DIRECTORY}
cp -r build/doc/html ${DIRECTORY}
git add ${DIRECTORY}
git diff-index --quiet HEAD || git commit -m "Update users documentation for ${PROJECT_VERSION} for develop branch: commit ${{ env.GIT_HASH }}"
git fetch origin
git rebase origin/gh-pages
git push origin gh-pages

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Users Documentation on main
if: ${{ github.ref == 'refs/heads/main' }}
run: |

git checkout origin/gh-pages
git checkout -b gh-pages
PROJECT_MAJOR_MINOR="${PROJECT_VERSION%.*}"
rm -rf ${PROJECT_MAJOR_MINOR}
cp -r build/doc/html ${PROJECT_MAJOR_MINOR}
git add ${PROJECT_MAJOR_MINOR}
git diff-index --quiet HEAD || git commit -m "Update users documentation for ${PROJECT_VERSION}: commit ${{ env.GIT_HASH }}"
DIRECTORY="main"
rm -rf ${DIRECTORY}
cp -r build/doc/html ${DIRECTORY}
git add ${DIRECTORY}
git diff-index --quiet HEAD || git commit -m "Update users documentation for ${PROJECT_VERSION} for main branch: commit ${{ env.GIT_HASH }}"
git fetch origin
git rebase origin/gh-pages
git push origin gh-pages
Expand Down
21 changes: 21 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,30 @@ if (DOC_USE_BOOTSTRAP)
'source_link_position': \"nav\",
'bootstrap_version': \"2\",
")
# Modify
# https://github.com/ryan-roemer/sphinx-bootstrap-theme/blob/master/sphinx_bootstrap_theme/bootstrap/layout.html#L67
# adding the call to get the history of the file
set(THEME_HISTORY "
{%- block content %}
{{ navBar() }}
<div class=\"container\">
<div class=\"row\">
{%- block sidebar1 %}{{ bsidebar() }}{% endblock %}
<div class=\"body {{ bs_span_prefix }}{{ bs_content_width }} content\" role=\"main\">
<script> document.write(get_history('{{ pagename }}','{{ language }}')); </script>
{% block body %}{% endblock %}
</div>
{% block sidebar2 %} {# possible location for sidebar #} {% endblock %}
</div>
</div>
{%- endblock %}
")
else()
set(SPHINX_INCLUDE "")
set(SPHINX_THEME "haiku")
set(SPHINX_THEME_DIR "['']")
set(SPHINX_THEME_OPTIONS "")
set(THEME_HISTORY "")
endif()


Expand Down Expand Up @@ -210,6 +229,8 @@ configure_file("../tools/testers/sampledata.sql" "${PGR_DOCUMENTATION_SOURCE_DIR
#add_subdirectory("themes")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/_static" DESTINATION "${PGR_DOCUMENTATION_SOURCE_DIR}")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/_themes" DESTINATION "${PGR_DOCUMENTATION_SOURCE_DIR}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_templates/layout.html"
"${PGR_DOCUMENTATION_SOURCE_DIR}/_templates/layout.html" @ONLY)


configure_file(
Expand Down
Loading