diff --git a/docusaurus.config.js b/docusaurus.config.js index ff0855c..d94306e 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -31,7 +31,7 @@ const config = { // may want to replace "en" with "zh-Hans". i18n: { defaultLocale: 'zh-Hans', - locales: ['zh-Hans'], + locales: ['zh-Hans', 'en'], }, presets: [ diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json index c7f7aba..03fa8ee 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/i18n/en/docusaurus-plugin-content-docs/current.json @@ -4,7 +4,7 @@ "description": "The label for version current" }, "sidebar.tutorialSidebar.category.开始": { - "message": "开始", + "message": "Getting started", "description": "The label for category 开始 in sidebar tutorialSidebar" }, "sidebar.tutorialSidebar.category.Tutorial - Extras": { diff --git a/i18n/en/docusaurus-plugin-content-docs/current/contributing.mdx b/i18n/en/docusaurus-plugin-content-docs/current/contributing.mdx new file mode 100644 index 0000000..d376a3c --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/contributing.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 2 +slug: /contributing +--- + +# Contributions + +Typecho is an open-source project and we welcome anyone to contribute code, documentation or feedback. + +[![Contributors](https://contrib.rocks/image?repo=typecho/typecho)](https://github.com/typecho/typecho/graphs/contributors) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/backup.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/backup.mdx new file mode 100644 index 0000000..7f9bba4 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/backup.mdx @@ -0,0 +1,55 @@ +--- +sidebar_position: 3 +--- + +# Backups + +We recommend backing up data before site administrators perform risky operations such as upgrades, migrations, repairs, etc. + +## `usr` directory + +The files in the `usr` directory are, in general, files uploaded by the user themselves, such as themes, plugins, attachments, etc. These files will not be overwritten when you update Typecho, so there is no need to back them up. + +However, if you are migrating your site, or if you are upgrading to a major version of Typecho, we recommend that you back up your usr directory. + +There are many ways to back up the `usr` directory, such as using the `tar` command to package it into a compressed package: + +```bash +tar -czvf usr.tar.gz /path/to/typecho/usr +``` + +## Database + +Typecho stores data in a database, so we need to back it up. + +### Back up the database using the "Backup" function + +Typecho has a built-in functionality that allows to backup the database. You will find this option in the backend "Console" - "Backup". + +![备份数据库](./img/backup.png) + +Click the Start Backup button, Typecho will automatically back up the database and generate a backup file with the suffix `.dat` for automatic download. Please keep this backup file in a safe place, and you can also use it to restore data in the future. + +:::warning +The data backed up by the "Backup" function only contains the data of the main program, if you use a third-party plug-in with its own data table, +The data from these tables is not backed up. If you want to back up this data, please refer to the method below. +::: + +### Back up your database using a third-party tool + +If you want to back up the entire database, including Typecho's datasheet and the datatable of third-party plugins, you can use a third-party tool such as `mysqldump`: + + +```bash +mysqldump -u username -p database_name > backup.sql +``` + +This command will export the data from the `database_name` database to the `backup.sql` file. + +:::tip +`mysqldump` command requires the password for the database. If you don't want to enter your password in the terminal,, you can pass the `--password` parameter (note that this will make the password visible in your command history): + +```bash +mysqldump -u username -p --password=your_password database_name > backup.sql +``` +::: diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/faq.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/faq.mdx new file mode 100644 index 0000000..7fc72df --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/faq.mdx @@ -0,0 +1,31 @@ +--- +sidebar_position: 4 +--- + +# F.A.Q. + +Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). + +It builds your site as simple **static HTML, JavaScript and CSS files**. + +## Build your site + +Build your site **for production**: + +```bash +npm run build +``` + +The static files are generated in the `build` folder. + +## Deploy your site + +Test your production build locally: + +```bash +npm run serve +``` + +The `build` folder is now served at [http://localhost:3000/](http://localhost:3000/). + +You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/backup.png b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/backup.png new file mode 100644 index 0000000..c0a8f6e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/backup.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/install-start.png b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/install-start.png new file mode 100644 index 0000000..b2b2191 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/img/install-start.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/installation.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/installation.mdx new file mode 100644 index 0000000..08c636f --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/installation.mdx @@ -0,0 +1,185 @@ +--- +sidebar_position: 1 +--- + +# Installation + +## Requirements + +If you need to install Typecho directly on your server, youl need to make sure your server meets the requirements below. If you are using Docker to install Typecho, you can skip this section. + +### PHP runtime environment + +Typecho is a PHP-based blogging program, and the latest version needs to run PHP 7.4 or higher. In addition, Typecho requires the following environment support: + +- [Multibyte String support (MBString)](https://www.php.net/manual/book.mbstring.php) +- [JSON support](https://www.php.net/manual/book.json.php) _(enabled by default in PHP 8.0 and above)_ +- If you use MySQL, you need [mysqli support](https://www.php.net/manual/book.mysqli.php) or [PDO MySQL support](https://www.php.net/manual/book.pdo.php),_(PDO Mysql is recommended)_ +- If you use SQLite, you need [sqlite3 support](https://www.php.net/manual/book.sqlite3.php) or [PDO SQLite support](https://www.php.net/manual/book.pdo.php),_(PDO SQLite support is recommended)_ +- If you use PostgreSQL you need [pgsql support](https://www.php.net/manual/book.pgsql.php) or [PDO PostgreSQL support](https://www.php.net/manual/book.pdo.php),_(PDO PostgreSQL support is recommended)_ + +:::tip +Typecho 1.2.x can run on PHP 7.2 or higher, while previous versions can run on PHP 7.0 or higher. However, we strongly recommend that you use PHP 7.4 or later for better performance and security. +::: + +### Web servers + +Typecho can run on any web server that supports PHP (or fastcgi protocol), including but not limited to: + +- [Apache](https://httpd.apache.org/) +- [Nginx](https://nginx.org/) +- [IIS](https://www.iis.net/) +- [Lighttpd](https://www.lighttpd.net/) + +:::note +In the example below, we use the default convention of `/srv/www/typecho` being the installation path of Typecho. You need to modify the path to fit your situation. `typecho.example.com` represents your domain name, you need to change it to your actual domain name. +::: + +#### Apache recommended configuration + +Apache needs to have installed either the module `mod_php` or `mod_fcgid`. In both cases, the `mod_rewrite` module needs to be installed. + +Assuming the Apache configuration file is located in `/etc/apache2`, you can create the file `/etc/apache2/sites-available/typecho.conf` and add the following configuration: + +```apacheconf + + ServerName typecho.example.com + DocumentRoot /srv/www/typecho + + Options FollowSymLinks + AllowOverride Limit Options FileInfo + DirectoryIndex index.php + Require all granted + + + Options FollowSymLinks + Require all granted + + + Options -Indexes -FollowSymLinks + Require all granted + + + Require all denied + + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /index.php [L] + + +``` + +#### Nginx recommended configuration + +Assuming the Nginx configuration file is located in `/etc/nginx`, you can create the file `/etc/nginx/sites-available/typecho.conf` and add the following configuration: + +```nginx +server { + listen 80; + server_name typecho.example.com; + root /srv/www/typecho; + index index.php; + location / { + try_files $uri $uri/ /index.php?$args; + } + location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + # 这里需要根据实际情况修改 + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + } +} +``` + +:::warning +The `fastcgi_pass` directive here needs to be modified according to your actual system structure, so that Nginx can connect to PHP-FPM correctly. +::: + +### Database + +Typecho supports the following databases: + +- [MySQL](https://www.mysql.com/),_(recommended version: MySQL 5.7 and above)_ +- [PostgreSQL](https://www.postgresql.org/),_(recommended version: PostgreSQL 9.6 and above)_ +- [SQLite](https://www.sqlite.org/),_(recommended version: SQLite 3.8 and above)_ + +:::note +We also support other branches of MySQL, such as MariaDB and Percona Server.However, we strongly recommend that you use the official version of MySQL for better compatibility and performance. +::: + +## Start the service + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +From [the official website of Typecho](https://typecho.org/download), download the latest version of Typecho: + +```bash +wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip +``` + +Unzip Typecho to the root directory of the web server: + +```bash +unzip typecho.zip -d /srv/www/typecho +``` + + + + + +You can use Docker to quickly deploy Typecho, just run the following command: + +```bash +docker run -d -p 80:80 --name typecho -v ./typecho:/app/usr -e TYPECHO_SITE_URL=https://[YOUR DOMAIN NAME] -d joyqi/typecho:latest +``` + + + + + +You can use Docker Compose to quickly deploy Typecho, just write the following `docker-compose.yml` file + +```yaml title="docker-compose.yml" +version: '3.8' + +services: + typecho: + image: joyqi/typecho:latest + ports: + - "80:80" + volumes: + - ./typecho:/app/usr + environment: + - TYPECHO_SITE_URL=https://[你的域名] + restart: unless-stopped +``` + +Then run the following command: + +```bash +docker-compose up -d +``` + + + + +In your browser, visit `https://[YOUR DOMAIN NAME]/install.php` and follow the prompts to complete the installation. + +## Complete the installation + +Visit the domain name configured above and you will see the installation interface of Typecho: + +![Typecho installation](./img/install-start.png) + +If everything is normal, you will see the I am ready. Begin next step >> button; click it to continue. + +In the subsequent installation process, you need to fill in the database information, administrator account information, etc., and follow the prompts to complete the installation. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/upgrade.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/upgrade.mdx new file mode 100644 index 0000000..088ca21 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/upgrade.mdx @@ -0,0 +1,91 @@ +--- +sidebar_position: 2 +--- + +# Upgrade + +:::tip +Before upgrading, be sure to back up your database and files. +::: + +## Upgrade process + +Choose the corresponding upgrade method according to your installation method. + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +From the official [Typecho website](https://typecho.org/download) website, download the latest version of Typecho: + +```bash +wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip +``` + +Unzip Typecho to the temporary directory: + +```bash +unzip typecho.zip -d /tmp/typecho +``` + +:::tip +It is recommended to stop the webserver before performing file replacement to avoid file conflicts. +::: + +Delete the following files and directories in the Typecho directory on the web server: + +- `/admin/` +- `/var/` +- `/index.php` +- `/install.php` + +:::caution +Please do not delete the `/usr/` directory, because this directory contains your theme, plug-ins and uploaded files, and it does not need to be upgraded. +::: + +Upload/copy the following files and directories from the temporary directory to the Typecho directory on the web server: + +- `/admin/` +- `/var/` +- `/index.php` +- `/install.php` + +At this point, the upgrade is complete! Don't forget to start again the web server. + + + + + +:::caution +The upgrade of the Docker container that contains Typecho requires the container to be recreated. +::: + +Execute the following command to delete the old container and create a new container: + +```bash +docker pull joyqi/typecho:latest +docker stop typecho +docker rm typecho +docker run -d -p 80:80 --name typecho -v ./typecho:/app/usr -e TYPECHO_SITE_URL=https://[YOUR DOMAIN NAME] -d joyqi/typecho:latest +``` + + + + + +To upgrade Typecho with Docker Compose, you only need to pull the image again and restart the container: + +```bash +docker-compose pull +docker-compose down +docker-compose up -d +``` + + + + +## Complete the upgrade + +After the upgrade is complete, browse to the Typecho backend and log in as administrator. If there is a database upgrade operation, Typecho will automatically guide you through it. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/intro.md b/i18n/en/docusaurus-plugin-content-docs/current/intro.md new file mode 100644 index 0000000..2bce412 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/intro.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 1 +slug: / +--- + +# Introduction + +Typecho is the combination of the words "type" and "echo", pronounced as: `/taɪpˌ'ekoʊ/`. + +Type,as in "typing", because it allows us to express ourselves on the internet by typing our thoughts. Echo implies feedback and resonance. It is also one of the most important and common functions in PHP. After all, most PHP enthusiasts started their learning path typing `echo 'Hello World!;`. + +As the name indicates, Typecho is a blogging platform, that is released under the [GPL version 2 license](https://opensource.org/license/gpl-2-0/), built with PHP(PHP 7.4 and above required)can run on a variety of platforms and supports a variety of databases(Mysql / PostgreSQL / SQLite). + +## About the documentation + +This documentation is intended for both users and developers. The user-oriented section introduces the program and its basic methods of operation. The developer-oriented part introduces the development of themes and plugins. If you have any problems that cannot be solved in the documentation, please go to [Community](https://github.com/typecho/typecho/discussions) and participate in the discussion. If you notice any errors in the documentation, please let us know: [Feedback](https://github.com/typecho/docs/issues). + +As an open source software, our documentation is also open source. Click the **Edit this page** button at the bottom left of any page to find the source code address of this documentation page. We welcome everyone to help us improve the documentation and benefit more users.