main.js
/**
   * generates the card HTML
   * @return {TemplateResult}
   */
generates the card HTML
@return {TemplateResult}
generates the card HTML @return { TemplateResult }
render() {
    moment.locale(this.hass.language);
    const entities = this.getEntityData();
    const posts = this.getAllPosts(entities);
    const postTemplates = posts.map((post) => {
      const subredditLink = `${this.redditUrl}/r/${post.subreddit}`;
      return html`
        <div class='post'>
          <a href='${post.url}' class='post-title' target='${this.target}'>${post.title}</a>
          <div class='post-details'>
            <div class='post-score'>${this.kFormatter(post.score)}</div>
            <a href='${subredditLink}' class='post-subreddit' target='${this.target}'>${post.subreddit}</a>
            <div class='post-time'>${this.timeAgoFormatter(post.created)}</div>
            <a href='${subredditLink}/comments/${post.id}' class='post-comments' target='${this.target}'>${post.comms_num} comments</a>
          </div>
        </div>
      `;
    });
    return html`
      <ha-card>
        ${this.createHeader(entities)}
        <div class='posts'>
          ${postTemplates}
        </div>
      </ha-card>
    `;
  }
render ( ) { moment . locale ( this . hass . language ) ; const entities = this . getEntityData ( ) ; const posts = this . getAllPosts ( entities ) ; const postTemplates = posts . map ( ( post ) => { const subredditLink = ` ${ this . redditUrl } ${ post . subreddit } ` ; return html ` ${ post . url } ${ this . target } ${ post . title } ${ this . kFormatter ( post . score ) } ${ subredditLink } ${ this . target } ${ post . subreddit } ${ this . timeAgoFormatter ( post . created ) } ${ subredditLink } ${ post . id } ${ this . target } ${ post . comms_num } ` ; } ) ; return html ` ${ this . createHeader ( entities ) } ${ postTemplates } ` ; }
generates the card HTML
 @return {TemplateResult}
generates the card HTML @return { TemplateResult }