<commit_before>module.exports = (options, callback)->
  {account, client, bongoModels, models} = options
  getStyles       = require './../styleblock'
  fetchScripts    = require './../scriptblock'
  getTitle        = require './../title'
  getGraphMeta    = require './../graphmeta'
  {argv}          = require 'optimist'
  {uri}           = require('koding-config-manager').load("main.#{argv.c}")

  entryPoint         = { slug : "koding", type: "group" }
  options.entryPoint = entryPoint

  prepareHTML = (scripts, socialApiData)->
    if socialApiData
      {navigated} = socialApiData
      {slug, data:{message}} = navigated

      if message
        {body} = message
        summary = body.slice(0, 80)
        title = "#{summary} | Koding Community"

      url = if uri?.address then uri.address else "https://koding.com/"
      shareUrl = "#{url}/#{slug}"

    """
    <!doctype html>
    <html lang="en">
    <head>
      #{getTitle title: title }
      #{getGraphMeta shareUrl: shareUrl, body: body}
      #{getStyles()}
    </head>
    <body class='logged-in'>
<commit_msg>social: add navigated defensive check for rendering loggedin home page<commit_after>module.exports = (options, callback)->
  {account, client, bongoModels, models} = options
  getStyles       = require './../styleblock'
  fetchScripts    = require './../scriptblock'
  getTitle        = require './../title'
  getGraphMeta    = require './../graphmeta'
  {argv}          = require 'optimist'
  {uri}           = require('koding-config-manager').load("main.#{argv.c}")

  entryPoint         = { slug : "koding", type: "group" }
  options.entryPoint = entryPoint

  prepareHTML = (scripts, socialApiData)->
    if socialApiData?.navigated?
      {navigated} = socialApiData

      {slug, data:{message}} = navigated

      if message
        {body} = message
        summary = body.slice(0, 80)
        title = "#{summary} | Koding Community"

      url = if uri?.address then uri.address else "https://koding.com/"
      shareUrl = "#{url}/#{slug}"

    """
    <!doctype html>
    <html lang="en">
    <head>
      #{getTitle title: title }
      #{getGraphMeta shareUrl: shareUrl, body: body}
      #{getStyles()}
    </head>
    <body class='logged-in'>

{'fraction_non_alphanumeric': 0.15611061552185548, 'fraction_numerical': 0.0026761819803746653, 'mean_word_length': 2.5156739811912225, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3433789', 'n_tokens_mistral': 693, 'n_tokens_neox': 690, 'n_words': 167}