mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 21:22:43 +00:00
docs(docs): restructure documentation paths and add new introduction file
This commit is contained in:
1 parent
995fed2950
commit
9e8117fcf6
19 files changed
+10
-44
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: Getting Started
|
||||
description: Welcome to your new Blume docs.
|
||||
sidebar:
|
||||
icon: home
|
||||
---
|
||||
|
||||
## Coding Patterns
|
||||
|
||||
Welcome to **Blume** — markdown-first docs powered by Astro and Vite.
|
||||
|
||||
## System Design
|
||||
|
||||
Edit `content/index.mdx` to get started, then run `blume dev`.
|
||||
|
||||
## Behavioral
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: Introduction
|
||||
description: Welcome to your new Blume docs.
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
Welcome to **Blume** — markdown-first docs powered by Astro and Vite.
|
||||
|
||||
Edit `docs/index.mdx` to get started, then run `blume dev`.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,28 +0,0 @@
|
||||
export default {
|
||||
async fetch(request, env) {
|
||||
const auth = request.headers.get("Authorization") ?? "";
|
||||
if (auth.startsWith("Basic ")) {
|
||||
let ok = false;
|
||||
try {
|
||||
const decoded = atob(auth.slice(6));
|
||||
const password = decoded.slice(decoded.indexOf(":") + 1); // password may contain ':'
|
||||
ok = await passwordMatches(password, env.SITE_PASSWORD);
|
||||
} catch {}
|
||||
if (ok) return env.ASSETS.fetch(request);
|
||||
}
|
||||
return new Response("Authentication required", {
|
||||
status: 401,
|
||||
headers: { "WWW-Authenticate": 'Basic realm="leetcode-docs", charset="UTF-8"' },
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// timingSafeEqual needs equal-length buffers → hash both sides first
|
||||
async function passwordMatches(candidate, expected) {
|
||||
const enc = new TextEncoder();
|
||||
const [a, b] = await Promise.all([
|
||||
crypto.subtle.digest("SHA-256", enc.encode(candidate)),
|
||||
crypto.subtle.digest("SHA-256", enc.encode(expected)),
|
||||
]);
|
||||
return crypto.subtle.timingSafeEqual(a, b);
|
||||
}
|
||||
Reference in new issue
Block a user