nodebb-theme-persona 12.1.16 → 12.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/library.js CHANGED
@@ -98,12 +98,13 @@ library.getThemeConfig = async function (config) {
98
98
 
99
99
  library.addUserToTopic = async function (hookData) {
100
100
  const settings = await meta.settings.get('persona');
101
+ const { templateData } = hookData;
101
102
  if (settings.enableQuickReply === 'on') {
102
103
  if (hookData.req.user) {
103
104
  const userData = await user.getUserData(hookData.req.user.uid);
104
- hookData.templateData.loggedInUser = userData;
105
+ templateData.loggedInUser = userData;
105
106
  } else {
106
- hookData.templateData.loggedInUser = {
107
+ templateData.loggedInUser = {
107
108
  uid: 0,
108
109
  username: '[[global:guest]]',
109
110
  picture: user.getDefaultAvatar(),
@@ -113,6 +114,13 @@ library.addUserToTopic = async function (hookData) {
113
114
  }
114
115
  }
115
116
 
117
+ // add author field to topic if its missing
118
+ if (!templateData.hasOwnProperty('author')) {
119
+ templateData.author = await user.getUserFields(templateData.uid, [
120
+ 'username', 'userslug',
121
+ ]);
122
+ }
123
+
116
124
  return hookData;
117
125
  };
118
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "12.1.16",
3
+ "version": "12.1.17",
4
4
  "nbbpm": {
5
5
  "compatibility": "^2.0.0"
6
6
  },
@@ -119,7 +119,7 @@
119
119
  <!-- IF ../deauthUrl -->
120
120
  <a data-component="{../component}" class="btn btn-default btn-xs pull-right" href="{../deauthUrl}">[[user:sso.dissociate]]</a>
121
121
  <!-- END -->
122
- <a data-component="{../component}" href="{../url}" target="<!-- IF ../associated -->_blank<!-- ELSE -->_top<!-- ENDIF ../associated -->">
122
+ <a data-component="{../component}" href="{{{ if ./url }}}{./url}{{{ else }}}#{{{ end }}}" target="<!-- IF ../associated -->_blank<!-- ELSE -->_top<!-- ENDIF ../associated -->">
123
123
  <!-- IF ../icon --><i class="fa {../icon}"></i><!-- ENDIF ../icon -->
124
124
  <!-- IF ../associated -->[[user:sso.associated]]<!-- ELSE -->[[user:sso.not-associated]]<!-- ENDIF ../associated -->
125
125
  {../name}
@@ -74,7 +74,7 @@
74
74
 
75
75
  <!-- IF websiteName -->
76
76
  <span>[[user:website]]</span>
77
- <strong><a href="{websiteLink}" rel="nofollow noopener noreferrer">{websiteName}</a></strong>
77
+ <strong><a href="{websiteLink}" rel="nofollow noreferrer me">{websiteName}</a></strong>
78
78
  <!-- ENDIF websiteName -->
79
79
 
80
80
  <!-- IF location -->
@@ -1,11 +1,11 @@
1
- <!-- IF ../isSection -->
2
- {../name}
3
- <!-- ELSE -->
4
- <!-- IF ../link -->
5
- <a href="{../link}" itemprop="url">
6
- <!-- ELSE -->
7
- <a href="{config.relative_path}/category/{../slug}" itemprop="url">
8
- <!-- ENDIF ../link -->
9
- {../name}
10
- </a>
1
+ <!-- IF ../isSection -->
2
+ {../name}
3
+ <!-- ELSE -->
4
+ <!-- IF ../link -->
5
+ <a href="{../link}" itemprop="url">
6
+ <!-- ELSE -->
7
+ <a href="{config.relative_path}/category/{../slug}" itemprop="url">
8
+ <!-- ENDIF ../link -->
9
+ {../name}
10
+ </a>
11
11
  <!-- ENDIF ../isSection -->
@@ -15,8 +15,10 @@
15
15
  </div>
16
16
 
17
17
  <small class="pull-left">
18
- <strong>
19
- <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->" itemprop="author" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.displayname}</a>
18
+ <strong itemprop="author" itemscope itemtype="https://schema.org/Person">
19
+ <meta itemprop="name" content="{./user.username}">
20
+ {{{ if ./user.userslug }}}<meta itemprop="url" content="{config.relative_path}/user/{./user.userslug}">{{{ end }}}
21
+ <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.displayname}</a>
20
22
  </strong>
21
23
 
22
24
  <!-- IMPORT partials/topic/badge.tpl -->
@@ -4,7 +4,18 @@
4
4
  {{{end}}}
5
5
  </div>
6
6
  <div class="row">
7
- <div class="topic <!-- IF widgets.sidebar.length -->col-lg-9 col-sm-12<!-- ELSE -->col-lg-12<!-- ENDIF widgets.sidebar.length -->">
7
+ <div class="topic <!-- IF widgets.sidebar.length -->col-lg-9 col-sm-12<!-- ELSE -->col-lg-12<!-- ENDIF widgets.sidebar.length -->" itemid="{url}" itemscope itemtype="https://schema.org/DiscussionForumPosting">
8
+ <meta itemprop="headline" content="{escape(titleRaw)}">
9
+ <meta itemprop="text" content="{escape(titleRaw)}">
10
+ <meta itemprop="url" content="{url}">
11
+ <meta itemprop="datePublished" content="{timestampISO}">
12
+ <meta itemprop="dateModified" content="{lastposttimeISO}">
13
+ <div itemprop="author" itemscope itemtype="https://schema.org/Person">
14
+ <meta itemprop="name" content="{author.username}">
15
+ {{{ if author.userslug }}}<meta itemprop="url" content="{config.relative_path}/user/{author.userslug}">{{{ end }}}
16
+ </div>
17
+
18
+
8
19
  <div class="topic-header">
9
20
  <h1 component="post/header" class="" itemprop="name">
10
21
  <span class="topic-title">
package/theme.json CHANGED
@@ -1,7 +1,7 @@
1
- {
2
- "id": "nodebb-theme-persona",
3
- "name": "Persona",
4
- "description": "The default theme for NodeBB. Uses a standard approach to forum design.",
5
- "url": "https://github.com/psychobunny/nodebb-theme-persona",
6
- "screenshot": "screenshot.png"
1
+ {
2
+ "id": "nodebb-theme-persona",
3
+ "name": "Persona",
4
+ "description": "The default theme for NodeBB. Uses a standard approach to forum design.",
5
+ "url": "https://github.com/psychobunny/nodebb-theme-persona",
6
+ "screenshot": "screenshot.png"
7
7
  }