Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style:update archived page style #1900

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const config = {
position: 'right',
dropdownItemsAfter: [
{
label: 'Archived Docs',
label: 'Archived',
to: `/archive-docs`,
},
],
Expand Down
12 changes: 12 additions & 0 deletions i18n/zh-CN/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,17 @@
"archive.preview.date": {
"message": "归档日期:{date}",
"description": "Archive date"
},
"archive-tips-1": {
"message":"本页将归档 Apache Doris 暂停维护版本的所有文档,并提供 PDF 格式供用户下载。",
"description": "Archive tips"
},
"archive-tips-2": {
"message":"请注意,归档文档将不再进行任何更新,建议用户使用最新版本。",
"description": "Archive tips"
},
"archive-download-text":{
"message":"下载 PDF",
"description":"archive download text"
}
}
38 changes: 36 additions & 2 deletions src/pages/archive-docs/index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.archive-container {
padding: 0 1rem;
width: 100%;
margin: 0 auto 5.5rem auto;
margin-bottom: 5.5rem;
.archive-admonition {
padding: 2rem;
margin-top: 1.25rem;
Expand All @@ -20,6 +20,7 @@
font-weight: 700;
line-height: 45px;
margin-top: 2.875rem;
margin-bottom: 1.5rem;
}
h2 {
padding-top: 1.25rem;
Expand All @@ -35,15 +36,48 @@
color: rgb(85, 95, 115);
}

.preview-item-content {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #d6dfe6;
}

.preview-link {
display: flex;
align-items: center;
}

.preview-link > svg {
margin-left: 8px;
}

.preview-link:hover {
cursor: pointer;
}

.download-link:hover {
text-decoration: underline;
color: #444fd9;
}

.archive-tips-content {
margin-bottom: 1.5rem;
}

.preview-item-version {
font-size: 1.125rem;
font-weight: 600;
}
.preview-link {
font-size: 1.125rem;
font-weight: 600;
}
}

@media (min-width: 1280px) {
.archive-container {
max-width: 1280px;
margin: 0 0 5.5rem 5rem;
width: 834px;
.archive-admonition {
max-width: 75%;
}
Expand Down
56 changes: 47 additions & 9 deletions src/pages/archive-docs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React, { useState, useEffect } from 'react';
import Layout from '@site/src/theme/Layout';
import Link from '@docusaurus/Link';
import { Divider } from 'antd';
import Translate, { translate } from '@docusaurus/Translate';
import PdfIcon from '@site/static/images/toc-icon/pdf.svg';
import './index.scss';

const PREVIEW_LINK_ZH = 'https://cdn.selectdb.com/static/doris_1_2_2_18e810982b.pdf';
Expand All @@ -11,6 +13,17 @@ const DATE_LINK = '2025-01-17';

export default function Archive() {
const [isZH, setIsZH] = useState(false);
const handleMouseEnter = (id: string) => {
const dom = document.getElementById(id);
dom!.style.color = '#444FD9';
dom!.firstChild!.style.fill = '#444FD9';
};

const handleMouseLeave = (id: string) => {
const dom = document.getElementById(id);
dom!.style.color = '#7F7F83';
dom!.firstChild!.style.fill = '#7F7F83';
};

useEffect(() => {
if (typeof window !== 'undefined') {
Expand All @@ -24,15 +37,15 @@ export default function Archive() {
message: 'Apache Doris - Archive Document Center',
})}
description={translate({
id:'archive.layout.description',
message:'Collection of Apache doris archive documents'
id: 'archive.layout.description',
message: 'Collection of Apache doris archive documents',
})}
>
<div className="archive-container">
<h1>
<Translate id="archive.page.title">Archived Docs</Translate>
</h1>
<div className="archive-admonition">
{/* <div className="archive-admonition">
<p>
<Translate id="archive.admonition.1">
The older releases are provided for archival purposes only, and are no longer receives
Expand All @@ -58,8 +71,8 @@ export default function Archive() {
{'For up-to-date documentation,please see the {stableLink} or {latestLink}'}
</Translate>
</p>
</div>
<h2>
</div> */}
{/* <h2>
<Translate id="archive.page.version">Version:1.2</Translate>
</h2>
<ul>
Expand All @@ -68,9 +81,7 @@ export default function Archive() {
id="archive.preview.v12"
values={{
previewLink: (
<Link
to={isZH ? PREVIEW_LINK_ZH : PREVIEW_LINK_EN}
>
<Link to={isZH ? PREVIEW_LINK_ZH : PREVIEW_LINK_EN}>
<Translate id="archive.preview.link">Apache Doris v1.2</Translate>
</Link>
),
Expand All @@ -89,7 +100,34 @@ export default function Archive() {
{'Archive date: {date}'}
</Translate>
</li>
</ul>
</ul> */}
<p className="archive-tips-content">
<Translate id="archive-tips-1">
This page archives all documents of Apache Doris's discontinued maintenance versions and
provides PDF format for users to download.
</Translate>
<br />
<br />
<Translate id="archive-tips-2">
Please note that archived documents no longer receive updates; therefore, Doris encourages you
to use the latest version.
</Translate>
</p>
<div className="preview-item-content">
<div className="preview-item-version">Apache Doris v1.2</div>
<Link to={isZH ? PREVIEW_LINK_ZH : PREVIEW_LINK_EN}>
<div
className="preview-link"
style={{ color: '#7F7F83' }}
id="toc-icon-pdf"
onMouseEnter={() => handleMouseEnter('toc-icon-pdf')}
onMouseLeave={() => handleMouseLeave('toc-icon-pdf')}
>
<PdfIcon />
<Translate id="archive-download-text">Download PDF</Translate>
</div>
</Link>
</div>
</div>
</Layout>
);
Expand Down
Loading