From 8be8bb6b24038e4afdcab73b9876bf1663cb5015 Mon Sep 17 00:00:00 2001 From: Dotan Nahum Date: Thu, 12 Sep 2024 13:52:51 +0300 Subject: [PATCH] wip --- docs-site/content/docs/extras/_index.md | 10 + .../{the-app => extras}/authentication.md | 0 .../docs/{the-app => extras}/channels.md | 0 .../docs/{the-app => extras}/pluggability.md | 0 .../docs/getting-started/tour/index.md | 2 +- .../content/docs/infrastructure/_index.md | 10 + .../docs/{the-app => infrastructure}/cache.md | 0 .../{the-app => infrastructure}/deployment.md | 0 .../{the-app => infrastructure}/storage.md | 0 docs-site/content/docs/processing/_index.md | 10 + .../docs/{the-app => processing}/mailers.md | 2 +- .../content/docs/processing/scheduler.md | 144 +++++++++ .../docs/{the-app => processing}/task.md | 0 .../docs/{the-app => processing}/workers.md | 2 +- .../{getting-started => resources}/faq.md | 0 .../live-examples.md | 0 docs-site/content/docs/the-app/models.md | 6 +- docs-site/static/icon.svg | 16 +- docs-site/static/styles/styles.css | 306 ++++++++++++++---- docs-site/styles/styles.css | 5 +- docs-site/tailwind.config.js | 3 + docs-site/templates/docs/page.html | 20 +- docs-site/templates/index.html | 14 +- docs-site/templates/macros/docs-sidebar.html | 42 +-- docs-site/templates/macros/header.html | 2 +- 25 files changed, 488 insertions(+), 106 deletions(-) create mode 100644 docs-site/content/docs/extras/_index.md rename docs-site/content/docs/{the-app => extras}/authentication.md (100%) rename docs-site/content/docs/{the-app => extras}/channels.md (100%) rename docs-site/content/docs/{the-app => extras}/pluggability.md (100%) create mode 100644 docs-site/content/docs/infrastructure/_index.md rename docs-site/content/docs/{the-app => infrastructure}/cache.md (100%) rename docs-site/content/docs/{the-app => infrastructure}/deployment.md (100%) rename docs-site/content/docs/{the-app => infrastructure}/storage.md (100%) create mode 100644 docs-site/content/docs/processing/_index.md rename docs-site/content/docs/{the-app => processing}/mailers.md (97%) create mode 100644 docs-site/content/docs/processing/scheduler.md rename docs-site/content/docs/{the-app => processing}/task.md (100%) rename docs-site/content/docs/{the-app => processing}/workers.md (95%) rename docs-site/content/docs/{getting-started => resources}/faq.md (100%) rename docs-site/content/docs/{getting-started => resources}/live-examples.md (100%) diff --git a/docs-site/content/docs/extras/_index.md b/docs-site/content/docs/extras/_index.md new file mode 100644 index 000000000..c34e987df --- /dev/null +++ b/docs-site/content/docs/extras/_index.md @@ -0,0 +1,10 @@ ++++ +title = "Extras" +description = "" +date = 2025-05-01T18:00:00+00:00 +updated = 2021-05-01T18:00:00+00:00 +template = "docs/section.html" +sort_by = "weight" +weight = 20 +draft = false ++++ diff --git a/docs-site/content/docs/the-app/authentication.md b/docs-site/content/docs/extras/authentication.md similarity index 100% rename from docs-site/content/docs/the-app/authentication.md rename to docs-site/content/docs/extras/authentication.md diff --git a/docs-site/content/docs/the-app/channels.md b/docs-site/content/docs/extras/channels.md similarity index 100% rename from docs-site/content/docs/the-app/channels.md rename to docs-site/content/docs/extras/channels.md diff --git a/docs-site/content/docs/the-app/pluggability.md b/docs-site/content/docs/extras/pluggability.md similarity index 100% rename from docs-site/content/docs/the-app/pluggability.md rename to docs-site/content/docs/extras/pluggability.md diff --git a/docs-site/content/docs/getting-started/tour/index.md b/docs-site/content/docs/getting-started/tour/index.md index 7b25ef6d4..536757188 100644 --- a/docs-site/content/docs/getting-started/tour/index.md +++ b/docs-site/content/docs/getting-started/tour/index.md @@ -1,5 +1,5 @@ +++ -title = "A Quick Tour with Loco" +title = "A Quick Tour" date = 2021-05-01T08:00:00+00:00 updated = 2021-05-01T08:00:00+00:00 draft = false diff --git a/docs-site/content/docs/infrastructure/_index.md b/docs-site/content/docs/infrastructure/_index.md new file mode 100644 index 000000000..20cbf97af --- /dev/null +++ b/docs-site/content/docs/infrastructure/_index.md @@ -0,0 +1,10 @@ ++++ +title = "Infrastructure" +description = "" +date = 2025-05-01T18:00:00+00:00 +updated = 2021-05-01T18:00:00+00:00 +template = "docs/section.html" +sort_by = "weight" +weight = 20 +draft = false ++++ diff --git a/docs-site/content/docs/the-app/cache.md b/docs-site/content/docs/infrastructure/cache.md similarity index 100% rename from docs-site/content/docs/the-app/cache.md rename to docs-site/content/docs/infrastructure/cache.md diff --git a/docs-site/content/docs/the-app/deployment.md b/docs-site/content/docs/infrastructure/deployment.md similarity index 100% rename from docs-site/content/docs/the-app/deployment.md rename to docs-site/content/docs/infrastructure/deployment.md diff --git a/docs-site/content/docs/the-app/storage.md b/docs-site/content/docs/infrastructure/storage.md similarity index 100% rename from docs-site/content/docs/the-app/storage.md rename to docs-site/content/docs/infrastructure/storage.md diff --git a/docs-site/content/docs/processing/_index.md b/docs-site/content/docs/processing/_index.md new file mode 100644 index 000000000..6a878ecb1 --- /dev/null +++ b/docs-site/content/docs/processing/_index.md @@ -0,0 +1,10 @@ ++++ +title = "Processing" +description = "" +date = 2025-05-01T18:00:00+00:00 +updated = 2021-05-01T18:00:00+00:00 +template = "docs/section.html" +sort_by = "weight" +weight = 20 +draft = false ++++ diff --git a/docs-site/content/docs/the-app/mailers.md b/docs-site/content/docs/processing/mailers.md similarity index 97% rename from docs-site/content/docs/the-app/mailers.md rename to docs-site/content/docs/processing/mailers.md index 8b6336cc3..a5e00c9f9 100644 --- a/docs-site/content/docs/the-app/mailers.md +++ b/docs-site/content/docs/processing/mailers.md @@ -174,7 +174,7 @@ mailer: stub: true ``` -Note: If your email sender operates within a [worker](@/docs/the-app/workers.md) process, ensure that the worker mode is set to ForegroundBlocking. +Note: If your email sender operates within a [worker](@/docs/processing/workers.md) process, ensure that the worker mode is set to ForegroundBlocking. Once you have configured the stub, proceed to your unit tests and follow the example below: diff --git a/docs-site/content/docs/processing/scheduler.md b/docs-site/content/docs/processing/scheduler.md new file mode 100644 index 000000000..7bc687420 --- /dev/null +++ b/docs-site/content/docs/processing/scheduler.md @@ -0,0 +1,144 @@ ++++ +title = "Scheduler" +description = "" +date = 2024-11-09T18:10:00+00:00 +updated = 2024-11-09T18:10:00+00:00 +draft = false +weight = 17 +sort_by = "weight" +template = "docs/page.html" + +[extra] +lead = "" +toc = true +top = false +flair =[] ++++ + + +Loco simplifies the traditional, often cumbersome `crontab` system, making it easier and more elegant to schedule cron jobs. The scheduler job can execute either a shell script command or run a registered [task](./task.md). + + +## Setting Up +Scheduler jobs can be configured via a your YAML scheduler setup file or as part of an environment YAML file. + + +### 1. Your Dedicated File +Using a dedicated file provides a centralized place to configure all your scheduler jobs, making it easier to manage and maintain. You can start by generating a template file using the Loco generator command: + +```sh +cargo loco generate scheduler +``` + +This command creates a `scheduler.yaml` file under the `config` folder. You can then configure your jobs within this file. + +### 2. Environment Configuration File +You can also configure scheduler jobs per environment by adding the scheduler section to your environment's YAML configuration file: +```yaml +jobs: + add text: + run: "echo loco >> ./scheduler.txt" + shell: true + cron: "*/1 * * * * *" + tags: + - base + - infra + + Run command: + run: "foo path:/tmp/scheduler.txt" + cron: "*/5 * * * * *" + + list if users: + run: "user_report" + cron: "*/7 * * * * *" + tags: + - base + - users + +``` + +## Scheduler Configuration + +The scheduler configuration consists of the following elements: + +* `scheduler.output` (Optional): Sets the default output location for all jobs. + * `stdout:` Output to the console (default). + * `silent:` Suppress all output. +* `scheduler.jobs:` A object of jobs to be scheduled, the object key describe the job name. Each job has: + * `cron`: The cron expression that defines the job's schedule. + The cron get an english that convert to cron syntax or cron syntax itself. + + ##### ***English to cron*** + * Examples: + * every 15 seconds + * run every minute + * fire every day at 4:00 pm + * at 10:00 am + * run at midnight on the 1st and 15th of the month + * On Sunday at 12:00 + * 7pm every Thursday + * midnight on Tuesdays + + ##### ***Cron Syntax format:*** + The cronjob should be UTC based + ```sh + sec min hour day of month month day of week year + * * * * * * * + ``` + * `shell`: by default `false` meaning executing the the `run` value as a task. if `true` execute the `run` value as shell command + * `run`: Cronjob command to run. + * `Task:` The task name (with variables e.x `[TASK_NAME] KEY:VAl`. follow [here](./task.md) to see task arguments ). Note that the `shell` field should be false. + * `Shell`: Run a shell command (e.x `"echo loco >> ./scheduler.txt"`). Note that the `shell` field should be true. + * `tags` (Optional): A list of tags to categorize and manage the job. + * `output` (Optional): Overrides the global `scheduler.output` for this job. + + +## Verifying the Configuration +After setting up your jobs, you can verify the configuration to ensure everything is correct. + +### 1. When using a dedicated file: +Run the following command to list the jobs from your scheduler file: + +```sh +cargo loco scheduler --path config/scheduler.yaml --list +``` + + +### 2. When using environment-based configuration: +To list jobs from the environment configuration, run: + +```sh +LOCO_ENV=production cargo loco scheduler --list +``` + + + +## Running the Scheduler +Once the configuration is verified, you can remove the `--list` flag to start running the scheduler. The scheduler will continuously execute jobs based on their schedule until a shutdown signal is received. When a signal is received, it gracefully terminates all running tasks and shuts down safely. + +### Important Notes: +* When a job is running, `Loco` spawns it in a new process, and all environment variables will propagate to the new job process. +* For tasks, ensure you run the scheduler with a valid environment by using the `--environment` flag or setting the `LOCO_ENV` environment variable. This ensures the correct environment and configuration are loaded for the task. +* You can pass variables to tasks by using the vars object in the task configuration. + + +## Running a Single Scheduled Job by Name +To run a specific scheduler job by its name, use the --name flag. This will execute a single job with the provided name. + +```sh +LOCO_ENV=production cargo loco scheduler --name 'JOB_NAME' +``` + + +This command will locate the job named `"Run command"` in your scheduler.yaml file and run it. + +## Running Scheduled Jobs by Tag +You can also run multiple jobs that share the same tag. Tags are useful for grouping related jobs together. For example, you might have several jobs that perform different types of maintenance tasks—such as database cleanup, cache invalidation, and log rotation—that you want to run together. Assigning them the same tag, like `maintenance`, allows you to execute them all at once. + +```sh +LOCO_ENV=production cargo loco scheduler --tag 'maintenance' +``` + + + +This command runs all jobs that have been tagged with `maintenance`, ensuring that all related jobs are executed in one go. diff --git a/docs-site/content/docs/the-app/task.md b/docs-site/content/docs/processing/task.md similarity index 100% rename from docs-site/content/docs/the-app/task.md rename to docs-site/content/docs/processing/task.md diff --git a/docs-site/content/docs/the-app/workers.md b/docs-site/content/docs/processing/workers.md similarity index 95% rename from docs-site/content/docs/the-app/workers.md rename to docs-site/content/docs/processing/workers.md index c0bec4ae4..4e0227942 100644 --- a/docs-site/content/docs/the-app/workers.md +++ b/docs-site/content/docs/processing/workers.md @@ -100,7 +100,7 @@ You can easily test your worker background jobs using `Loco`. Ensure that your w It's recommended to implement tests in the `tests/workers` directory to consolidate all your worker tests in one place. -Additionally, you can leverage the [worker generator](@/docs/the-app/workers.md#generate-a-worker), which automatically creates tests, saving you time on configuring tests in the library. +Additionally, you can leverage the [worker generator](@/docs/processing/workers.md#generate-a-worker), which automatically creates tests, saving you time on configuring tests in the library. Here's an example of how the test should be structured: diff --git a/docs-site/content/docs/getting-started/faq.md b/docs-site/content/docs/resources/faq.md similarity index 100% rename from docs-site/content/docs/getting-started/faq.md rename to docs-site/content/docs/resources/faq.md diff --git a/docs-site/content/docs/getting-started/live-examples.md b/docs-site/content/docs/resources/live-examples.md similarity index 100% rename from docs-site/content/docs/getting-started/live-examples.md rename to docs-site/content/docs/resources/live-examples.md diff --git a/docs-site/content/docs/the-app/models.md b/docs-site/content/docs/the-app/models.md index e91d211d9..20b3195a2 100644 --- a/docs-site/content/docs/the-app/models.md +++ b/docs-site/content/docs/the-app/models.md @@ -487,7 +487,7 @@ The seed process is not executed automatically. You can trigger the seed process ### Using a Task -1. Create a seeding task by following the instructions in the [Task Documentation](@/docs/the-app/task.md). +1. Create a seeding task by following the instructions in the [Task Documentation](@/docs/processing/task.md). 2. Configure the task to execute the `seed` function, as demonstrated in the example below: ```rust @@ -563,7 +563,7 @@ After configuring the database, import [loco-extras](https://crates.io/crates/lo loco-extras = { version = "*", features = ["initializer-extra-db"] } ``` -Next load this [initializer](@/docs/the-app/pluggability.md#initializers) into `initializers` hook like this example +Next load this [initializer](@/docs/extras/pluggability.md#initializers) into `initializers` hook like this example ```rs async fn initializers(ctx: &AppContext) -> Result>> { @@ -622,7 +622,7 @@ settings: dangerously_recreate: false ``` -Next load this [initializer](@/docs/the-app/pluggability.md#initializers) into `initializers` hook like this example +Next load this [initializer](@/docs/extras/pluggability.md#initializers) into `initializers` hook like this example ```rs async fn initializers(ctx: &AppContext) -> Result>> { diff --git a/docs-site/static/icon.svg b/docs-site/static/icon.svg index 228320dc9..473d0e5c5 100644 --- a/docs-site/static/icon.svg +++ b/docs-site/static/icon.svg @@ -1,23 +1,19 @@ - + - + - - - - - - - - + + + + diff --git a/docs-site/static/styles/styles.css b/docs-site/static/styles/styles.css index ffa48e0b2..3e7d8bad3 100644 --- a/docs-site/static/styles/styles.css +++ b/docs-site/static/styles/styles.css @@ -449,8 +449,12 @@ video { :root { --background: #ffffff; --background-secondary: #5F456B; - --foreground: #1d1d1f; + /* 1f2937 gray-800*/ + --foreground: #1f2937; + /* gray-900 */ --primary: #D45546; + --redrust: #c12110; + --orangerust: #cc4111; --border: #3A3A54; --card: #1D1D2A; --card-foreground: #FDCEF1; @@ -974,7 +978,7 @@ a.active { } .prose { - --tw-prose-body: #374151; + --tw-prose-body: var(--foreground); --tw-prose-headings: var(--foreground); --tw-prose-lead: #4b5563; --tw-prose-links: #111827; @@ -1136,10 +1140,6 @@ a.active { position: static; } -.fixed { - position: fixed; -} - .absolute { position: absolute; } @@ -1168,10 +1168,6 @@ a.active { top: 0px; } -.top-14 { - top: 3.5rem; -} - .top-16 { top: 4rem; } @@ -1184,10 +1180,6 @@ a.active { z-index: 10; } -.z-30 { - z-index: 30; -} - .z-50 { z-index: 50; } @@ -1234,10 +1226,6 @@ a.active { margin-bottom: 1.25rem; } -.-ml-2 { - margin-left: -0.5rem; -} - .-mt-1 { margin-top: -0.25rem; } @@ -1286,10 +1274,6 @@ a.active { margin-inline-start: auto; } -.mt-20 { - margin-top: 5rem; -} - .mt-3 { margin-top: 0.75rem; } @@ -1298,10 +1282,34 @@ a.active { margin-top: -60px; } +.mt-\[9px\] { + margin-top: 9px; +} + +.mb-2 { + margin-bottom: 0.5rem; +} + +.ml-\[-2px\] { + margin-left: -2px; +} + +.ml-\[-3px\] { + margin-left: -3px; +} + +.ml-\[-4px\] { + margin-left: -4px; +} + .block { display: block; } +.inline-block { + display: inline-block; +} + .inline { display: inline; } @@ -1390,6 +1398,10 @@ a.active { max-width: 100%; } +.max-w-full { + max-width: 100%; +} + .max-w-md { max-width: 28rem; } @@ -1398,22 +1410,22 @@ a.active { flex: 1 1 0%; } -.shrink-0 { - flex-shrink: 0; -} - .grow { flex-grow: 1; } -.scroll-m-20 { - scroll-margin: 5rem; +.flex-row { + flex-direction: row; } .flex-col { flex-direction: column; } +.flex-wrap { + flex-wrap: wrap; +} + .items-start { align-items: flex-start; } @@ -1442,6 +1454,22 @@ a.active { gap: 1.5rem; } +.gap-3 { + gap: 0.75rem; +} + +.gap-8 { + gap: 2rem; +} + +.gap-10 { + gap: 2.5rem; +} + +.gap-5 { + gap: 1.25rem; +} + .space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0.5rem * var(--tw-space-x-reverse)); @@ -1498,10 +1526,86 @@ a.active { border-width: 1px; } +.border-b { + border-bottom-width: 1px; +} + .border-transparent { border-color: transparent; } +.border-red-100 { + --tw-border-opacity: 1; + border-color: rgb(254 226 226 / var(--tw-border-opacity)); +} + +.border-red-300 { + --tw-border-opacity: 1; + border-color: rgb(252 165 165 / var(--tw-border-opacity)); +} + +.border-red-400 { + --tw-border-opacity: 1; + border-color: rgb(248 113 113 / var(--tw-border-opacity)); +} + +.border-redrust { + border-color: var(--redrust); +} + +.border-red-500 { + --tw-border-opacity: 1; + border-color: rgb(239 68 68 / var(--tw-border-opacity)); +} + +.border-red-200 { + --tw-border-opacity: 1; + border-color: rgb(254 202 202 / var(--tw-border-opacity)); +} + +.border-red-300\/5 { + border-color: rgb(252 165 165 / 0.05); +} + +.border-red-900\/5 { + border-color: rgb(127 29 29 / 0.05); +} + +.border-red-900\/15 { + border-color: rgb(127 29 29 / 0.15); +} + +.border-red-100\/15 { + border-color: rgb(254 226 226 / 0.15); +} + +.border-red-100\/25 { + border-color: rgb(254 226 226 / 0.25); +} + +.border-red-100\/40 { + border-color: rgb(254 226 226 / 0.4); +} + +.border-red-100\/50 { + border-color: rgb(254 226 226 / 0.5); +} + +.border-white { + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + +.border-gray-50 { + --tw-border-opacity: 1; + border-color: rgb(249 250 251 / var(--tw-border-opacity)); +} + +.border-red-50 { + --tw-border-opacity: 1; + border-color: rgb(254 242 242 / var(--tw-border-opacity)); +} + .bg-background { background-color: var(--background); } @@ -1510,10 +1614,23 @@ a.active { background-color: var(--card); } +.bg-gray-100 { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + .bg-inherit { background-color: inherit; } +.bg-orangerust { + background-color: var(--orangerust); +} + +.bg-redrust { + background-color: var(--redrust); +} + .bg-transparent { background-color: transparent; } @@ -1523,6 +1640,10 @@ a.active { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } +.bg-white\/95 { + background-color: rgb(255 255 255 / 0.95); +} + .bg-left-bottom { background-position: left bottom; } @@ -1554,6 +1675,11 @@ a.active { padding-right: 1rem; } +.px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; +} + .py-0 { padding-top: 0px; padding-bottom: 0px; @@ -1584,10 +1710,34 @@ a.active { padding-bottom: 2rem; } +.px-0\.5 { + padding-left: 0.125rem; + padding-right: 0.125rem; +} + +.px-1 { + padding-left: 0.25rem; + padding-right: 0.25rem; +} + +.py-0\.5 { + padding-top: 0.125rem; + padding-bottom: 0.125rem; +} + +.px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; +} + .pb-10 { padding-bottom: 2.5rem; } +.pb-12 { + padding-bottom: 3rem; +} + .pb-20 { padding-bottom: 5rem; } @@ -1600,6 +1750,10 @@ a.active { padding-left: 1.25rem; } +.pr-12 { + padding-right: 3rem; +} + .pt-20 { padding-top: 5rem; } @@ -1616,10 +1770,6 @@ a.active { padding-top: 2rem; } -.pb-12 { - padding-bottom: 3rem; -} - .text-left { text-align: left; } @@ -1674,10 +1824,6 @@ a.active { font-weight: 600; } -.tracking-tight { - letter-spacing: -0.025em; -} - .text-background { color: var(--background); } @@ -1714,6 +1860,11 @@ a.active { color: rgb(248 113 113 / var(--tw-text-opacity)); } +.text-yellow-200 { + --tw-text-opacity: 1; + color: rgb(254 240 138 / var(--tw-text-opacity)); +} + .text-yellow-400 { --tw-text-opacity: 1; color: rgb(250 204 21 / var(--tw-text-opacity)); @@ -1724,6 +1875,35 @@ a.active { color: rgb(234 179 8 / var(--tw-text-opacity)); } +.text-red-200 { + --tw-text-opacity: 1; + color: rgb(254 202 202 / var(--tw-text-opacity)); +} + +.text-red-300 { + --tw-text-opacity: 1; + color: rgb(252 165 165 / var(--tw-text-opacity)); +} + +.text-red-800 { + --tw-text-opacity: 1; + color: rgb(153 27 27 / var(--tw-text-opacity)); +} + +.text-red-900 { + --tw-text-opacity: 1; + color: rgb(127 29 29 / var(--tw-text-opacity)); +} + +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.underline { + text-decoration-line: underline; +} + .placeholder-white::-moz-placeholder { --tw-placeholder-opacity: 1; color: rgb(255 255 255 / var(--tw-placeholder-opacity)); @@ -1764,17 +1944,6 @@ a.active { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } -.backdrop-blur { - --tw-backdrop-blur: blur(8px); - -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); - backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); -} - -.backdrop-filter { - -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); - backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); -} - .transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); @@ -1893,10 +2062,25 @@ a.active { margin-bottom: 0.5rem; } +.hover\:border-red-100:hover { + --tw-border-opacity: 1; + border-color: rgb(254 226 226 / var(--tw-border-opacity)); +} + .hover\:bg-transparent:hover { background-color: transparent; } +.hover\:text-white:hover { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.hover\:text-red-100:hover { + --tw-text-opacity: 1; + color: rgb(254 226 226 / var(--tw-text-opacity)); +} + .hover\:underline:hover { text-decoration-line: underline; } @@ -1945,10 +2129,6 @@ a.active { position: relative; } - .md\:sticky { - position: sticky; - } - .md\:mx-auto { margin-left: auto; margin-right: auto; @@ -1958,10 +2138,6 @@ a.active { margin-top: 0px; } - .md\:block { - display: block; - } - .md\:flex { display: flex; } @@ -1994,10 +2170,26 @@ a.active { grid-template-columns: 220px minmax(0,1fr); } + .md\:grid-cols-\[minmax\(0\2c 1fr\)_220px\] { + grid-template-columns: minmax(0,1fr) 220px; + } + .md\:justify-end { justify-content: flex-end; } + .md\:gap-5 { + gap: 1.25rem; + } + + .md\:gap-8 { + gap: 2rem; + } + + .md\:gap-10 { + gap: 2.5rem; + } + .md\:bg-transparent { background-color: transparent; } @@ -2020,6 +2212,10 @@ a.active { grid-template-columns: 240px minmax(0,1fr); } + .lg\:grid-cols-\[minmax\(0\2c 1fr\)_240px\] { + grid-template-columns: minmax(0,1fr) 240px; + } + .lg\:gap-6 { gap: 1.5rem; } diff --git a/docs-site/styles/styles.css b/docs-site/styles/styles.css index 1c8205d1d..cad7a22ec 100644 --- a/docs-site/styles/styles.css +++ b/docs-site/styles/styles.css @@ -8,8 +8,11 @@ --background: #ffffff; --background-secondary: #5F456B; - --foreground: #1d1d1f; + /* 1f2937 gray-800*/ + --foreground: #1f2937; /* gray-900 */ --primary: #D45546; + --redrust: #c12110; + --orangerust: #cc4111; --border: #3A3A54; diff --git a/docs-site/tailwind.config.js b/docs-site/tailwind.config.js index 6102f82d7..3ceffa921 100644 --- a/docs-site/tailwind.config.js +++ b/docs-site/tailwind.config.js @@ -11,6 +11,7 @@ module.exports = { // this is for prose class css: { "--tw-prose-headings": theme("colors.foreground"), + "--tw-prose-body": theme("colors.foreground"), }, }, }), @@ -19,6 +20,8 @@ module.exports = { background: "var(--background)", "background-secondary": "var(--background-secondary)", foreground: "var(--foreground)", + redrust: "var(--redrust)", + orangerust: "var(--orangerust)", primary: { DEFAULT: "var(--primary)", foreground: "var(--primary-foreground)", diff --git a/docs-site/templates/docs/page.html b/docs-site/templates/docs/page.html index 99db56f89..648a4c656 100644 --- a/docs-site/templates/docs/page.html +++ b/docs-site/templates/docs/page.html @@ -12,16 +12,21 @@ {% block content %}
+
+
+ +
+
- + class="container flex-1 items-start md:grid md:grid-cols-[minmax(0,1fr)_220px] lg:grid-cols-[minmax(0,1fr)_240px]">
-

{{ page.title | safe }}

- {% if page.extra.lead %}

{{ page.extra.lead | safe }}

{% endif %} -
+
+

{{ page.title | safe }}

+ {% if page.extra.lead %}

{{ page.extra.lead | safe }}

{% endif %} + {{ page.content | safe }}
{% if config.extra.edit_page %} @@ -45,6 +50,7 @@

{{ page.title |

+
diff --git a/docs-site/templates/index.html b/docs-site/templates/index.html index 37bf02eb1..f6ffb3bdc 100644 --- a/docs-site/templates/index.html +++ b/docs-site/templates/index.html @@ -26,11 +26,11 @@
- +
-
+

It’s Like Ruby on Rails, but for Rust. @@ -50,7 +50,7 @@

-
+

It’s time to make Rust your super-power. @@ -111,7 +111,7 @@

-
+

Enjoy that sweet & effortless Rust performance @@ -134,9 +134,9 @@

-
+
-
+

Build apps locally and save lots of time.

@@ -169,7 +169,7 @@

-
+
diff --git a/docs-site/templates/macros/docs-sidebar.html b/docs-site/templates/macros/docs-sidebar.html index 72c1ef905..53ac25298 100644 --- a/docs-site/templates/macros/docs-sidebar.html +++ b/docs-site/templates/macros/docs-sidebar.html @@ -1,33 +1,37 @@ {% macro docs_sidebar(current_section) %}
-
{% endif %} {% if index.subsections %} {% for s in index.subsections %} {% set subsection = get_section(path=s) %} {% if subsection.pages %} -

{{ subsection.title }}

- +
+

{{ subsection.title }}

+ +
{% endif %} {% endfor %} {% endif %} diff --git a/docs-site/templates/macros/header.html b/docs-site/templates/macros/header.html index 47e074853..d4838940f 100644 --- a/docs-site/templates/macros/header.html +++ b/docs-site/templates/macros/header.html @@ -1,6 +1,6 @@ {% macro header(current_section) %}
+ class="sticky top-0 z-50 w-full border-border/40 bg-white/95">