Skip to content

Remote Hosting

calebwaldorf edited this page Dec 14, 2019 · 2 revisions

Remote Hosting

Below are examples of how b-ber projects can be hosted remotely. This not meant to be an exhaustive list, but rather to demonstrate a few different approaches that can be taken to publish b-ber projects online.

Uploading b-ber projects to a server using FTP

  1. Install an FTP manager. (FileZilla or Cyberduck.)

  2. Update the config.yml file to point at the your domain, which will be passed in later. Note that the filenames for the EPUB and Mobi builds will be the value of the identifier field in metadata.yml

# config.yml
base_path: /
reader_url: https://example.com
remote_url: https://example.com
downloads:
  - label: Download as Epub
    title: b-ber All Directives Demo
    url: >-
      https://example.com/a16c595e6b08d4d86bf3854b982cd8d6acf74c5a.epub
  - label: Download as Mobi
    title: b-ber All Directives Demo
    url: >-
      https://example.com/a16c595e6b08d4d86bf3854b982cd8d6acf74c5a.mobi
  1. Build a Reader version of the project and any other output formats that you'd like to make available to download.
$ bber build reader epub mobi
  1. Open your FTP manager and login to your remote host.

  2. Navigate to your public folder, which is typically named public_html.

  3. Upload the contents of the project-reader directory to the public folder.

  4. Upload the builds that you would like to make available for download into the same folder.

Hosting b-ber projects on Surge.sh

Surge.sh offers free hosting and the ability to upload files on the command line.

  1. Install the Surge CLI tool
$ npm i --global surge
  1. Update the config.yml file to point at the Surge domain which will be passed in later. Note that the filenames for the EPUB and Mobi builds will be the value of the identifier field in metadata.yml
# config.yml
base_path: /
reader_url: http://b-ber-all-directives-demo.surge.sh
remote_url: http://b-ber-all-directives-demo.surge.sh
downloads:
  - label: Download as Epub
    title: b-ber All Directives Demo
    url: >-
      http://b-ber-all-directives-demo.surge.sh/a16c595e6b08d4d86bf3854b982cd8d6acf74c5a.epub
  - label: Download as Mobi
    title: b-ber All Directives Demo
    url: >-
      http://b-ber-all-directives-demo.surge.sh/a16c595e6b08d4d86bf3854b982cd8d6acf74c5a.mobi
  1. Build a Reader version of the project and any other output formats that you'd like to make available to download.
$ bber build reader epub mobi
  1. Copy the assets that you would like to make downloadable to the project-reader directory.
$ cp *.epub *.mobi ./project-reader
  1. Deploy the project using the Surge CLI tool, passing in the desired domain.
$ surge --domain b-ber-all-directives-demo.surge.sh ./project-reader

A demo of a b-ber project deployed to Surge, can found here.

Clone this wiki locally