diff --git a/website-v2/.gitignore b/website-v2/.gitignore new file mode 100644 index 0000000..016b59e --- /dev/null +++ b/website-v2/.gitignore @@ -0,0 +1,24 @@ +# build output +dist/ + +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/website-v2/.vscode/extensions.json b/website-v2/.vscode/extensions.json new file mode 100644 index 0000000..22a1505 --- /dev/null +++ b/website-v2/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/website-v2/.vscode/launch.json b/website-v2/.vscode/launch.json new file mode 100644 index 0000000..d642209 --- /dev/null +++ b/website-v2/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/website-v2/README.md b/website-v2/README.md new file mode 100644 index 0000000..ff19a3e --- /dev/null +++ b/website-v2/README.md @@ -0,0 +1,48 @@ +# Astro Starter Kit: Basics + +```sh +npm create astro@latest -- --template basics +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) +[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics) +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json) + +> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! + +![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554) + +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +```text +/ +├── public/ +│ └── favicon.svg +├── src/ +│ ├── layouts/ +│ │ └── Layout.astro +│ └── pages/ +│ └── index.astro +└── package.json +``` + +To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/). + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/website-v2/astro.config.mjs b/website-v2/astro.config.mjs new file mode 100644 index 0000000..69b3ad0 --- /dev/null +++ b/website-v2/astro.config.mjs @@ -0,0 +1,18 @@ +// @ts-check +import { defineConfig } from 'astro/config'; +import sitemap from '@astrojs/sitemap'; + +// https://astro.build/config +export default defineConfig({ + site: 'https://sparanoid.com', + base: '/lab/7z', + build: { + // https://docs.astro.build/en/reference/configuration-reference/#buildformat + format: 'file', + }, + markdown: { + // https://docs.astro.build/en/reference/configuration-reference/#markdownsyntaxhighlight + syntaxHighlight: false, + }, + integrations: [sitemap()], +}); diff --git a/website-v2/bun.lockb b/website-v2/bun.lockb new file mode 100755 index 0000000..0dda356 Binary files /dev/null and b/website-v2/bun.lockb differ diff --git a/website-v2/deploy.sh b/website-v2/deploy.sh new file mode 100644 index 0000000..71e3417 --- /dev/null +++ b/website-v2/deploy.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# deploy.sh - Script to handle local deployment +# Usage: ./deploy.sh [--no-commit] [source_dir] [dest_dir] [base_path] + +set -e # Exit on error + +# Default settings +COMMIT_CHANGES=true +SOURCE_DIR="dist" # Default source directory +DEST_DIR="$HOME/Git/sparanoid.com-prod" # Default destination +BASE_PATH="/lab/7z" # Default base path +LOG_FILE="deploy-sparanoid.log" + +# Parse arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --no-commit) COMMIT_CHANGES=false ;; + *) + if [ -z "$SOURCE_OVERRIDE" ]; then + SOURCE_OVERRIDE="$1" + elif [ -z "$DEST_OVERRIDE" ]; then + DEST_OVERRIDE="$1" + elif [ -z "$BASE_OVERRIDE" ]; then + BASE_OVERRIDE="$1" + else + echo "Error: Unexpected argument $1" + exit 1 + fi + ;; + esac + shift +done + +# Override defaults if provided +[ -n "$SOURCE_OVERRIDE" ] && SOURCE_DIR="$SOURCE_OVERRIDE" +[ -n "$DEST_OVERRIDE" ] && DEST_DIR="$DEST_OVERRIDE" +[ -n "$BASE_OVERRIDE" ] && BASE_PATH="$BASE_OVERRIDE" + +# Create destination directory if it doesn't exist +mkdir -p "$DEST_DIR/site/$BASE_PATH" + +# Log start with parameters used +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting deployment" | tee -a "$LOG_FILE" +echo "Source: $SOURCE_DIR" | tee -a "$LOG_FILE" +echo "Destination: $DEST_DIR/site/$BASE_PATH" | tee -a "$LOG_FILE" +echo "Auto-commit: $([ "$COMMIT_CHANGES" = true ] && echo "enabled" || echo "disabled")" | tee -a "$LOG_FILE" + +# Copy files to local directory +rsync -avz --delete --progress \ + "$SOURCE_DIR/" \ + "$DEST_DIR/site/$BASE_PATH" >>"$LOG_FILE" 2>&1 + +if [ $? -eq 0 ]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] File sync completed successfully" | tee -a "$LOG_FILE" + + # Run auto-commit if enabled + if [ "$COMMIT_CHANGES" = true ] && [ -f "$DEST_DIR/auto-commit" ]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Running auto-commit script..." | tee -a "$LOG_FILE" + cd "$DEST_DIR" && bash "auto-commit" >>"$LOG_FILE" 2>&1 + fi +else + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error: File sync failed" | tee -a "$LOG_FILE" + exit 1 +fi + +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Deployment completed" | tee -a "$LOG_FILE" +exit 0 diff --git a/website-v2/package.json b/website-v2/package.json new file mode 100644 index 0000000..afba4b7 --- /dev/null +++ b/website-v2/package.json @@ -0,0 +1,16 @@ +{ + "name": "7z", + "description": "7-Zip Chinese Simplified Website", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/sitemap": "^3.2.1", + "astro": "^5.0.5" + } +} diff --git a/website-v2/public/favicon.ico b/website-v2/public/favicon.ico new file mode 100644 index 0000000..9311ebf Binary files /dev/null and b/website-v2/public/favicon.ico differ diff --git a/website-v2/public/img/7zfm-vista.png b/website-v2/public/img/7zfm-vista.png new file mode 100644 index 0000000..1f79f88 Binary files /dev/null and b/website-v2/public/img/7zfm-vista.png differ diff --git a/website-v2/public/img/7zfm-win7.png b/website-v2/public/img/7zfm-win7.png new file mode 100644 index 0000000..30b64f6 Binary files /dev/null and b/website-v2/public/img/7zfm-win7.png differ diff --git a/website-v2/public/img/7zfm.png b/website-v2/public/img/7zfm.png new file mode 100644 index 0000000..54b2f98 Binary files /dev/null and b/website-v2/public/img/7zfm.png differ diff --git a/website-v2/public/img/7ziplogo.png b/website-v2/public/img/7ziplogo.png new file mode 100644 index 0000000..bff19dc Binary files /dev/null and b/website-v2/public/img/7ziplogo.png differ diff --git a/website-v2/public/img/7zlogo02.png b/website-v2/public/img/7zlogo02.png new file mode 100644 index 0000000..baa877a Binary files /dev/null and b/website-v2/public/img/7zlogo02.png differ diff --git a/website-v2/public/img/donate.png b/website-v2/public/img/donate.png new file mode 100644 index 0000000..28aaae6 Binary files /dev/null and b/website-v2/public/img/donate.png differ diff --git a/website-v2/public/img/feed-14x14.png b/website-v2/public/img/feed-14x14.png new file mode 100644 index 0000000..9707305 Binary files /dev/null and b/website-v2/public/img/feed-14x14.png differ diff --git a/website-v2/public/img/twitter-14x14.png b/website-v2/public/img/twitter-14x14.png new file mode 100644 index 0000000..30e5d44 Binary files /dev/null and b/website-v2/public/img/twitter-14x14.png differ diff --git a/website-v2/src/assets/astro.svg b/website-v2/src/assets/astro.svg new file mode 100644 index 0000000..8cf8fb0 --- /dev/null +++ b/website-v2/src/assets/astro.svg @@ -0,0 +1 @@ + diff --git a/website-v2/src/assets/background.svg b/website-v2/src/assets/background.svg new file mode 100644 index 0000000..4b2be0a --- /dev/null +++ b/website-v2/src/assets/background.svg @@ -0,0 +1 @@ + diff --git a/website-v2/src/components/Welcome.astro b/website-v2/src/components/Welcome.astro new file mode 100644 index 0000000..6b7b9c7 --- /dev/null +++ b/website-v2/src/components/Welcome.astro @@ -0,0 +1,209 @@ +--- +import astroLogo from '../assets/astro.svg'; +import background from '../assets/background.svg'; +--- + +
+ +
+
+ Astro Homepage +

+ To get started, open the
src/pages
directory in your project. +

+ +
+
+ + + +

What's New in Astro 5.0?

+

+ From content layers to server islands, click to learn more about the new features and + improvements in Astro 5.0 +

+
+
+ + diff --git a/website-v2/src/data/versions.ts b/website-v2/src/data/versions.ts new file mode 100644 index 0000000..c81dcac --- /dev/null +++ b/website-v2/src/data/versions.ts @@ -0,0 +1,409 @@ +export interface VersionData { + stable: Version; + beta: Version; +} + +export interface Version { + long: string; + short: string; + type?: string; + date: string; + sdk: { + long: string; + short: string; + date: string; + }; +} + +export interface Download { + version: string; + date: string; + note?: string; + downloads: DownloadLink[]; +} + +export interface DownloadLink { + url: string; + type: string; + system: string; + description?: string; + rowspan?: number; +} + +export const versions: VersionData = { + stable: { + long: "24.09", + short: "2409", + date: "2024-11-29", + sdk: { + long: "24.09", + short: "2409", + date: "2024-11-29", + }, + }, + beta: { + long: "24.09", + short: "2409", + type: "beta", + date: "2024-11-29", + sdk: { + long: "24.09", + short: "2409", + date: "2024-11-29", + }, + }, +}; + +export const { stable, beta } = versions; + +export const currentDownloads: Download[] = [ + { + version: stable.long, + date: stable.date, + note: "

我们更建议使用 exe 版本的安装包而不是 msi 安装包。

", + downloads: [ + { + url: `https://www.7-zip.org/a/7z${stable.short}-x64.exe`, + type: ".exe", + system: "64 位 Windows x64", + description: "7-Zip Windows", + rowspan: 3, + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}.exe`, + type: ".exe", + system: "32 位 Windows x86", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-arm64.exe`, + type: ".exe", + system: "64 位 Windows arm64", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-x64.msi`, + type: ".msi", + system: "64 位 Windows x64", + description: "(MSI 安装包)7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}.msi`, + type: ".msi", + system: "32-bit Windows x86", + description: "(MSI 安装包)7-Zip Windows 32 位", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-extra.7z`, + type: ".7z", + system: "Windows x86 / x64", + description: "7-Zip 附加包:7z 独立命令行版本、7z DLL、Far 管理器插件", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-linux-x64.tar.xz`, + type: ".tar.xz", + system: "64-bit Linux x86-64", + description: "7-Zip Linux:命令行版本", + rowspan: 4, + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-linux-x86.tar.xz`, + type: ".tar.xz", + system: "32 位 Linux x86", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-linux-arm64.tar.xz`, + type: ".tar.xz", + system: "64 位 Linux arm64", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-linux-arm.tar.xz`, + type: ".tar.xz", + system: "32 位 Linux arm", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-mac.tar.xz`, + type: ".7z", + system: "macOS(arm64 / x86-64)", + description: "7-Zip MacOS:命令行版本", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-src.7z`, + type: ".7z", + system: "任意 / Windows", + description: "7-Zip 源代码", + }, + { + url: `https://www.7-zip.org/a/7z${stable.short}-src.tar.xz`, + type: ".tar.xz", + system: "任意 / Windows", + description: "7-Zip 源代码", + }, + { + url: `https://www.7-zip.org/a/lzma${stable.short}.7z`, + type: ".7z", + system: "任意 / Windows", + description: "LZMA SDK(C、C++、C#、Java)", + }, + { + url: "https://www.7-zip.org/a/7zr.exe", + type: ".exe", + system: "Windows", + description: "7zr.exe(x86):7-Zip 命令行可执行文件", + }, + ], + }, +]; + +export const legacyDownloads: Download[] = [ + { + version: "23.01", + date: "2023-06-20", + downloads: [ + { + url: "https://www.7-zip.org/a/7z2201-x64.exe", + type: ".exe", + system: "64 位 Windows x64", + description: "7-Zip Windows", + rowspan: 3, + }, + { + url: "https://www.7-zip.org/a/7z2201.exe", + type: ".exe", + system: "32 位 Windows x86", + }, + { + url: "https://www.7-zip.org/a/7z2201-arm64.exe", + type: ".exe", + system: "64 位 Windows arm64", + }, + { + url: "https://www.7-zip.org/a/7z2201-x64.msi", + type: ".msi", + system: "64 位 Windows x64", + description: "(MSI 安装包)7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: "https://www.7-zip.org/a/7z2201.msi", + type: ".msi", + system: "32-bit Windows x86", + description: "(MSI 安装包)7-Zip Windows 32 位", + }, + { + url: "https://www.7-zip.org/a/7z2201-extra.7z", + type: ".7z", + system: "Windows x86 / x64", + description: "7-Zip 附加包:7z 独立命令行版本、7z DLL、Far 管理器插件", + }, + { + url: "https://www.7-zip.org/a/7z2201-linux-x64.tar.xz", + type: ".tar.xz", + system: "64-bit Linux x86-64", + description: "7-Zip Linux:命令行版本", + rowspan: 4, + }, + { + url: "https://www.7-zip.org/a/7z2201-linux-x86.tar.xz", + type: ".tar.xz", + system: "32 位 Linux x86", + }, + { + url: "https://www.7-zip.org/a/7z2201-linux-arm64.tar.xz", + type: ".tar.xz", + system: "64 位 Linux arm64", + }, + { + url: "https://www.7-zip.org/a/7z2201-linux-arm.tar.xz", + type: ".tar.xz", + system: "32 位 Linux arm", + }, + { + url: "https://www.7-zip.org/a/7z2201-src.7z", + type: ".7z", + system: "任意 / Windows", + description: "7-Zip 源代码", + }, + { + url: "https://www.7-zip.org/a/7z2201-src.tar.xz", + type: ".tar.xz", + system: "任意 / Windows", + description: "7-Zip 源代码", + }, + { + url: "https://www.7-zip.org/a/lzma2201.7z", + type: ".7z", + system: "任意 / Windows", + description: "LZMA SDK(C、C++、C#、Java)", + }, + ], + }, + { + version: "21.07", + date: "2021-12-26", + downloads: [ + { + url: "https://www.7-zip.org/a/7z2107-mac.tar.xz", + type: ".tar.xz", + system: "macOS(arm64 / x86-64)", + description: "7-Zip MacOS:命令行版本", + }, + ], + }, + { + version: "19.00", + date: "2019-02-21,Windows", + downloads: [ + { + url: "https://www.7-zip.org/a/7z1900-x64.exe", + type: ".exe", + system: "64 位 x64", + description: "7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: "https://www.7-zip.org/a/7z1900.exe", + type: ".exe", + system: "32 位 x86", + description: "7-Zip Windows 32 位", + }, + { + url: "https://www.7-zip.org/a/7z1900-extra.7z", + type: ".7z", + system: "x86 / x64", + description: + "7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager", + }, + { + url: "https://www.7-zip.org/a/7z1900-src.7z", + type: ".7z", + system: "任意", + description: "7-Zip 源代码", + }, + { + url: "https://www.7-zip.org/a/lzma1900.7z", + type: ".7z", + system: "任意 / x86 / x64", + description: "LZMA SDK(C、C++、C#、Java)", + }, + { + url: "https://www.7-zip.org/a/7z1900-x64.msi", + type: ".msi", + system: "64 位 x64", + description: "(MSI 安装包)7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: "https://www.7-zip.org/a/7z1900.msi", + type: ".msi", + system: "32 位 x86", + description: "(MSI 安装包)7-Zip Windows 32 位", + }, + ], + }, + { + version: "16.04", + date: "2016-10-04,Windows", + downloads: [ + { + url: "https://www.7-zip.org/a/7z1604.exe", + type: ".exe", + system: "32 位 x86", + description: "7-Zip Windows 32 位", + }, + { + url: "https://www.7-zip.org/a/7z1604-x64.exe", + type: ".exe", + system: "64 位 x64", + description: "7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: "https://www.7-zip.org/a/7z1604-extra.7z", + type: ".7z", + system: "x86 / x64", + description: "7-Zip 附加包:独立命令行、7z 程序库、Far 管理器插件", + }, + { + url: "https://www.7-zip.org/a/7z1604-src.7z", + type: ".7z", + system: "任意", + description: "7-Zip 源代码", + }, + { + url: "https://www.7-zip.org/a/lzma1604.7z", + type: ".7z", + system: "任意 / x86 / x64", + description: "LZMA SDK(C、C++、C#、Java)", + }, + { + url: "https://www.7-zip.org/a/7z1604.msi", + type: ".msi", + system: "32 位 x86", + description: "(MSI 安装包)7-Zip Windows 32 位", + }, + { + url: "https://www.7-zip.org/a/7z1604-x64.msi", + type: ".msi", + system: "64 位 x64", + description: "(MSI 安装包)7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + ], + }, + { + version: "9.20", + date: "2010-11-18,Windows", + downloads: [ + { + url: "https://www.7-zip.org/a/7z920.exe", + type: ".exe", + system: "32 位 x86", + description: "7-Zip Windows 32 位", + rowspan: 2, + }, + { + url: "https://www.7-zip.org/a/7z920.msi", + type: ".msi", + system: "32 位 x86", + }, + { + url: "https://www.7-zip.org/a/7z920-x64.msi", + type: ".msi", + system: "64 位 x64", + description: "7-Zip Windows 64 位(Intel 64 或 AMD64)", + }, + { + url: "https://www.7-zip.org/a/7z920-ia64.msi", + type: ".msi", + system: "IA-64", + description: "7-Zip 64 位(IA-64 安腾 Itanium CPU)", + }, + { + url: "https://www.7-zip.org/a/7z920-arm.exe", + type: ".exe", + system: "ARM-WinCE", + description: "7-Zip for Windows Mobile / Windows CE (ARM)", + }, + { + url: "https://www.7-zip.org/a/7za920.zip", + type: ".zip", + system: "32 位", + description: "7-Zip 命令行版本", + }, + { + url: "https://www.7-zip.org/a/7z920.tar.bz2", + type: ".tar.bz2", + system: "任意", + description: "7-Zip 源代码", + }, + { + url: "https://www.7-zip.org/a/7z920_extra.7z", + type: ".7z", + system: "32 位", + description: + "7-Zip 附加包:7z 程序库、安装模式自释放模块、FAR 管理器插件", + }, + { + url: "https://www.7-zip.org/a/lzma920.tar.bz2", + type: ".tar.bz2", + system: "任意", + description: "LZMA SDK(C、C++、C#、Java)", + rowspan: 2, + }, + ], + }, +]; diff --git a/website-v2/src/layouts/Layout.astro b/website-v2/src/layouts/Layout.astro new file mode 100644 index 0000000..6d71dfe --- /dev/null +++ b/website-v2/src/layouts/Layout.astro @@ -0,0 +1,248 @@ +--- +// Layout.astro +interface Props { + title: string; + currentPage?: string; + frontmatter?: { + title?: string; + currentPage?: string; + }; +} + +const { + frontmatter = {}, + title: propTitle, + currentPage: propCurrentPage = "home", +} = Astro.props; + +// Merge frontmatter and props, with props taking precedence +const title = propTitle || frontmatter.title; +const currentPage = frontmatter.currentPage || propCurrentPage; + +const siteName = "7-Zip"; +const currentYear = new Date().getFullYear(); + +const baseUrl = import.meta.env.BASE_URL; + +const menuItems = [ + { id: "home", label: "首页", href: "./" }, + { id: "7z", label: "7z 格式", href: "7z.html" }, + { id: "sdk", label: "LZMA SDK", href: "sdk.html" }, + { id: "download", label: "下载", href: "download.html" }, + { id: "faq", label: "常见问题", href: "faq.html" }, + { id: "support", label: "支持", href: "support.html" }, + { id: "links", label: "链接", href: "links.html" }, +]; +--- + + + + + {currentPage !== "home" ? `${siteName} - ${title}` : title} + + + + + + + + + + + + + + +
+ + +
+ +

+ Copyright (C) {currentYear} Igor Pavlov. +

+
+ + + + + + + diff --git a/website-v2/src/pages/7z.astro b/website-v2/src/pages/7z.astro new file mode 100644 index 0000000..ae4d0f1 --- /dev/null +++ b/website-v2/src/pages/7z.astro @@ -0,0 +1,98 @@ +--- +import Layout from "../layouts/Layout.astro"; + +const algorithms = [ + { name: "LZMA", description: "改良与优化后的 LZ77 算法" }, + { name: "LZMA2", description: "改良的 LZMA 算法" }, + { name: "PPMD", description: "基于 Dmitry Shkarin 的 PPMdH 算法" }, + { name: "BCJ", description: "32 位 x86 可执行文件转换程序" }, + { name: "BCJ2", description: "32 位 x86 可执行文件转换程序" }, + { name: "BZip2", description: "标准 BWT 算法" }, + { name: "Deflate", description: "标准 LZ77-based 算法" }, +]; + +const title = "7z 格式"; +--- + + +

{title}

+ +

7z 是一种全新的压缩格式,它拥有极高的压缩比。

+ +

7z 格式的主要特征:

+ + +

+ 7z 已公开了结构编辑功能,所以它可以支持任何一种新的压缩算法。到目前为止,下列压缩算法已被整合到了 + 7z 中: +

+ + + + + + + { + algorithms.map((algo) => ( + + + + + )) + } +
压缩算法备注
{algo.name}{algo.description}
+ +

+ LZMA 算法是 7z 格式的默认算法。LZMA 算法具有以下主要特征: +

+ + +

+ LZMA 压缩算法非常适于应用程序的内嵌。LZMA 发布于 GNU LGPL 许可协议之下,如果您想使用 + LZMA 的代码,您可以通过 发送信息到 LZMA 开发部 来咨询和自定义设计代码及制定开发者的使用许可。您也可以点击此处来查看有关 LZMA + SDK 的信息: LZMA SDK. +

+ + + +

+ 7z7-Zip 发布于 GNU LGPL 许可下的子程序。您可从 下载页面 下载 7-Zip 的源代码。 +

+ +

+ 支持 7z 压缩格式的应用程序:WinRAR、PowerArchiver、TUGZip、IZArc。 +

+ +

相关链接:

+ +
diff --git a/website-v2/src/pages/download.astro b/website-v2/src/pages/download.astro new file mode 100644 index 0000000..6ac74df --- /dev/null +++ b/website-v2/src/pages/download.astro @@ -0,0 +1,146 @@ +--- +import Layout from "../layouts/Layout.astro"; +import { currentDownloads, legacyDownloads } from "../data/versions"; + +// combine current and legacy downloads +const resolvedDownloads = [...currentDownloads, ...legacyDownloads]; + +const title = "程序下载"; +--- + + +

{title}

+ + + + +

我们更建议使用 exe 版本的安装包而不是 msi 安装包。

+ + { + resolvedDownloads.map((version) => ( +
+

+ + 下载 7-Zip {version.version}({version.date}): + +

+ + + + + + + + + + + {version.downloads.map((download) => ( + + + + + {download.description && ( + + )} + + ))} + +
+ 链接 + + 类型 + + 系统 + 描述
+ 下载 + {download.type}{download.system} + {download.description} +
+ {version.note && } +
+ )) + } + +

您可以在 SourceForge 下载其他板本的 7-Zip(包括老板本和测试版本):

+ +

+ 在 SourceForge 上的 7-Zip 文件页面 +

+

+ 在 SourceForge 上的 7-Zip 项目页面 +

+ +

下载 p7zip for Posix/Linux(x86 二进制文件及源代码)

+

下载 p7zip

+

+ Source Forge 中的 p7zip 页面 +

+ +

+ p7zip 是 Unix/Linux 下的 7-Zip 命令行版本,是由网上的 7-Zip + 爱好者独立开发的。 +

+ +

Linux 及其它操作系统上的一些非官方 p7zip:

+ + +

其它系统上的 7-Zip:

+ +
diff --git a/website-v2/src/pages/faq.md b/website-v2/src/pages/faq.md new file mode 100644 index 0000000..7f3200f --- /dev/null +++ b/website-v2/src/pages/faq.md @@ -0,0 +1,145 @@ +--- +layout: ../layouts/Layout.astro +title: 常见问题解答(FAQ) +currentPage: faq +--- + +# 常见问题解答(FAQ) + +- [用户常见问题解答](#user_faq) +- [开发者常见问题解答](#developer_faq) + +## 用户常见问题解答 + +#### 我能否使用 7-Zip 用于商业用途? + +可以,7-Zip 是自由软件。您可以在任何电脑上使用它,您不需要对 7-Zip 进行捐赠或付钱。 + +#### 我如何在 Windows 7 以及 Windows Vista 中让 7-Zip 关联文件? + +您必须以管理员方式运行一次 7-Zip 文件管理器。右键点击 7-Zip 文件管理器图标,选择"以管理员方式运行"。然后您就可以在设置中关联文件了。 + +#### 为什么新版本 7-Zip 创建的某些 7z 压缩包要比老版本的 7-Zip 大? + +新版本的 7-Zip(从 15.06 开始)为固实 7z 压缩包默认使用了另一种文件排序顺序。 + +老版本的 7-Zip(15.06 之前的版本)使用的排序方法为「按类型」(按文件扩展名)。 + +新版本的 7-Zip 支持两种文件排序方法: + +- 按名称排序 - 默认排序。 +- 按类型排序,如果在「添加到压缩包」窗口中的参数字段中增加了「**qs**」参数(或命令行版本中的 **-mqs** 开关)。 + +如果字典大小小于总文件大小,不同的排序方法可能会在压缩比上产生很大差异。如果在不同的文件夹中包含类似的文件,那么「按类型」排序在某些情况下可能提供更好的压缩比。 + +请注意「按类型」排序的缺点。例如使用「按名称」排序的 NTFS 卷,所以如果一个压缩包使用了别的排序方法,那么对于这些非常规的文件排序在机械硬盘(HDD)设备上的操作速度可能会受到影响(机械硬盘的寻道时间通常会比较慢)。 + +您可以通过下列方法提升压缩比: + +- 增大字典大小。在没使用「**qs**」参数时有效。 +- 在「添加到压缩包」窗口中的参数字段中增加了「**qs**」参数(或命令行版本中的 **-mqs** 开关)。 + +如果您认为非常规文件排序对您并不是问题,并且使用高压缩比配合较小的字典大小对您来说更重要,那么就使用「**qs**」模式。 + +#### 为何 7-Zip 无法打开部分 ZIP 压缩包? + +绝大多数是因为该压缩包的文件头错误。ZIP 压缩包包含两个文件头,7-Zip 对两个文件头都进行读取,如果其中任意一个包含错误数据,7-Zip 就不会打开它。而其它支持 ZIP 格式的程序能够打开部分有错误的压缩包,因为那些程序通常只读取一分文件头,或者程序将错误的数据忽略。 + +所以,如果您有类似的压缩包,请不要向 7-Zip 技术支持询问其原因。您最好试着找到创建此压缩包的原程序,并向他们的技术支持发送错误报告,来告知它与 ZIP 格式不完全兼容。 + +目前同样还有一些 ZIP 压缩包使用的是 7-Zip 不支持的编码格式,例如 WAVPack (WinZip)。 + +#### 为何 7-Zip 无法打开部分 RAR 压缩包? + +7-Zip 9.20 只支持 RAR 2/3/4 格式,并不支持 RAR5 压缩包。但最新版本的 7-Zip 已支持 RAR5 压缩包。 + +#### 为什么从 7-Zip 拖拽文件到 Windows 资源管理器时要先提取到临时文件? + +7-Zip 并不知道拖拽到的目标路径。只有 Windows 文件管理器知道拖拽的目标路径。并且 Windows 资源管理器需要在硬盘上有已解压缩的文件才可以往下进行操作。所以 7-Zip 要先提取文件到临时文件夹,然后 7-Zip 会通知 Windows 资源管理器,之后由资源管理器将文件复制到拖拽的目标路径。 + +如果想避免使用临时文件,您可以使用提取命令,或在 7-Zip 文件管理器之内进行拖拽操作。 + +#### 为什么在命令行版本中无法添加没有扩展名的文件? + +您大概是使用了 _._ 通配符。7-Zip 使用的并不是系统处理通配符的默认方法,因而 7-Zip 不支持其它通配符规则,在系统中 _._ 相当于所有文件。而 7-Zip 会将其视为任何扩展名的全部文件。所以,要处理所有文件您必须使用 \* 通配符。 + +#### 为什么 -r 选项不会像我预期的那样执行? + +通常情况下您并不需要使用 -r 选项。7-Zip 在没有 -r 选项的情况下一样可以压缩子文件夹。 + +示例 1: + +```cmd + 7z.exe a c:\a.7z "C:\Program Files" +``` + +压缩 "C:\Program Files" 目录,包括所有的子文件夹。 + +示例 2: + +```cmd + 7z.exe a -r c:\a.7z "C:\Program Files" +``` + +搜索并压缩 C:\ 中所有包含 "Program Files" 的文件夹(例如,在 "C:\WINDOWS" 中)。 + +如果您只想压缩特定的扩展名,可以使用 -r 开关: + +```cmd + 7z a -r c:\a.zip c:\dir\*.txt +``` + +压缩所有的 c:\dir\ 下及其子文件夹中的 \*.txt 文件。 + +#### 我如何在压缩包中存储完整路径? + +7-Zip 默认只存储相对文件路径(无驱动器盘符)。您可将要压缩的所有文件放在一个单独的文件夹中然后使用下面的方法: + +```cmd + cd /D C:\dir1\ + 7z.exe a c:\a.7z file1.txt dir2\file2.txt +``` + +#### 为什么 7-Zip 不能在 32 位 Windows 下使用更大的字典文件? + +32 位 Windows 只能为每个应用程序分配 2 GB 的虚拟空间。同样这 2 GB 空间还会包含其他的文件碎片(例如一些要调用的 DLL 文件),所以 7-Zip 无法分配更大的虚拟空间。但在 64 位 Windows 中就不会有限制,如果您有足够大的物理内存,您可以使用任意大小的字典文件。 + +#### 如何使用安静模式安装 7-Zip? + +「/S」用于安静模式安装;/D=dir,为指定的"输出目录"。这些选项是区分大小写的。 +对于 msi 安装包:使用 /q INSTALLDIR="C:\Program Files\7-Zip" 参数。 + +#### 如何恢复受损的 7z 压缩包? + +当您遇到下列情形时说明压缩包已受损: + +- 您可以打开压缩包并看到里面的文件,但是当您使用释放或测试功能时,提示「数据错误」或「CRC 校验错误」。 +- 当您尝试打开压缩包时,出现错误提示「无法作为压缩包打开文件『a.7z』」。 + +如果遇到上述情形,恢复部分数据是有可能的,请查看数据恢复流程: + +[恢复受损 7z 压缩包](https://www.7-zip.org/recover.html)(英文,由于此页面会时常更新,并包含较多术语,原作者要求此页面保留英文) + +## 开发者常见问题解答 + +#### 为何我在使用 Visual C++ 6.0 编译 7-Zip 或 LZMA SDK 时会出现链接错误? + +想要编译源码吗?您需要 Visual C++ 6.0 或更高版本。部分文件还需要来自 microsoft.com 的 Platform SDK。 + +如果您使用 MSVC,请在目录列表上方的"包括文件"及"工具 / 选项 / 目录"中的"库文件"中指定 SDK 目录。 + +最新的 Platform SDK 与 MSVC6 不兼容。所以您必须使用 Windows Server 2003 PSDK(2003 二月)。 + +#### 我能否使用 7-Zip 中的 EXE 或 DLL 文件用于商业用途? + +可以,但是如果这样的话您必须在文档中注明:(1) 您使用了 7-Zip 程序的某部分文件 (2) 7-Zip 发布于 GNU LGPL 协议 (3) 必须有链接到 www.7-zip.org 的链接,能够找到 7-Zip 的源代码。 + +#### 如何在我的程序中添加对 7z 格式的支持? + +一种方法是使用 7za.dll(可到 sf.net 站点下载)。7za.dll 通过 COM 接口工作。但是它并没有使用标准的 COM 接口。您可以在源代码中找到一些例子。完整的例子就是 7-Zip 本身,7-Zip 本身就通过此 dll 运行。目前还有一些其它的应用程序使用了 7za.dll:WinRAR、PowerArchiver 等等。 + +其它的方法是调用命令行版本 7za.exe。 + +#### 我能否在商业应用程序中使用 7-Zip 源代码? + +7-Zip 基于 GNU LGPL 许可发布。所以您必须遵守此许可中的条款。简单的说,那意味着任何 LGPL 的代码必须在 LGPL 许可中保持完整性。例如,您可以更改 7-Zip 源代码,并且将它们编译成 DLL。但是这些更改后的 DLL 的源代码(包括您更改、增加、删除的内容)必须遵守 LGPL 或 GPL 许可。您的应用程序的其它源代码可以是属于任意许可的。想设想允许用户及开发者更改基于 LGPL 发布的代码并重编成 DLL。请到 了解更多信息。同样也可以了解 [LZMA SDK](sdk.html),提供了相比 LGPL 更高自由度的许可。 diff --git a/website-v2/src/pages/index.astro b/website-v2/src/pages/index.astro new file mode 100644 index 0000000..b69a067 --- /dev/null +++ b/website-v2/src/pages/index.astro @@ -0,0 +1,229 @@ +--- +import Layout from "../layouts/Layout.astro"; +import { versions } from "../data/versions"; + +const news = [ + { + title: "7-Zip 24.09", + date: "2024-11-29", + link: "https://sourceforge.net/p/sevenzip/discussion/45797/thread/b95432c7ac/", + }, + { + title: "7-Zip 24.08", + date: "2024-08-11", + link: "https://sourceforge.net/p/sevenzip/discussion/45797/thread/f162d68dcd/", + }, + { + title: "7-Zip 24.07", + date: "2024-06-19", + link: "https://sourceforge.net/p/sevenzip/discussion/45797/thread/c84bcb5b5c/", + }, +]; +--- + + + + + + + + + + +
+

欢迎来到 7-Zip 官方中文网站!

+ +

7-Zip 是一款拥有极高压缩比的开源压缩软件。

+ +

+ 下载 7-Zip {versions.stable.long}({ + versions.stable.date + })稳定版适用于 Windows x64(64 位): +

+ + + + + + + + + + + + + + + + +
链接格式系统大小
+ 下载 + .exe64 位 x641 MB
+ +

+ 下载 7-Zip {versions.stable.long} 稳定版适用于其他 Windows 平台(32 + 位 x86 或 ARM64): +

+ + + + + + + + + + + + + + + + + + + + + + +
链接格式系统大小
+ 下载 + .exe32 位 x861 MB
+ 下载 + .exe64 位 ARM641 MB
+ +

+ 中文版附加内容访问 GitHub 查看。 +

+ +

许可协议

+ +

+ 7-Zip 是一款 开源免费 软件。大多数源代码都基于 + GNU LGPL 许可协议下发布。部分代码基于 BSD 3 句条款(BSD 3-clause)许可协议发布。并且,部分代码受到了 + unRAR 许可协议的限制。更多许可信息请查看:7-Zip 许可。 +

+ +

+ 您可以在任何一台计算机上使用 7-Zip ,包括用在商业用途的计算机。不对 + 7-Zip 进行注册或支付费用并不影响您的使用。 +

+ +

7-Zip 主要特征

+
    +
  • + 使用了 LZMALZMA2 算法的 7z 格式 拥有极高的压缩比 +
  • +
  • + 支持格式: +
      +
    • 压缩 / 解压缩:7z、XZ、BZIP2、GZIP、TAR、ZIP 以及 WIM
    • +
    • + 仅解压缩:AR、ARJ、CAB、CHM、CPIO、CramFS、DMG、EXT、FAT、GPT、HFS、IHEX、ISO、LZH、LZMA、MBR、MSI、NSIS、NTFS、QCOW2、RAR、RPM、SquashFS、UDF、UEFI、VDI、VHD、VMDK、WIM、XAR、Z + 以及 ZSTD +
    • +
    +
  • +
  • + 与 ZIP 及 GZIP 格式相比,7-Zip 能提供比使用 PKZip 及 WinZip + 高 2-10% 的压缩比 +
  • +
  • 为 7z 与 ZIP 提供更完善的 AES-256 加密算法
  • +
  • 7z 格式支持创建自释放压缩包
  • +
  • Windows 资源管理器集成
  • +
  • 强大的文件管理器
  • +
  • 强大的命令行版本
  • +
  • 支持 FAR Manager 插件
  • +
  • 支持 87 种语言
  • +
+ +

+ 7-Zip 适用于 Windows 11 / 10 / 8 / 7 / Vista / XP / 2022 / 2019 + / 2016 / 2012 / 2008 / 2003 / 2000。 +

+ +

+ 在 Source Forge 的 7-Zip 页面(英文)中您可以找到相关的论坛、错误汇报及系统需求。 +

+
+ { + news.map((item) => ( + <> + + + + + + + + + + +
{item.title}{item.date}
+ {item.title} +
+
+ + )) + } + + + + + + + + + + +
7-Zip 更新历史
+ 查看更新历史(中文) +
+ 查看更新历史(英文) +
+ +
+ + + + + + + + + + +
了解 7-Zip 最新动态
+ @7zip +
+
+
diff --git a/website-v2/src/pages/links.astro b/website-v2/src/pages/links.astro new file mode 100644 index 0000000..ed9c37b --- /dev/null +++ b/website-v2/src/pages/links.astro @@ -0,0 +1,302 @@ +--- +import Layout from "../layouts/Layout.astro"; + +const title = "相关链接"; +--- + + +

{title}

+ +

+ Source Forge 上的 7-Zip 页面 +

+ +

+ Source Forge 上的 7-Zip 论坛 +

+ +

p7zip

+ +

+ p7zip 是 7-Zip(仅命令行版本)用于 Unix 平台上的移植版本。是由非 7-Zip + 官方的独立开发者开发的。 +

+ +

+ Source Forge 上的 p7zip 页面 +

+ +

请注意 p7zip 的代码自 16.02 版本后没有再更新。

+ +

或者可以尝试 p7zip 的 fork 版本:

+ +

+ p7zip fork(作者 jinfeihan57)包含额外编码器以及功能增强 +

+ +
+ +

+ 7-Zip 标徽及按钮 +

+ +

+ 如果您拥有您的个人站点,如果您想支持 7-Zip + 今后的发展,欢迎您在你的主页上加上我们的链接。您可以使用下列 HTML + 代码在您的站点上添加 7-Zip 的链接: +

+ +
<a href="https://www.7-zip.org/">
+<img src="https://www.7-zip.org/logos/7zlogo01.png"
+width="88" height="31" alt="7-Zip" /></a>
+ +

+ + 7-Zip + +

+ +
+

7-Zip 相关链接:

+ + +
+

使用 7-Zip(LZMA)压缩算法的应用程序:

+ + +

能够支持 7-Zip 压缩算法的应用程序:

+ + +

7-Zip 相关文章、教程:

+ +
diff --git a/website-v2/src/pages/robots.txt.ts.disabled b/website-v2/src/pages/robots.txt.ts.disabled new file mode 100644 index 0000000..1d81472 --- /dev/null +++ b/website-v2/src/pages/robots.txt.ts.disabled @@ -0,0 +1,16 @@ +// TODO: https://github.com/withastro/astro/issues/11575 +// https://docs.astro.build/en/guides/integrations-guide/sitemap/ +import type { APIRoute } from "astro"; + +const getRobotsTxt = (sitemapURL: URL) => ` +User-agent: * +Allow: / + +Sitemap: ${sitemapURL.href} +`; + +export const GET: APIRoute = ({ site }) => { + const baseUrl = import.meta.env.BASE_URL; + const sitemapURL = new URL(`${baseUrl}/sitemap-index.xml`, site); + return new Response(getRobotsTxt(sitemapURL)); +}; diff --git a/website-v2/src/pages/sdk.astro b/website-v2/src/pages/sdk.astro new file mode 100644 index 0000000..b2d1c1b --- /dev/null +++ b/website-v2/src/pages/sdk.astro @@ -0,0 +1,191 @@ +--- +import Layout from "../layouts/Layout.astro"; +import { stable } from "../data/versions"; + +const downloads = [ + { + href: `https://www.7-zip.org/a/lzma${stable.sdk.short}.7z`, + size: "1 MB", + date: stable.sdk.date, + version: stable.sdk.long, + description: "LZMA SDK
C、C++、C#、Java
包含 Windows 二进制文件", + rowSpan: 2, + }, + { + href: "https://www.7-zip.org/a/lzma2301.7z", + size: "1 MB", + date: "2023-06-20", + version: "23.01", + description: null, // Uses rowspan from above + }, + { + href: "https://www.7-zip.org/a/lzma-specification.7z", + size: "12 KB", + date: "2015-06-14", + version: "", + description: "LZMA 规范(草案)", + }, +]; + +const title = "LZMA SDK(软件开发工具包)(英文版)"; +--- + + +

{title}

+ +

+ LZMA 软件开发工具包(以下简称 + SDK)给开发客户提供文档、源代码以及几个使用 LZMA 压缩算法制作的应用程序的例子。 +

+ + + + + + + + + + { + downloads.map((download, index) => ( + + + + + + {download.description && ( + + )) + } +
链接大小日期版本描述
+ 下载 + {download.size}{download.date}{download.version} + )} +
+ +

+ 注意:如果您使用 LZMA SDK 中的 XZ 代码,建议您从 15.05 beta 中升级到最新的 + XZ 代码,新版本的 XZ 代码修复了一些 bug。 +

+ +

工具包更新:

+ + +

+ LZMA7-Zip 程序中 7z 格式 的默认压缩算法。LZMA 能提供给用户极高的压缩比及较快的压缩速度,它非常适合与应用程序集成。 +

+ +

LZMA SDK 包括:

+ + +

+ ANSI-C LZMA 解压缩代码是从原始的 C++ 源代码转换到 C。并简化和优化了代码的大小。但它依然和 + 7-ZipLZMA 完全兼容。 +

+ +

LZMA 的主要特征:

+ + +

+ LZMA 解码器仅使用整数运算,可以在任何主流的 32 位处理器(或在一定条件下的 + 16 或处理器)下运行。 +

+ +

许可协议

+ +

LZMA SDK 隶属于 公有领域

+ +

LZMA 相关链接

+ +
diff --git a/website-v2/src/pages/support.astro b/website-v2/src/pages/support.astro new file mode 100644 index 0000000..c023417 --- /dev/null +++ b/website-v2/src/pages/support.astro @@ -0,0 +1,52 @@ +--- +import Layout from "../layouts/Layout.astro"; + +const title = "技术支持"; +--- + + +

{title}

+ +

在您请求 7-Zip 帮助之前,请先:

+ + +

+ 请到 7-Zip 论坛发布您所遇到的所有常的见问题。在那里您可以获得 7-Zip + 开发者和其它 7-Zip 用户的帮助: +

+

请在论坛中使用英语。

+ +

+ Source Forge 上的 7-Zip 论坛 +

+ +

+ Source Forge 上的 7-Zip 错误汇报 +

+ +

如果您使用 7-Zip 时遇到了问题,请提供下列系统信息:

+ + +

+ 如果您在使用简体中文版时遇到了翻译错误,请到 这里 进行提交。 +

+
diff --git a/website-v2/tsconfig.json b/website-v2/tsconfig.json new file mode 100644 index 0000000..8bf91d3 --- /dev/null +++ b/website-v2/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "astro/tsconfigs/strict", + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] +}