1
0
mirror of https://github.com/actix/actix-website synced 2025-02-20 03:14:22 +01:00

Update: deps, markdown syntax, docuCtx. Change default edit branch to 'main'. (#339)

* Update: deps, markdown syntax, docuCtx

* Update node version in actions
This commit is contained in:
igaul 2023-11-01 17:46:56 -07:00 committed by GitHub
parent 838dbe5d49
commit f5e9e93b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3848 additions and 1837 deletions

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v4.0.0 - uses: actions/setup-node@v4.0.0
with: with:
node-version: 16.x node-version: 18.x
cache: npm cache: npm
- name: Install dependencies - name: Install dependencies

View File

@ -70,7 +70,7 @@ and:
/{foo}/bar/baz /{foo}/bar/baz
``` ```
A _variable part_ (replacement marker) is specified in the form _{identifier}_, where this means "accept any characters up to the next slash character and use this as the name in the `HttpRequest.match_info()` object". A _variable part_ (replacement marker) is specified in the form _\{identifier}_, where this means "accept any characters up to the next slash character and use this as the name in the `HttpRequest.match_info()` object".
A replacement marker in a pattern matches the regular expression `[^{}/]+`. A replacement marker in a pattern matches the regular expression `[^{}/]+`.
@ -170,7 +170,7 @@ Suppose that you want to organize paths to endpoints used to view "Users". Such
- /users - /users
- /users/show - /users/show
- /users/show/{id} - /users/show/\{id}
A scoped layout of these paths would appear as follows A scoped layout of these paths would appear as follows
@ -202,7 +202,7 @@ It also possible to extract path pattern information to a struct. In this case,
## Generating resource URLs ## Generating resource URLs
Use the [_HttpRequest.url_for()_][urlfor] method to generate URLs based on resource patterns. For example, if you've configured a resource with the name "foo" and the pattern "{a}/{b}/{c}", you might do this: Use the [_HttpRequest.url_for()_][urlfor] method to generate URLs based on resource patterns. For example, if you've configured a resource with the name "foo" and the pattern "\{a}/\{b}/\{c}", you might do this:
<CodeBlock example="url-dispatch" file="urls.rs" section="url" /> <CodeBlock example="url-dispatch" file="urls.rs" section="url" />

View File

@ -1,5 +1,7 @@
const path = require("path"); const path = require("path");
const {
themes: { dracula: draculaTheme },
} = require("prism-react-renderer");
module.exports = { module.exports = {
title: "Actix", title: "Actix",
tagline: tagline:
@ -46,7 +48,7 @@ module.exports = {
}, },
prism: { prism: {
// dracula is closest to docs.rs, where keywords are highlighted // dracula is closest to docs.rs, where keywords are highlighted
theme: require("prism-react-renderer/themes/dracula"), theme: draculaTheme,
additionalLanguages: ["rust", "toml"], additionalLanguages: ["rust", "toml"],
defaultLanguage: "rust", defaultLanguage: "rust",
}, },
@ -61,7 +63,7 @@ module.exports = {
{ {
docs: { docs: {
sidebarPath: require.resolve("./sidebars.js"), sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/actix/actix-website/edit/master/", editUrl: "https://github.com/actix/actix-website/edit/main/",
}, },
theme: { theme: {
customCss: require.resolve("./src/css/custom.css"), customCss: require.resolve("./src/css/custom.css"),

5613
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,18 +14,24 @@
"write-heading-ids": "docusaurus write-heading-ids" "write-heading-ids": "docusaurus write-heading-ids"
}, },
"dependencies": { "dependencies": {
"@docusaurus/core": "^2.0.0-beta", "@docusaurus/core": "3.0.0",
"@docusaurus/preset-classic": "^2.0.0-beta", "@docusaurus/preset-classic": "3.0.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.1.14", "@fortawesome/react-fontawesome": "^0.2",
"@mdx-js/react": "^1.6.21", "@mdx-js/react": "^3.0.0",
"clsx": "^1.1.1", "clsx": "^2.0.0",
"docusaurus-plugin-sass": "^0.2.2", "docusaurus-plugin-sass": "~0.2.5",
"react": "^17.0.1", "prism-react-renderer": "^2.1.0",
"react-dom": "^17.0.1", "react": "^18.0.2",
"react-dom": "^18.0.2",
"sass": "^1.53.0" "sass": "^1.53.0"
}, },
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/types": "3.0.0",
"raw-loader": "^4.0.2"
},
"browserslist": { "browserslist": {
"production": [ "production": [
">0.5%", ">0.5%",
@ -38,7 +44,7 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"devDependencies": { "engines": {
"raw-loader": "^4.0.2" "node": ">=18.0.0"
} }
} }

View File

@ -15,8 +15,7 @@ import {
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
const Home = () => { const Home = () => {
const context = useDocusaurusContext(); const {siteConfig} = useDocusaurusContext();
const siteConfig = context;
return ( return (
<Layout description={siteConfig.tagline}> <Layout description={siteConfig.tagline}>
@ -73,8 +72,7 @@ const highlights = [
]; ];
const Hero = () => { const Hero = () => {
const context = useDocusaurusContext(); const { siteConfig } = useDocusaurusContext();
const { siteConfig } = context;
return ( return (
<header id="hero" className={clsx("hero", styles.banner)}> <header id="hero" className={clsx("hero", styles.banner)}>