1.0.0 • Published 4 years ago

quintype-ace v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Ahead

Ahead is a standardized content representation framework application built using Malibu as a starting point.

Initial Collection setup

  • We need a home collection whose name can be anything, but the slug mandatorily has to be home.
  • This home collection will hold all the collections('child collections' in our nomenclature) that will appear on home page.
  • Only stories added to these child collections will be displayed in the home page. Any collections added within these child collections will be ignored unless the layout in use supports it.
  • The layout of each collection on homepage will be decided based on the associated metadata called layout set using the manage button against each collection. Right now, this option is a text field. This will be moved to a Page Builder application later, thus keep Bold, as the raw data source while Page Builder becomes the configuration management tool for all content representation on the front-end. Until then, the values available are visible on /template-options.json
  • The default value for a collection when not explicitly set, will be ThreeCol layout.

Infinite Scroll on story pages.

The infinite scroll on story pages are driven through a collection with the slug curated-story-list. The name could be anything. This collection could either be manual or automated. The infinite scroll will behave as per the nature of the collection.

Publisher Themes

Madrid uses theme_attributes to decide how to render things. This is available via config"theme-attributes" wherever config is available in madrid (both server and client).

The theme_attributes comes from a few places (it merges the following, in decreasing order of priority):

  • The domains section within a publisher_theme
  • The publisher_theme portion of config/publisher.yml (based on the publisher name)
  • The theme-attributes column in the editor database (comes via /api/v1/config as theme-attributes)

It is possible to download the config by appending #secret-mode to any page on the site, then uploading it via the editor. Two fields are removed from the download: override_layouts and domains.

toddy-libs

IMPORTANT: This app implements very little functionality in the app itself. The majority of functionality is built into the toddy-libs repository.

Running with supervisord (local)

$ brew install supervisord
$ ./run

Working on the service worker

Unfortunately, the service-worker cannot be run with the asset-server. Thus, the service worker is disabled in development mode. To work on the service worker, run

$ vi app/client/app.js         # remove the check for process.env.NODE_ENV == 'production'
$ vi config/publisher.yml      # remove the asset_host from publisher.yml
$ npm run compile && npm start # restart this if you change the service worker

Tasks Pending

  • Minify JS
  • Add SASS support
  • Add Components
  • Load Data
  • Isomorphic Rendering
  • Get CORS working with ServiceWorker (possibly fix black knight)
  • Get Preview to work
  • Get breaking news to work
  • Actually build a simple UI
  • Forcibly update the app when updates
  • Actual Benchmarks
  • Move all actual code into a library so people can't screw around
  • Not Found Handler
  • Valid Route, but data not found
  • SEO Stuff
  • Analytics stuff

Note:

  1. We should change the configuration in production black knight as below to enable mapping to different publishers to their own itsman.
asset_host: https://fea.quintype.com
host_to_api_host:
  "madrid.quintype.io": "quintype-demo.internal.quintype.io"
  "www.dyingtheartof.com": "dyingtheartof.internal.quintype.io"
host_to_automatic_api_host:
  - "-web"
  - ".madrid"
sketches_host: http://quintype-demo.internal.quintype.io
  1. Google Analytics ID and GTM ID should be served from the config ( publisher.yml file ) from appropriate publisher object, like all other values.
...
samachara:
    monogram: <monogram_url>
    logo: <logo_url>
    primary_color: "#2f73e4"
    secondary_color: "#a3a3a3"
    header_text_color: "#404040"
    header_background_color: "#FFF"
    footer_text_color: "#FFF"
    footer_background_color: "#000"
    dfp_network_id: '60988533'
    gtm_id: 'GTM-M7935QR'
    google_analytics_id: 'UA-72244642-1'
...
  1. To show a static page, you have to add a value (say AboutUs) in the static_pages array of the publisher in publisher_theme. And you have to add an object in static-page-html.js file in the Black Knight config with the same key (AboutUs in this case) mapped to corresponding HTML content. (Check the isomorphic/components/constants.js file if you want to support a new static page altogether. (NOTE: All these should change once itsman starts supporting static pages. Until then... :( )

To Enable OneSignal Push Notifications

Add one_signal_app_id and one_signal_apple_app_id to theme_attributes array in the database

To Disable ad's using query param

Appending a query parameter disableAds=true will disable ad slots and gtm / ga scripts rendering for the particular request

Eg: http://localhost:3000/?disableAds=true

Bundle visualization

Run NODE_ENV=production ANALYZE_STATS=true npm run compile