Skip to content

Commit df4da0e

Browse files
committed
preview watermark
1 parent ca270a1 commit df4da0e

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

gulp.d/tasks/build-preview-pages.js

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const ASCIIDOC_ATTRIBUTES = {
4848
icons: 'font',
4949
sectanchors: '',
5050
'source-highlighter': 'highlight.js',
51+
'page-watermark': '2025-01-09 docs-sdk-nodejs add-preview-metadata',
52+
'page-show-preview-banner': true,
5153
}
5254

5355
module.exports =

preview-src/ui-model.yml

+1
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,6 @@ page:
176176
url: '#'
177177
urlType: 'internal'
178178
asciidoc:
179+
# attributes: defined in gulp.d
179180
extensions:
180181
- '@asciidoctor/tabs'

src/css/main.css

+13
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ main p {
4242
hyphens: auto; /* NOTE in Chrome, hyphens: auto is only supported on macOS and Android */
4343
}
4444

45+
main #watermark {
46+
position: fixed;
47+
font-size: 4em;
48+
opacity: 0.05;
49+
line-height: 1em;
50+
color: red;
51+
top: 50%;
52+
left: 50%;
53+
transform: translate(-50%, -50%) rotate(-90deg);
54+
z-index: -1;
55+
user-select: none;
56+
}
57+
4558
.article-banner {
4659
align-items: center;
4760
/* background: linear-gradient(to right, var(--color-brand-purple) 0%, var(--color-brand-light-blue) 100%); */

src/layouts/home.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{> head-last}}
77
</head>
88
<body class="home">
9+
910
{{> header}}
1011
{{> body-home}}
1112
{{> footer}}

src/partials/main.hbs

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
<main class="article" data-ceiling="topbar">
2+
0 vc{{#with page.attributes.watermark}}
3+
<div id="watermark">{{this}}</div>
4+
{{/with}}
5+
{{#if page.attributes.show-preview-banner}}
6+
<div class="article-banner">
7+
<i class="fas fa-cog"></i>
8+
<h2>{{#with page.attributes.watermark}}<tt>{{this}}</tt>
9+
{{else}}Preview{{/with}}</h2>
10+
<p>You are viewing a preview version of the documentation.</p>
11+
<p>Visit the <a href="{{ site.url }}/doctor/tree.html">preview landing page</a> for more details.</p>
12+
</div>
13+
{{/if}}
14+
215
{{#unless (or (ne page.attributes.hide-view-latest undefined) (eq page.componentVersion page.component.latest))}}
316
{{#with page.latest}}
417
{{#if ./missing}}

0 commit comments

Comments
 (0)