Skip to content

Commit

Permalink
Adjust to ensure previews load isolated code (vagrant-libvirt#1547)
Browse files Browse the repository at this point in the history
Ensure previews use the plugin script from the tree instead
of the common one for latest and version releases
  • Loading branch information
electrofelix authored Aug 15, 2022
1 parent 86fc5f0 commit 4fc3c84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/publish-documentation-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk
cat <<EOF >> docs/_config.yml
repository_nwo: vagrant-libvirt/vagrant-libvirt
plugin_script_base_path: /${REPO_NAME}/pr-preview/pr-${PR_NUMBER}
EOF
BUNDLE_GEMFILE=./docs/Gemfile bundle install
Expand Down
4 changes: 3 additions & 1 deletion docs/_includes/header_custom.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script src="{% asset "js/site_constants.js" @path %}"></script>
<div id="plugin-version-menu" class="site-footer"></div>
{%- assign basePath = "" %}
{%- if site.baseurl.size != 0 %}
{%- if site.plugin_script_base_path %}
{%- assign basePath = site.plugin_script_base_path %}
{%- elsif site.baseurl.size != 0 %}
{%- assign basePath = "/vagrant-libvirt" %}
{%- endif %}
<script src="{{ basePath }}/assets/js/plugin_versions_menu.js"></script>

0 comments on commit 4fc3c84

Please sign in to comment.