Adding a few more pages.

This commit is contained in:
Dessalines 2023-09-25 14:00:52 -04:00
parent 8bd2eb826d
commit bf5abd5b09
12 changed files with 165 additions and 216 deletions

@ -1 +1 @@
Subproject commit ab6cef1e8445caac3d643fd1eb9917783f88c643
Subproject commit b5b5981499854a7e25f128a5c8cc541b258e7e09

@ -1 +1 @@
Subproject commit 839f1097d07ba9d730e31f58c892de491442e490
Subproject commit de9de2c53bee034d3824ecaa9a2104f8f341332e

View file

@ -38,6 +38,7 @@
"@babel/preset-env": "7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.5",
"@tailwindcss/typography": "^0.5.10",
"@types/express": "^4.17.17",
"@types/node": "^20.3.2",
"@types/node-fetch": "^2.6.4",

View file

@ -0,0 +1,2 @@
export const gradientTextClasses =
"bg-gradient-to-r bg-clip-text text-transparent from-[#69D066] to-[#03A80E]";

View file

@ -1,6 +1,39 @@
import { Component } from "inferno";
import { Helmet } from "inferno-helmet";
import { i18n } from "../i18next";
import { gradientTextClasses } from "./common";
import { Icon } from "./icon";
const TitleBlock = () => (
<div className={`mt-16 text-center text-4xl mb-8 ${gradientTextClasses}`}>
{i18n.t("contact")}
</div>
);
const ContactBlock = () => (
<div className="flex flex-col items-center">
<div className="card w-96 card-bordered bg-neutral-900 shadow-xl">
<div className="card-body items-center p-16">
<ContactBtn
title="/c/lemmy_support"
url="https://lemmy.ml/c/lemmy_support"
/>
<ContactBtn
title="Matrix"
url="https://matrix.to/#/#lemmy-space:matrix.org"
/>
<ContactBtn title="Github" url="https://github.com/LemmyNet" />
</div>
</div>
</div>
);
const ContactBtn = ({ title, url }) => (
<a className="btn btn-block bg-neutral-800 mb-3 justify-start" href={url}>
<Icon icon="embed" classes={`fill-current text-primary`} />
<span className="underline">{title}</span>
</a>
);
export class Contact extends Component<any, any> {
constructor(props: any, context: any) {
@ -9,24 +42,12 @@ export class Contact extends Component<any, any> {
render() {
const title = i18n.t("contact_title");
return (
<div>
<div className="container mx-auto">
<Helmet title={title}>
<meta property={"title"} content={title} />
</Helmet>
<div class="container">
<h1>{i18n.t("contact")}</h1>
<ul>
<li>
<a href="https://lemmy.ml/c/lemmy_support">/c/lemmy_support</a>
</li>
<li>
<a href="https://matrix.to/#/#lemmy-space:matrix.org">Matrix</a>
</li>
<li>
<a href="https://github.com/LemmyNet">GitHub</a>
</li>
</ul>
</div>
<TitleBlock />
<ContactBlock />
</div>
);
}

View file

@ -5,9 +5,7 @@ import { i18n } from "../i18next";
import { T } from "inferno-i18next";
import { isBrowser } from "../utils";
import { Icon } from "./icon";
const gradientTextClasses =
"bg-gradient-to-r bg-clip-text text-transparent from-[#69D066] to-[#03A80E]";
import { gradientTextClasses } from "./common";
const LemmyTitleBlock = () => (
<div className="flex flex-col items-center">
@ -180,9 +178,7 @@ const DiscussionPlatformBlock = () => (
// TODO add all of these ones
const MoreFeaturesBlock = () => (
<div className="mt-16">
<div
className={`text-center text-primary text-4xl mb-8 ${gradientTextClasses}`}
>
<div className={`text-center text-4xl mb-8 ${gradientTextClasses}`}>
{i18n.t("more_features")}
</div>
<div className="grid md:grid-cols-5 grid-cols-1 gap-4">
@ -420,7 +416,7 @@ export class Main extends Component<any, any> {
return (
<div className="container mx-auto">
<Helmet title={title}>
<meta property={"title"} content={title} />{" "}
<meta property={"title"} content={title} />
</Helmet>
<LemmyTitleBlock />
<FollowCommunitiesBlock />
@ -428,178 +424,6 @@ export class Main extends Component<any, any> {
<DiscussionPlatformBlock />
<MoreFeaturesBlock />
<SupportDonateBlock />
<div class="bg-success">
<br />
<div class="container">
<div class="row">
<div class="col-4">
<div>
<header class="is-center">
<img
height={180}
src="/static/assets/images/review_pic.webp"
/>
</header>
<br />
<h4 class="text-center">{i18n.t("open_source")}</h4>
<p>
<T i18nKey="open_source_desc">
#<a href="https://github.com/LemmyNet">#</a>
<a href="https://en.wikipedia.org/wiki/Copyleft">#</a>
<a href="https://github.com/LemmyNet/lemmy/blob/master/LICENSE">
#
</a>
</T>
</p>
</div>
</div>
<div class="col-4">
<div>
<header class="is-center">
<img
height={180}
src="/static/assets/images/code_pic.webp"
/>
</header>
<br />
<h4 class="text-center">{i18n.t("blazing_fast")}</h4>
<p>
<T i18nKey="blazing_fast_desc">
#<a href="https://www.rust-lang.org">#</a>
<a href="https://actix.rs/">#</a>
<a href="http://diesel.rs/">#</a>
<a href="https://infernojs.org">#</a>
<a href="https://www.typescriptlang.org/">#</a>
</T>
</p>
</div>
</div>
<div class="col-4">
<div>
<header class="is-center">
<img
height={180}
src="/static/assets/images/mod_pic.webp"
/>
</header>
<br />
<h4 class="text-center">{i18n.t("mod_tools")}</h4>
<p>{i18n.t("mod_tools_desc")}</p>
</div>
</div>
</div>
</div>
<br />
<br />
<div class="container">
<div class="text-center">
<h2>{i18n.t("create_discussion_platform")}</h2>
<p>
<T i18nKey="create_discussion_platform_desc">
#<a href={`/docs/administration/administration.html`}>#</a>
<i>#</i>
<a href="https://en.wikipedia.org/wiki/Fediverse">#</a>
</T>
</p>
</div>
</div>
<br />
</div>
<br />
<div class="container">
<div class="row">
<div class="col-6">
<h4>{i18n.t("live_updates")}</h4>
<p>{i18n.t("live_updates_desc")}</p>
</div>
<div class="col-6 is-center">
<video height={325} autoPlay loop>
<source src="/static/assets/images/reply_vid.webm" />
</video>
</div>
</div>
</div>
<br />
<br />
<div class="container">
<div class="row">
<div class="col-6 is-center">
<img height={325} src="/static/assets/images/mobile_pic.webp" />
</div>
<div class="col-6">
<h4 class="is-marginless">{i18n.t("more_features")}</h4>
<ul class="is-marginless">
<li>
<T i18nKey="self_hostable">
#<a href={`/docs/administration/install_docker.html`}>#</a>
<a href={`/docs/administration/install_ansible.html`}>#</a>
</T>
</li>
<li>{i18n.t("clean_interface")}</li>
<li>
<Link to="/apps">
{i18n.t("mobile_apps_for_ios_and_android")}
</Link>
</li>
<li>{i18n.t("avatar_support")}</li>
<li>
<T i18nKey="full_vote_scores">
#<code>#</code>#
</T>
</li>
<li>{i18n.t("themes_including")}</li>
<li>
<T i18nKey="emojis_autocomplete">
#<code>#</code>
</T>
</li>
<li>
<T i18nKey="user_tagging">
#<code>#</code>
<code>#</code>
</T>
</li>
<li>{i18n.t("integrated_image_uploading")}</li>
<li>{i18n.t("notifications_including")}</li>
<li>
<T i18nKey="i18n_support">
#
<a href="https://weblate.join-lemmy.org/projects/lemmy/lemmy/">
#
</a>
</T>
</li>
<li>
<T i18nKey="rss_feeds">
#<code>#</code>
<code>#</code>
<code>#</code>
<code>#</code>
<code>#</code>
</T>
</li>
<li>{i18n.t("can_fully_erase")}</li>
<li>{i18n.t("nsfw_support")}</li>
</ul>
</div>
</div>
</div>
<br />
<div class="bg-success">
<br />
<div class="container">
<div class="text-center">
<h2>
<Link to="/donate">{i18n.t("support_donate")}</Link>
</h2>
</div>
</div>
<br />
</div>
</div>
);
}

View file

@ -25,12 +25,14 @@ export class NewsItem extends Component<any, any> {
render() {
return (
<div>
<div className="container mx-auto">
<Helmet title={title}>
<meta property={"title"} content={title} />
</Helmet>
<div class="container">
<div dangerouslySetInnerHTML={mdToHtml(this.markdown)} />
<div className="flex flex-col items-center">
<article className="prose prose-a:text-primary prose-h1:text-primary">
<div dangerouslySetInnerHTML={mdToHtml(this.markdown)} />
</article>
</div>
</div>
);

View file

@ -4,9 +4,87 @@ import { Helmet } from "inferno-helmet";
import { i18n } from "../i18next";
import { isBrowser } from "../utils";
import { news_md } from "../translations/news";
import { gradientTextClasses } from "./common";
const title = i18n.t("news");
const newsReversed = news_md.reverse();
const authors = ["nutomic", "dessalines"];
const news_reversed = news_md.reverse();
interface NewsInfo {
title: string;
dateStr: string;
preview: string;
authors: Array<string>;
url: string;
}
function buildNewsInfoArray(): Array<NewsInfo> {
return news_reversed.map(n => {
let split = n.title.split(" - ");
return {
dateStr: split[0],
title: split[1],
preview: split[2] || previewMarkdown(n.markdown),
authors,
url: `news/${titleToUrl(n.title)}`,
};
});
}
function titleToUrl(title: string): string {
return title.replace(/ /g, "_");
}
function previewMarkdown(markdown: string): string {
return markdown.replace(/#/g, "").slice(0, 100).concat("...");
}
const TitleBlock = () => (
<div className="mt-16 text-center text-4xl mb-8">{title}</div>
);
const NewsCards = () =>
buildNewsInfoArray().map(n => (
<NewsCard
dateStr={n.dateStr}
preview={n.preview}
authors={n.authors}
title={n.title}
url={n.url}
/>
));
const NewsCard = ({ dateStr, authors, title, url, preview }: NewsInfo) => (
<div className="card card-bordered bg-neutral-800 shadow-xl mb-3">
<div className="card-body">
<div class="grid md:grid-cols-12 grid-cols-1 gap-4">
<div className="md:col-span-10">
<div className="md:flex md:flex-row md:items-baseline md:space-x-3">
<Link to={url} className={`text-2xl ${gradientTextClasses}`}>
{title}
</Link>
<div className="text-sm text-gray-500">{dateStr}</div>
{authors.map(name => (
<AuthorBadge name={name} />
))}
</div>
<div className="text-sm text-gray-300">{preview}</div>
</div>
<Link to={url} className="md:col-span-2 btn btn-secondary">
{i18n.t("read_more")}
</Link>
</div>
</div>
</div>
);
const AuthorBadge = ({ name }) => (
<div className="badge bg-neutral-700">
<code>@</code>
<span className="ml-1 text-gray-300">{name}</span>
</div>
);
export class News extends Component<any, any> {
constructor(props: any, context: any) {
@ -21,25 +99,13 @@ export class News extends Component<any, any> {
render() {
return (
<div>
<div className="container mx-auto">
<Helmet title={title}>
<meta property={"title"} content={title} />
</Helmet>
<div class="container">
<h1>{title}</h1>
<ul>
{newsReversed.map(v => (
<li>
<Link to={`news/${titleToUrl(v.title)}`}>{v.title}</Link>
</li>
))}
</ul>
</div>
<TitleBlock />
<NewsCards />
</div>
);
}
}
function titleToUrl(title: string): string {
return title.replace(/ /g, "_");
}

View file

@ -20,6 +20,11 @@ export class Symbols extends Component<any, any> {
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<symbol id="icon-embed" viewBox="0 0 40 32">
<path d="M26 23l3 3 10-10-10-10-3 3 7 7z"></path>
<path d="M14 9l-3-3-10 10 10 10 3-3-7-7z"></path>
<path d="M21.916 4.704l2.171 0.592-6 22.001-2.171-0.592 6-22.001z"></path>
</symbol>
<symbol id="icon-f-droid" viewBox="0 0 32 32">
<path d="M27.296 13.441h-22.592c-1.169 0-2.119 0.948-2.119 2.119v14.12c0 1.169 0.948 2.119 2.119 2.119h22.592c1.169 0 2.119-0.948 2.119-2.119v-14.12c0-1.171-0.949-2.119-2.119-2.119zM16 30.033c-4.088 0-7.413-3.325-7.413-7.413s3.325-7.413 7.413-7.413 7.413 3.325 7.413 7.413-3.325 7.413-7.413 7.413zM16 16.548c-3.348 0-6.072 2.724-6.072 6.072s2.724 6.072 6.072 6.072 6.072-2.724 6.072-6.072-2.724-6.072-6.072-6.072zM16 27.032c-2.084 0-3.841-1.471-4.295-3.424h2.227c0.367 0.775 1.145 1.305 2.068 1.305 1.28 0 2.295-1.015 2.295-2.295s-1.015-2.295-2.295-2.295c-0.865 0-1.6 0.469-1.991 1.165h-2.269c0.504-1.883 2.225-3.283 4.26-3.283 2.424 0 4.412 1.988 4.412 4.412 0 2.425-1.988 4.413-4.412 4.413zM31.799 0.528c-0.001 0.001-0.003 0.003-0.003 0.004-0.003-0.003-0.005-0.004-0.008-0.007 0.001-0.001 0.003-0.004 0.005-0.005-0.155-0.183-0.372-0.308-0.692-0.317-0.269 0.007-0.521 0.129-0.683 0.345l-2.424 3.137c-0.219-0.077-0.452-0.127-0.697-0.127h-22.593c-0.245 0-0.477 0.051-0.697 0.127l-2.424-3.139c-0.161-0.216-0.413-0.337-0.683-0.345-0.32 0.008-0.537 0.133-0.692 0.317 0.001 0.001 0.003 0.004 0.005 0.005-0.004 0.003-0.007 0.005-0.009 0.008 0-0.001-0.001-0.003-0.003-0.004-0.088 0.104-0.396 0.568-0.016 1.099l2.545 3.295c-0.089 0.235-0.144 0.488-0.144 0.755v4.943c0 1.169 0.948 2.119 2.119 2.119h22.592c1.169 0 2.119-0.948 2.119-2.119v-4.943c0-0.267-0.055-0.52-0.145-0.755l2.545-3.295c0.379-0.531 0.071-0.995-0.017-1.099zM9.205 10.971c-1.316 0-2.383-1.067-2.383-2.383s1.067-2.383 2.383-2.383 2.383 1.067 2.383 2.383-1.067 2.383-2.383 2.383zM22.972 10.971c-1.316 0-2.383-1.067-2.383-2.383s1.067-2.383 2.383-2.383 2.383 1.067 2.383 2.383-1.067 2.383-2.383 2.383z"></path>
</symbol>

View file

@ -16,5 +16,5 @@ module.exports = {
theme: {
extend: {},
},
plugins: [require("daisyui")],
plugins: [require("@tailwindcss/typography"), require("daisyui")],
};

View file

@ -1220,6 +1220,16 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
"@tailwindcss/typography@^0.5.10":
version "0.5.10"
resolved "https://registry.yarnpkg.com/@tailwindcss/typography/-/typography-0.5.10.tgz#2abde4c6d5c797ab49cf47610830a301de4c1e0a"
integrity sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==
dependencies:
lodash.castarray "^4.4.0"
lodash.isplainobject "^4.0.6"
lodash.merge "^4.6.2"
postcss-selector-parser "6.0.10"
"@types/body-parser@*":
version "1.19.2"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
@ -5007,6 +5017,11 @@ lodash._root@~3.0.0:
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=
lodash.castarray@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.castarray/-/lodash.castarray-4.4.0.tgz#c02513515e309daddd4c24c60cfddcf5976d9115"
integrity sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==
lodash.clonedeep@~4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
@ -5017,6 +5032,11 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
lodash.isplainobject@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==
lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
@ -6363,6 +6383,14 @@ postcss-nested@^6.0.1:
dependencies:
postcss-selector-parser "^6.0.11"
postcss-selector-parser@6.0.10:
version "6.0.10"
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d"
integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==
dependencies:
cssesc "^3.0.0"
util-deprecate "^1.0.2"
postcss-selector-parser@^6.0.11:
version "6.0.13"
resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b"