Skip to content

Commit

Permalink
feat: Add automatic pull request preview banner (#82)
Browse files Browse the repository at this point in the history
* feat: Add pull request preview notice

* clean: Adjust admonition title to explicitly mention "pull request"
  • Loading branch information
Paulo Ribeiro authored May 10, 2023
1 parent 4bdedc3 commit 326cc64
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 27 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions material/assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.17d77c1b.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.17d77c1b.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.57114a05.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.57114a05.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.5845d53c.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.5845d53c.min.js.map",
"assets/stylesheets/main.css": "assets/stylesheets/main.d593da4b.min.css",
"assets/stylesheets/main.css.map": "assets/stylesheets/main.d593da4b.min.css.map",
"assets/stylesheets/palette.css": "assets/stylesheets/palette.936ed772.min.css",
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.936ed772.min.css.map"
"assets/javascripts/bundle.js": "assets/javascripts/bundle.8bb3902f.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.8bb3902f.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.d7126665.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.d7126665.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.58d22e8e.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.58d22e8e.min.js.map",
"assets/stylesheets/main.css": "assets/stylesheets/main.81d9994c.min.css",
"assets/stylesheets/main.css.map": "assets/stylesheets/main.81d9994c.min.css.map",
"assets/stylesheets/palette.css": "assets/stylesheets/palette.02542d12.min.css",
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.02542d12.min.css.map"
}
3 changes: 3 additions & 0 deletions material/assets/stylesheets/main.81d9994c.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material/assets/stylesheets/main.81d9994c.min.css.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions material/assets/stylesheets/main.d593da4b.min.css

This file was deleted.

1 change: 0 additions & 1 deletion material/assets/stylesheets/main.d593da4b.min.css.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.d593da4b.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.81d9994c.min.css' | url }}">
{% if palette.primary or palette.accent %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.936ed772.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.02542d12.min.css' | url }}">
{% endif %}
{% if palette.primary %}
{% import "partials/palette.html" as map %}
Expand Down Expand Up @@ -127,6 +127,17 @@
<div class="md-main__inner">
<div class="md-content">
<article class="md-content__inner md-typeset">
{% if config.extra.pull_request_preview %}
<div class="admonition important" style="margin-top:0">
<div class="admonition-title">This documentation is a preview of the pull request
<a href="{{ config.repo_url }}/pull/{{ config.extra.pull_request_preview }}">#{{ config.extra.pull_request_preview }}</a>
</div>
<p>
For the latest updates and improvements in production,
open <a href="https://docs.codacy.com/">docs.codacy.com</a> instead.
</p>
</div>
{% endif %}
{% if config.extra.self_hosted %}
<div class="admonition important" style="margin-top:0">
<div class="admonition-title">This documentation applies to Codacy Self-hosted
Expand Down Expand Up @@ -173,8 +184,8 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
</main>
</div>
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.57114a05.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.17d77c1b.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/vendor.d7126665.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.8bb3902f.min.js' | url }}"></script>
{%- set translations = {} -%}
{%- for key in [
"clipboard.copy",
Expand All @@ -198,7 +209,7 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
base: "{{ base_url }}",
features: {{ config.theme.features | tojson }},
search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.5845d53c.min.js' | url }}"
worker: "{{ 'assets/javascripts/worker/search.58d22e8e.min.js' | url }}"
}, typeof search !== "undefined" && search)
})
</script>
Expand Down
13 changes: 13 additions & 0 deletions src/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,19 @@
<div class="md-content">
<article class="md-content__inner md-typeset">

<!-- Pull request preview notice -->
{% if config.extra.pull_request_preview %}
<div class="admonition important" style="margin-top: 0">
<div class="admonition-title">This documentation is a preview of the pull request
<a href="{{ config.repo_url }}/pull/{{ config.extra.pull_request_preview }}">#{{ config.extra.pull_request_preview }}</a>
</div>
<p>
For the latest updates and improvements in production,
open <a href="https://docs.codacy.com/">docs.codacy.com</a> instead.
</p>
</div>
{% endif %}

<!-- Self-hosted notice -->
{% if config.extra.self_hosted %}
<div class="admonition important" style="margin-top: 0">
Expand Down

0 comments on commit 326cc64

Please sign in to comment.