You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,12 +70,12 @@ A `src` directory tree might look something like this:
70
70
src % tree
71
71
.
72
72
├── md-page
73
-
│ ├── README.md #directories with README.md in them turn into /md-page/index.html.
73
+
│ ├── page.md #page.md (or README.md) in a directory turns into /md-page/index.html. page.md takes precedence.
74
74
│ ├── client.ts # Every page can define its own client.ts script that loads only with it.
75
75
│ ├── style.css # Every page can define its own style.css style that loads only with it.
76
76
│ ├── loose-md-page.md # loose markdown get built in place, but lacks some page features.
77
77
│ └── nested-page # pages are built in place and can nest.
78
-
│ ├── README.md # This page is accessed at /md-page/nested-page/.
78
+
│ ├── README.md # This page is accessed at /md-page/nested-page/. (page.md works here too)
79
79
│ ├── style.css # nested pages are just pages, so they also can have a page scoped client and style.
80
80
│ └── client.js # Anywhere JS loads, you can use .js or .ts
81
81
├── html-page
@@ -109,7 +109,7 @@ src % tree
109
109
│ ├── global.vars.ts # site wide variables get defined in global.vars.ts
110
110
│ ├── markdown-it.settings.ts # You can customize the markdown-it instance used to render markdown
111
111
│ └── esbuild.settings.ts # You can even customize the build settings passed to esbuild
112
-
├── README.md #This is just a top level page built from a README.md file.
112
+
├── page.md #The top level page can also be a page.md (or README.md) file.
113
113
├── client.ts # the top level page can define a page scoped js client.
114
114
├── style.css # the top level page can define a page scoped css style.
115
115
└── favicon-16x16.png # static assets can live anywhere. Anything other than JS, CSS and HTML get copied over automatically.
@@ -165,13 +165,15 @@ Because pages are just directories, they nest and structure naturally as a files
165
165
A `md` page looks like this on the filesystem:
166
166
167
167
```bash
168
+
src/page-name/page.md
169
+
# or
168
170
src/page-name/README.md
169
171
# or
170
172
src/page-name/loose-md.md
171
173
```
172
174
173
-
-`md` pages have two types: a `README.md` in a folder, or a loose `whatever-name-you-want.md` file.
174
-
-`README.md` files transform to an `index.html` at the same path, and`whatever-name-you-want.md` loose markdown files transform into `whatever-name-you-want.html` files at the same path in the `dest` directory.
175
+
-`md` pages have three types: a `page.md`, a `README.md`, or a loose `whatever-name-you-want.md` file.
176
+
-`page.md` and `README.md` files transform to an `index.html` at the same path. When both exist in the same directory, `page.md` takes precedence over `README.md`.`whatever-name-you-want.md` loose markdown files transform into `whatever-name-you-want.html` files at the same path in the `dest` directory.
175
177
-`md` pages can have YAML frontmatter, with variables that are accessible to the page layout and handlebars template blocks when building.
176
178
- You can include html in markdown files, so long as you adhere to the allowable markdown syntax around html tags.
177
179
-`md` pages support [handlebars][hb] template placeholders.
- Standardized entrypoints. Every page in a `domstack` site has a natural and obvious entrypoint. There is no magic redirection to learn about.
1251
1253
- Pages build into `index.html` files inside of named directories. This allows for naturally colocated assets next to the page, pretty URLs and full support for relative URLs.
1252
1254
- No parallel directory structures. You should never be forced to have two directories with identical layouts to put files next to each other. Everything should be colocatable.
1253
-
- Markdown entrypoints are named README.md. This allows for the `src` folder to be fully navigable in GitHub and other git repo hosting providing a natural hosted CMS UI.
1255
+
- Markdown entrypoints are named `page.md` or `README.md`. `README.md` allows for the `src` folder to be fully navigable in GitHub and other git repo hosting providing a natural hosted CMS UI. `page.md` is preferred when GitHub navigability is not a concern.
1254
1256
- Real TC39 ESM from the start.
1255
1257
- Garbage in, garbage out. Don't over-correct bad input.
1256
1258
- Conventions + standards. Vanilla file types. No new file extensions. No weird syntax to learn. Language tools should just work because you aren't doing anything weird or out of band.
@@ -1485,6 +1487,7 @@ Some notable features are included below, see the [roadmap](https://github.com/u
0 commit comments