Skip to content
Permalink
Browse files
[JAMES-3294] Added the UI bundle for Antora
* We build the ui bundle locally
  • Loading branch information
ieugen committed Jul 12, 2020
1 parent 8c5d106 commit 20e11142413cffb163cdf20ed2142df1b44be13a
Showing 63 changed files with 366 additions and 3 deletions.
@@ -12,6 +12,7 @@ content:
# start_path: docs
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
url: ./../ui-bundle/build/distributions/ui-bundle.zip
start_path: ui-bundle
runtime:
fetch: true
fetch: true
@@ -3,6 +3,14 @@ plugins {
id 'com.github.node-gradle.node' version '2.2.4'
}

configurations {
antora
}

dependencies {
antora(project(path: ':ui-bundle', configuration: 'uiBundle'))
}

node {
// Version of node to use.
version = '12.18.2'
@@ -13,6 +21,7 @@ def siteOutputDir = "${buildDir}/site";

task generateDocs(type: NpxTask) {
dependsOn npmInstall
dependsOn ':ui-bundle:build'

inputs.files('package.json', 'package-lock.json', 'antora-playbook.yml')
inputs.dir(fileTree('node_modules').exclude('.cache'))
@@ -32,4 +41,4 @@ task buildSite() {
dependsOn generateDocs, copySomeFiles
}

tasks.build.dependsOn buildSite
tasks.build.dependsOn buildSite
@@ -1,3 +1,4 @@
rootProject.name = 'james-site'

include ':ui-bundle'
include ':doc-sites'
@@ -0,0 +1,8 @@
plugins {
id 'base'
id 'distribution'
}

distTar {
enabled = false
}

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
'use strict'

module.exports = (...args) => {
const numArgs = args.length
if (numArgs === 3) return args[0] && args[1]
if (numArgs < 3) throw new Error('{{and}} helper expects at least 2 arguments')
args.pop()
return args.every((it) => it)
}
@@ -0,0 +1,5 @@
'use strict'

const TAG_ALL_RX = /<[^>]+>/g

module.exports = (html) => html && html.replace(TAG_ALL_RX, '')
@@ -0,0 +1,3 @@
'use strict'

module.exports = (a, b) => a === b
@@ -0,0 +1,3 @@
'use strict'

module.exports = (value) => (value || 0) + 1
@@ -0,0 +1,3 @@
'use strict'

module.exports = (val) => !val
@@ -0,0 +1,9 @@
'use strict'

module.exports = (...args) => {
const numArgs = args.length
if (numArgs === 3) return args[0] || args[1]
if (numArgs < 3) throw new Error('{{or}} helper expects at least 2 arguments')
args.pop()
return args.some((it) => it)
}
@@ -0,0 +1,24 @@
'use strict'

const { posix: path } = require('path')

module.exports = (to, from, ctx) => {
if (!to) return '#'
// NOTE only legacy invocation provides both to and from
if (!ctx) from = (ctx = from).data.root.page.url
if (to.charAt() !== '/') return to
if (!from) return (ctx.data.root.site.path || '') + to
let hash = ''
const hashIdx = to.indexOf('#')
if (~hashIdx) {
hash = to.substr(hashIdx)
to = to.substr(0, hashIdx)
}
return to === from
? hash || (isDir(to) ? './' : path.basename(to))
: (path.relative(path.dirname(from + '.'), to) || '.') + (isDir(to) ? '/' + hash : hash)
}

function isDir (str) {
return str.charAt(str.length - 1) === '/'
}
@@ -0,0 +1,3 @@
'use strict'

module.exports = () => new Date().getFullYear().toString()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more.

Large diffs are not rendered by default.

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head defaultPageTitle='Page Not Found'}}
</head>
<body class="status-404">
{{> header}}
{{> body}}
{{> footer}}
</body>
</html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head defaultPageTitle='Untitled'}}
</head>
<body class="article{{#with (or page.attributes.role page.role)}} {{this}}{{/with}}">
{{> header}}
{{> body}}
{{> footer}}
</body>
</html>
@@ -0,0 +1,18 @@
<article class="doc">
{{#if (eq page.layout '404')}}
<h1 class="page">{{{or page.title 'Page Not Found'}}}</h1>
<div class="paragraph">
<p>The page you&#8217;re looking for does not exist. It may have been moved.</p>
</div>
<div class="paragraph">
<p>If you arrived on this page by clicking on a link, please notify the owner of the site that the link is broken.
If you typed the URL of this page manually, please double check that you entered the address correctly.</p>
</div>
{{else}}
{{#with page.title}}
<h1 class="page">{{{this}}}</h1>
{{/with}}
{{{page.contents}}}
{{/if}}
{{> pagination}}
</article>
@@ -0,0 +1,4 @@
<div class="body">
{{> nav}}
{{> main}}
</div>
@@ -0,0 +1,20 @@
<nav class="breadcrumbs" aria-label="breadcrumbs">
{{#if page.breadcrumbs}}
<ul>
{{#with page.componentVersion}}
{{#if (and ./title (not (or ./root (eq ./title @root.page.breadcrumbs.0.content))))}}
<li><a href="{{{relativize ./url}}}">{{{./title}}}</a></li>
{{/if}}
{{/with}}
{{#each page.breadcrumbs}}
<li>
{{~#if (and ./url (eq ./urlType 'internal'))~}}
<a href="{{{relativize ./url}}}">{{{./content}}}</a>
{{~else~}}
{{{./content}}}
{{~/if~}}
</li>
{{/each}}
</ul>
{{/if}}
</nav>
@@ -0,0 +1,4 @@
<footer class="footer">
<p>This page was built using the Antora default UI.</p>
<p>The source code for this UI is licensed under the terms of the MPL-2.0 license.</p>
</footer>
@@ -0,0 +1,2 @@
<script src="{{uiRootPath}}/js/site.js"></script>
<script async src="{{uiRootPath}}/js/vendor/highlight.js"></script>
@@ -0,0 +1,2 @@
{{> footer-content}}
{{> footer-scripts}}
@@ -0,0 +1 @@
{{!-- <link rel="icon" href="{{uiRootPath}}/img/favicon.ico" type="image/x-icon"> --}}
@@ -0,0 +1,20 @@
{{#with page.canonicalUrl}}
<link rel="canonical" href="{{this}}">
{{/with}}
{{#unless (eq page.attributes.pagination undefined)}}
{{#with page.previous}}
<link rel="prev" href="{{{relativize ./url}}}">
{{/with}}
{{#with page.next}}
<link rel="next" href="{{{relativize ./url}}}">
{{/with}}
{{/unless}}
{{#with page.description}}
<meta name="description" content="{{this}}">
{{/with}}
{{#with page.keywords}}
<meta name="keywords" content="{{this}}">
{{/with}}
{{#with (or antoraVersion site.antoraVersion)}}
<meta name="generator" content="Antora {{this}}">
{{/with}}
@@ -0,0 +1 @@
{{!-- Add additional meta tags here --}}
@@ -0,0 +1,2 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
@@ -0,0 +1,4 @@
{{#with site.keys.googleAnalytics}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{this}}"></script>
<script>function gtag(){dataLayer.push(arguments)};window.dataLayer=window.dataLayer||[];gtag('js',new Date());gtag('config','{{this}}')</script>
{{/with}}
@@ -0,0 +1 @@
<link rel="stylesheet" href="{{uiRootPath}}/css/site.css">
@@ -0,0 +1 @@
<title>{{{detag (or page.title defaultPageTitle)}}}{{#with site.title}} :: {{this}}{{/with}}</title>
@@ -0,0 +1,7 @@
{{> head-prelude}}
{{> head-title}}
{{> head-info}}
{{> head-styles}}
{{> head-meta}}
{{> head-scripts}}
{{> head-icons}}
@@ -0,0 +1,46 @@
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="{{or site.url (or siteRootUrl siteRootPath)}}">{{site.title}}</a>
<!--button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button-->
</div>
<!--div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="#">Home</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Products</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">Product A</a>
<a class="navbar-item" href="#">Product B</a>
<a class="navbar-item" href="#">Product C</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Services</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">Service A</a>
<a class="navbar-item" href="#">Service B</a>
<a class="navbar-item" href="#">Service C</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Resources</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="#">Resource A</a>
<a class="navbar-item" href="#">Resource B</a>
<a class="navbar-item" href="#">Resource C</a>
</div>
</div>
<div class="navbar-item">
<span class="control">
<a class="button is-primary" href="#">Download</a>
</span>
</div>
</div>
</div-->
</nav>
</header>
@@ -0,0 +1 @@
{{!-- Add header scripts here --}}
@@ -0,0 +1,2 @@
{{> header-scripts}}
{{> header-content}}
@@ -0,0 +1,7 @@
<main class="article">
{{> toolbar}}
<div class="content">
{{> article}}
{{> toc}}
</div>
</main>
@@ -0,0 +1,24 @@
<div class="nav-panel-explore{{#unless page.navigation}} is-active{{/unless}}" data-panel="explore">
{{#if page.component}}
<div class="context">
<span class="title">{{page.component.title}}</span>
<span class="version">{{page.componentVersion.displayVersion}}</span>
</div>
{{/if}}
<ul class="components">
{{#each site.components}}
<li class="component{{#if (eq this @root.page.component)}} is-current{{/if}}">
<span class="title">{{{./title}}}</span>
<ul class="versions">
{{#each ./versions}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latestVersion)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">{{./displayVersion}}</a>
</li>
{{/each}}
</ul>
</li>
{{/each}}
</ul>
</div>
@@ -0,0 +1,10 @@
{{#with page.navigation}}
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
{{#with @root.page.componentVersion}}
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>
{{/with}}
{{> nav-tree navigation=this}}
</nav>
</div>
{{/with}}
@@ -0,0 +1 @@
<button class="nav-toggle"></button>