Support excluding pages from build #1188
Closed
discoverlance-com
started this conversation in
Proposal
Replies: 1 comment 3 replies
-
For advanced cases like this, you must make a custom integration and use Basically, you want to inject routes when the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
The idea is to allow certain pages to be excluded from build or production and only accessible in dev environment.
Background & Motivation
I have internal documentation that I want to be able to add to my astro site and only view it in dev mode.
I want to take advantage of the routing in astro and support for markdown to render my internal docs for my site without referring to an external tool.
The problem is I don't want these files in my build. So ideally, I can view it in dev mode or when I run the astro dev server but during build (when I run astro build), I don't want to build the docs into my
dist
folder.I am not sure how this will affect the server side integration with astro as I am purely looking at static mode and just skipping the build of some html files.
Goals
Example
A situation where the build config is used
A situation where the build config is used but as a function
We could also adopt a pattern that does not base on the config and uses a file or page pattern like, say, we adopt the
_
pattern for the page name.src/pages/docs/_me.md
,src/pages/docs/_you.md
. So in this case, the docs me and you will be ignored during build. Or we could also just dosrc/pages/_docs/me.md
,/src/pages/_docs/you.md
and in this case, anything in_docs
will be ignored.Beta Was this translation helpful? Give feedback.
All reactions