Commit afb8265a authored by Yann Dupont's avatar Yann Dupont
Browse files

Merge remote-tracking branch 'upstream/master'

parents 7d51823e eb83a5b9
Pipeline #22455 passed with stages
in 2 minutes and 22 seconds
......@@ -54,7 +54,7 @@ Read on to learn how to customize the default UI for your own documentation.
== Development Quickstart
This section offers a basic tutorial to teach you how to set up the default UI project, preview it locally, and bundle it for use with Antora.
A more comprehensive can be found in the documentation at {url-antora-docs}.
A more comprehensive tutorial can be found in the documentation at {url-antora-docs}.
=== Prerequisites
......
......@@ -99,6 +99,9 @@ Properties include name (since 2.3), version, displayVersion, prerelease (if set
| page.module
| The name of the module for the current page.
| page.relativeSrcPath
| The path of the current page relative to the pages directory in the current module (since 2.3).
| page.version
| The name of the version for the current page.
......@@ -149,7 +152,7 @@ A quick way to force this property to be `true` (even if the repository is publi
Then, the "Edit the Page" link will not appear.
| page.home
| Indicates whether the current page is the home page of the site.
| Indicates whether the current page is the start (aka home) page of the site.
| page.layout
| The page layout for the current page.
......
'use strict'
const log = require('fancy-log')
const { obj: map } = require('through2')
const PluginError = require('plugin-error')
const prettierEslint = require('prettier-eslint')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
module.exports = () => {
const report = { changed: 0, unchanged: 0 }
......
......@@ -9,11 +9,12 @@ Error.call = (self, ...args) => {
const asciidoctor = require('asciidoctor.js')()
const fs = require('fs-extra')
const handlebars = require('handlebars')
const { obj: map } = require('through2')
const merge = require('merge-stream')
const ospath = require('path')
const path = ospath.posix
const requireFromString = require('require-from-string')
const { Transform } = require('stream')
const map = (transform = () => {}, flush = undefined) => new Transform({ objectMode: true, transform, flush })
const vfs = require('vinyl-fs')
const yaml = require('js-yaml')
......@@ -62,7 +63,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
})
)
.pipe(vfs.dest(previewDest))
.on('error', (e) => done)
.on('error', done)
.pipe(sink())
)
......
......@@ -7,7 +7,6 @@ const concat = require('gulp-concat')
const cssnano = require('cssnano')
const fs = require('fs-extra')
const imagemin = require('gulp-imagemin')
const { obj: map } = require('through2')
const merge = require('merge-stream')
const ospath = require('path')
const path = ospath.posix
......@@ -16,6 +15,8 @@ const postcssCalc = require('postcss-calc')
const postcssImport = require('postcss-import')
const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const uglify = require('gulp-uglify')
const vfs = require('vinyl-fs')
......@@ -75,7 +76,7 @@ module.exports = (src, dest, preview) => () => {
})
.bundle((bundleError, bundleBuffer) =>
Promise.all(mtimePromises).then((mtimes) => {
const newestMtime = mtimes.reduce((max, curr) => (!max || curr > max ? curr : max))
const newestMtime = mtimes.reduce((max, curr) => (curr > max ? curr : max), file.stat.mtime)
if (newestMtime > file.stat.mtime) file.stat.mtimeMs = +(file.stat.mtime = newestMtime)
if (bundleBuffer !== undefined) file.contents = bundleBuffer
file.path = file.path.slice(0, file.path.length - 10) + '.js'
......@@ -95,7 +96,7 @@ module.exports = (src, dest, preview) => () => {
// NOTE use this statement to bundle a JavaScript library that cannot be browserified, like jQuery
//vfs.src(require.resolve('<package-name-or-require-path>'), opts).pipe(concat('js/vendor/<library-name>.js')),
vfs
.src('css/site.css', { ...opts, sourcemaps })
.src(['css/site.css', 'css/vendor/*.css'], { ...opts, sourcemaps })
.pipe(postcss((file) => ({ plugins: postcssPlugins, options: { file } }))),
vfs.src('font/*.{ttf,woff*(2)}', opts),
vfs
......
'use strict'
const fs = require('fs-extra')
const { obj: map } = require('through2')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const vfs = require('vinyl-fs')
module.exports = (files) => () =>
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ Vis no velit audiam, sonet <<dependencies,praesent>> eum ne.
Integer diam enim, dignissim eget eros et, ultricies mattis odio.
Vestibulum consectetur nec urna a luctus.
Quisque pharetra tristique arcu fringilla dapibus.
Curabitur ut massa aliquam, cursus enim et, accumsan lectus.
https://example.org[Curabitur,role=unresolved] ut massa aliquam, cursus enim et, accumsan lectus.
== Cu solet
......
......@@ -18,7 +18,7 @@ site:
latestVersion: *latest_version_abc
- &component
name: xyz
title: Project XYZ
title: &component_title Project XYZ
url: /xyz/6.0/index.html
versions:
- &latest_version_xyz
......@@ -26,6 +26,7 @@ site:
version: '6.0'
displayVersion: '6.0'
- &component_version
title: *component_title
url: '#'
version: '5.2'
displayVersion: '5.2'
......@@ -60,6 +61,7 @@ page:
version: '5.2'
displayVersion: '5.2'
module: ROOT
relativeSrcPath: index.adoc
editUrl: http://example.com/project-xyz/blob/master/index.adoc
origin:
private: false
......@@ -94,9 +96,6 @@ page:
url: '#'
navigation:
- root: true
content: Project XYZ
url: '#'
urlType: fragment
items:
- content: Quickstart
url: '#'
......
......@@ -3,7 +3,7 @@
font-style: normal;
font-weight: 400;
src:
local("Roboto Mono"),
local("Roboto Mono Regular"),
local("RobotoMono-Regular"),
url(~typeface-roboto-mono/files/roboto-mono-latin-400.woff2) format("woff2"),
url(~typeface-roboto-mono/files/roboto-mono-latin-400.woff) format("woff");
......
......@@ -2,7 +2,7 @@
{{#if page.breadcrumbs}}
<ul>
{{#with page.componentVersion}}
{{#if (and ./title (not (or ./root (eq ./title @root.page.breadcrumbs.0.content))))}}
{{#if (and ./title (not (eq ./title @root.page.breadcrumbs.0.content)))}}
<li><a href="{{{relativize ./url}}}">{{{./title}}}</a></li>
{{/if}}
{{/with}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment