-
Notifications
You must be signed in to change notification settings - Fork 1
Configuring the build
The build configuration is set in the config.yml
file in a project's root directory. Supported options are outlined below.
The env
is the current build environment.
development
The theme
is the name of the current theme, which must map to a name of a directory in the themes
directory.
b-ber-theme-serif
The src
is the name of the source directory.
_project
The dist
is the prefix for the name of the build directory. When building an EPUB, the output directory name will be project-epub
.
project
Define whether b-ber-reader should cache CSS in localStorage
.
true
The ibooks_specified_fonts
option allows for custom fonts to be set as the default in applications that support this feature in the content.opf
.
false
The themes_directory
defines the location of the themes directory for third-party themes.
./themes
The autoprefixer_options
defines the Autoprefixer options to be used when parsing SCSS. More information can be found in the postcss Autoprefixer repository.
browsers:
- 'last 2 versions'
- '> 2%'
flexbox: no-2009
The ignore
provides an option to ignore specific files or folders, which can useful when used with build-specific configuration files for omitting unneeded assets.
[]
The base_url
is the URL to map assets to during the web
build.
http://localhost:4000/
The base_path
is the path that will be appended to the URL for the reader
build.
/
The remote_url
is the URL where the project is hosted for the reader
build.
http://localhost:4000/
The reader_url
is the URL where the remote reader
build is located.
http://localhost:4000/project-reader
The bucket_url
is the S3 bucket URL where the remote project is located, which is used during the deploy
task.
null
A robots
meta tag is added to the XHTML during web
and reader
builds. Setting this option to true
will set the this meta tags content to nofollow,noidex
.
false
The downloads
key defines the downloads that are available in the Reader's dropdown menu. The dropdown menu will be populated from the following keys in each entry in the downloads
array:
url
label
description
[]
The remote_javascripts
is the location of any remotely hosted JavaScript files. The URLs added here will be injected into the HTML before the closing body
tag.
null
The remote_stylesheets
is the location of any remotely hosted stylesheets. The URLs added here will be injected into the HTML's head
element.
null
The ui_options
define the UI display settings for header
and footer
navigation icons in the reader
build. The object labels accept boolean values.
navigation:
header_icons:
home: true
toc : true
downloads : true
info: true
footer_icons:
page : true
chapter : true
The group_footnotes
option will control if the footnotes counter is reset for each chapter. Defaults to true
, which causes the footnote numbers to be reset for each chapter. Setting it to false
will not reset the counter on each chapter.
true
A sample configuration file is below that can be used as a template:
# ------------------------------------------------------------------------------
# Build Settings
# ------------------------------------------------------------------------------
# Minify and uglify scripts and stylesheets for production
env: development
# ------------------------------------------------------------------------------
# File System Settings
# ------------------------------------------------------------------------------
# Location of the source directory which contains all project assets
src: _project
# Output directory for the compiled project
dist: project
# Cache assets for b-ber-reader
cache: true
# Ignored files or folders
ignore:
- _project/_fonts/
- _project/_images/my-image.jpg
# Remotly hosted assets to be injected into builds
remote_javascripts:
- https://my-analytics.js
remote_stylesheets:
- https://my-remote-styles-1.css
- https://my-remote-styles-2.css
# ------------------------------------------------------------------------------
# Display Settings
# ------------------------------------------------------------------------------
# Selected theme name. Show installed themes by running `bber theme list`
theme: b-ber-theme-serif
# Directory where user themes are stored
themes_directory: ./themes
# iBooks setting for enabling third-party fonts
ibooks_specified_fonts: false
# Autoprefixer. See complete list of options here: https://github.com/postcss/autoprefixer#options
autoprefixer_options:
browsers:
- 'last 2 versions'
- '> 2%'
flexbox: no-2009
# Show or hide various UI buttons for the reader build
ui_options:
navigation:
header_icons:
home: true
toc : true
downloads : true
info: true
footer_icons:
page : true
chapter : true
group_footnotes: true
# ------------------------------------------------------------------------------
# Deployment Settings
# ------------------------------------------------------------------------------
# Add a no-follow tag to the web build for private projects.
private: false
# Location of assets for the web build. This is necessary since the web build is
# a static website, and requires correct remote path names to load assets.
base_url: /demos/my-project
# Path that will be prepended to the URL when rendering the reader. This is
# useful for creating logical URL structures in an existing application, e.g.,
# on a website hosting projects, the `base_path` could be changed to `/project` so
# that all reader projects are served at `/project/my-project`.
base_path: /demos/my-project
# Location of the remotely hosted project.
remote_url: https://s3.amazonaws.com/my-bucket/my-object
# Location of the reader directory in the remotely hosted project.
reader_url: https://s3.amazonaws.com/my-bucket/my-object/project-reader
# Location of the S3 bucket where a build is hosted. This is used during the `bber deploy`.
bucket_url: s3://my-bucket/my-object
remote_url: https://example.com/
# URLs for remote downloads. These are available to download in the web and reader interfaces
downloads:
-
url: https://s3.amazonaws.com/my-bucket/my-object/my-project.epub
label: My Project (EPUB Version)
description: Download the EPUB here
-
url: https://s3.amazonaws.com/my-bucket/my-object/my-project.pdf
label: My Project (PDF Version)
description: Download the PDF here
- Adding metadata
- Creating content
- Generating new content
- Authoring and editing content
- Reading order (Table of Contents)
- Configuring the build
- Adding a cover image
- All directives
- Text
- Media
- Misc