Hierarchy

  • GraphicsPublisher

Constructors

Methods

Constructors

  • Parameters

    • options: {
          distDir: string;
          packDir: string;
          assetsDir: string;
          imagesDir: string;
          localesDir: string;
          packLocale: string;
          packMetadataFile: string;
          packTitleProp: string;
          packDescriptionProp: string;
      } = defaultOptions
      • distDir: string

        Relative path to the directory where your page builder will build your source files.

        • The dist directory must have an index.html file at its root, which includes an og:image metatag (used to create a preview image for the graphics pack).
        • All static assets must be included in a separate root-level directory inside the dist folder, e.g., cdn/ below, and must be absolutely referenced from any HTML page in the project.
        • All embeddable graphic pages must be contained in a root-level directory named embeds/ and placed in folders representing a valid locale code and a unique slug within that locale, e.g., en/chart/index.html below.
        • Additional pages can be named whatever they need to be as long as they don't collide with embeds or the static assets directory.
        📂 dist/
        📂 cdn/
        📂 js/
        - ...
        📂 css/
        - ...
        📂 images/
        - ...
        - index.html
        📂 a-second-page/
        - index.html
        📂 embeds/
        📂 en/
        📂 chart/
        - index.html

        Default Value

        dist

      • packDir: string

        Relative path to a temporary directory where the publisher can create the zip archives that make up the graphics pack for the RNGS server.

        📂 graphics-pack/
        - public.zip
        - media-en-chart.zip
        - media-en-map.zip

        Default Value

        graphics-pack

      • assetsDir: string

        Relative path to a media assets directory containing flat JPG and EPS files that will be included with the media editions uploaded to the RNGS server. They must be structured using the same directory scheme as embeds in the dist directory -- a folder for a valid locale and for a unique slug within the locale. The JPG and EPS filenames can be whatever you want them to be.

        📂 media-assets/
        📂 en/
        📂 chart/
        - chart.eps
        - chart.jpg
        📂 map/
        - my-map.eps
        - map-preview.jpg

        If you have an embeddable page using the same locale/slug scheme as a set of flat assets, the publisher will upload the JPG and EPS file with the embeddable version of the same graphic.

        📂 dist/
        📂 embeds/
        📂 en/
        📂 chart/
        - index.html
        📂 media-assets/
        📂 en/
        📂 chart/
        - chart.eps
        - chart.jpg
        📂 graphics-pack/
        - media-en-chart.zip # 👈 Contains both embeddable graphic and flats

        Default Value

        media-assets

      • imagesDir: string

        Relative path to an images directory containing at least the share image referenced in the metatag in the root index.html file in the dist directory.

        📂 src/
        📂 statics/
        📂 images/
        - share-card.jpg

        Default Value

        src/statics/images

      • localesDir: string

        Relative path to a locales directory containing structured data used to translate the content of your page. The publisher assumes this directory has sub-directories named using a valid locale code, including at least the default locale code for the pack (packLocale, usually 'en').

        Otherwise, the publisher assumes one JSON file (packMetadataFile) within this default locale sub-directory contains a title (packTitleProp) and description (packDescriptionProp) for the pack.

        📂 locales/
        📂 en/
        - content.json

        Default Value

        locales

      • packLocale: string

        Default local of the pack. Must correspond to a directory inside the localesDir.

        Default Value

        en

      • packMetadataFile: string

        Name of the JSON file inside {localesDir}/{packLocale} that contains SEO metadata.

        Default Value

        content.json

      • packTitleProp: string

        Property within the packMetadataFile that contains the SEO title for the page.

        Default Value

        SEOTitle

      • packDescriptionProp: string

        Property within the packMetadataFile that contains the SEO description for the page.

        Default Value

        SEODescription

    Returns GraphicsPublisher

Methods

  • Upload a preview of your project to S3.

    Returns Promise<void>

  • Upload your project to the RNGS server.

    Parameters

    • opts: {
          warnImageSize: number;
          fast: boolean;
      } = defaultUploadOptions

      Upload options

      • warnImageSize: number

        Size in kb above which you will be prompted to resize an image.

        Default Value

        200
        
      • fast: boolean

        Upload just the public version of the graphics pack, skipping media editions.

        Default Value

        false
        

    Returns Promise<void>

  • Publish your project in the RNGS server. (Must upload project first!)

    Returns Promise<void>

Generated using TypeDoc