Add proper docs url.

This commit is contained in:
Dessalines 2021-01-06 16:06:42 -05:00
parent b448cb8f0e
commit 524711e05e
2 changed files with 9 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { Component } from 'inferno'; import { Component } from 'inferno';
import { Link } from 'inferno-router'; import { Link } from 'inferno-router';
import { i18n } from '../i18next'; import { i18n } from '../i18next';
import { repoUrl, joinLemmyUrl } from '../utils'; import { repoUrl, joinLemmyUrl, docsUrl } from '../utils';
import { GetSiteResponse } from 'lemmy-js-client'; import { GetSiteResponse } from 'lemmy-js-client';
interface FooterProps { interface FooterProps {
@ -34,7 +34,7 @@ export class Footer extends Component<FooterProps, FooterState> {
</Link> </Link>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a className="nav-link" href={'/docs/index.html'}> <a className="nav-link" href={docsUrl}>
{i18n.t('docs')} {i18n.t('docs')}
</a> </a>
</li> </li>

View file

@ -75,11 +75,11 @@ export const favIconUrl = '/static/assets/favicon.svg';
export const favIconPngUrl = '/static/assets/apple-touch-icon.png'; export const favIconPngUrl = '/static/assets/apple-touch-icon.png';
// TODO // TODO
// export const defaultFavIcon = `${window.location.protocol}//${window.location.host}${favIconPngUrl}`; // export const defaultFavIcon = `${window.location.protocol}//${window.location.host}${favIconPngUrl}`;
export const defaultFavIcon = 'test';
export const repoUrl = 'https://github.com/LemmyNet'; export const repoUrl = 'https://github.com/LemmyNet';
export const joinLemmyUrl = 'https://join.lemmy.ml'; export const joinLemmyUrl = 'https://join.lemmy.ml';
export const supportLemmyUrl = 'https://join.lemmy.ml/sponsors'; export const supportLemmyUrl = 'https://join.lemmy.ml/sponsors';
export const helpGuideUrl = '/docs/about/guide.html'; export const docsUrl = '/docs';
export const helpGuideUrl = '/docs/en/about/guide.html'; // TODO find a way to redirect to the non-en folder
export const markdownHelpUrl = `${helpGuideUrl}#markdown-guide`; export const markdownHelpUrl = `${helpGuideUrl}#markdown-guide`;
export const sortingHelpUrl = `${helpGuideUrl}#sorting`; export const sortingHelpUrl = `${helpGuideUrl}#sorting`;
export const archiveUrl = 'https://archive.is'; export const archiveUrl = 'https://archive.is';
@ -563,7 +563,7 @@ export function pictrsDeleteToast(
interface NotifyInfo { interface NotifyInfo {
name: string; name: string;
icon: string; icon?: string;
link: string; link: string;
body: string; body: string;
} }
@ -575,7 +575,7 @@ export function messageToastify(info: NotifyInfo, router: any) {
let toast = Toastify({ let toast = Toastify({
text: `${htmlBody}<br />${info.name}`, text: `${htmlBody}<br />${info.name}`,
avatar: info.icon, avatar: info.icon ? info.icon : null,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
className: 'text-dark', className: 'text-dark',
close: true, close: true,
@ -595,7 +595,7 @@ export function messageToastify(info: NotifyInfo, router: any) {
export function notifyPost(post_view: PostView, router: any) { export function notifyPost(post_view: PostView, router: any) {
let info: NotifyInfo = { let info: NotifyInfo = {
name: post_view.community.name, name: post_view.community.name,
icon: post_view.community.icon ? post_view.community.icon : defaultFavIcon, icon: post_view.community.icon,
link: `/post/${post_view.post.id}`, link: `/post/${post_view.post.id}`,
body: post_view.post.name, body: post_view.post.name,
}; };
@ -605,9 +605,7 @@ export function notifyPost(post_view: PostView, router: any) {
export function notifyComment(comment_view: CommentView, router: any) { export function notifyComment(comment_view: CommentView, router: any) {
let info: NotifyInfo = { let info: NotifyInfo = {
name: comment_view.creator.name, name: comment_view.creator.name,
icon: comment_view.creator.avatar icon: comment_view.creator.avatar,
? comment_view.creator.avatar
: defaultFavIcon,
link: `/post/${comment_view.post.id}/comment/${comment_view.comment.id}`, link: `/post/${comment_view.post.id}/comment/${comment_view.comment.id}`,
body: comment_view.comment.content, body: comment_view.comment.content,
}; };
@ -617,7 +615,7 @@ export function notifyComment(comment_view: CommentView, router: any) {
export function notifyPrivateMessage(pmv: PrivateMessageView, router: any) { export function notifyPrivateMessage(pmv: PrivateMessageView, router: any) {
let info: NotifyInfo = { let info: NotifyInfo = {
name: pmv.creator.name, name: pmv.creator.name,
icon: pmv.creator.avatar ? pmv.creator.avatar : defaultFavIcon, icon: pmv.creator.avatar,
link: `/inbox`, link: `/inbox`,
body: pmv.private_message.content, body: pmv.private_message.content,
}; };