web

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

包 web 内嵌前端静态资源(index.html、assets/ 等),供 cmd/mdread 装配时使用。

go:embed 的路径只能相对“包含该指令的源文件所在目录”解析,不支持 ".." 或绝对路径,因此无法在 cmd/mdread/main.go 里直接嵌入仓库根目录下的 web/ (二者不在同一目录,也不允许用符号链接绕过——go:embed 会拒绝内嵌不规则文件)。 于是把嵌入指令下沉到 web 自己的包里,cmd/mdread 通过普通 import 使用其 导出的 FS 即可:web/ 目录里已有的 index.html、assets/,以及后续任务追加的 前端文件,都会被自动收进这个只读文件系统,cmd/mdread 无需再关心目录前缀。

Index

Constants

This section is empty.

Variables

FS 是内嵌的前端资源文件系统,根路径下直接是 index.html、assets/ 等, 不带 "web/" 前缀,可直接交给 HTTP 层做静态文件服务。

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL