Skip to content

Commit

Permalink
Link FAQ about indexing in the right-panel footer (#258)
Browse files Browse the repository at this point in the history
Link FAQ about indexing in the right-panel footer so people can more easily
understand what goes into the result and find issues to track about opting out.

 - #47
 - https://github.com/matrix-org/matrix-public-archive/blob/5caf9dc1b8d5e98fdc99ab06ab9b9d09d2f546ed/docs/faq.md#how-do-i-opt-out-and-keep-my-room-from-being-indexed-by-search-engines
  • Loading branch information
MadLittleMods authored May 31, 2023
1 parent 5caf9dc commit dfeae90
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
14 changes: 14 additions & 0 deletions client/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ summary {
cursor: pointer;
}

.external-link::after {
content: '';

display: inline-block;
width: 1.1ch;
height: 1.1ch;
margin-left: 0.3ch;

background: url('../img/external-link-icon.svg');
background-repeat: no-repeat;
background-size: contain;
vertical-align: baseline;
}

.PrimaryActionButton {
display: inline-block;
padding: 4px 16px;
Expand Down
5 changes: 5 additions & 0 deletions client/img/external-link-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions shared/views/RightPanelContentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

const { TemplateView } = require('hydrogen-view-sdk');

const assert = require('matrix-public-archive-shared/lib/assert');
const CalendarView = require('matrix-public-archive-shared/views/CalendarView');
const TimeSelectorView = require('matrix-public-archive-shared/views/TimeSelectorView');
const assert = require('matrix-public-archive-shared/lib/assert');

class RightPanelContentView extends TemplateView {
render(t, vm) {
assert(vm.shouldIndex !== undefined);
assert(vm.shouldShowTimeSelector !== undefined);

let maybeIndexedMessage = 'This room is not being indexed by search engines.';
let maybeIndexedMessage = 'This room is not being indexed by search engines ';
if (vm.shouldIndex) {
maybeIndexedMessage = 'This room is being indexed by search engines.';
maybeIndexedMessage = 'This room is being indexed by search engines ';
}

return t.div(
Expand All @@ -33,7 +33,19 @@ class RightPanelContentView extends TemplateView {
className: 'RightPanelContentView_footer',
},
[
t.p(maybeIndexedMessage),
t.p([
maybeIndexedMessage,
'(',
t.a(
{
className: 'external-link RightPanelContentView_footerLink',
href: 'https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#how-do-i-opt-out-and-keep-my-room-from-being-indexed-by-search-engines',
target: '_blank',
},
'more info'
),
').',
]),
t.div(
{
className: 'RightPanelContentView_footerLinkList',
Expand Down

0 comments on commit dfeae90

Please sign in to comment.