docs icon indicating copy to clipboard operation
docs copied to clipboard

Document excluding pages and directories from build

Open zadeviggers opened this issue 2 years ago • 12 comments

Documents how to exclude pages or directories from being built by prefixing their name with an underscore.

zadeviggers avatar Mar 26 '22 00:03 zadeviggers

Deploy Preview for astro-docs-2 ready!

Name Link
Latest commit adb3c0c8b1d0be7a912efb22fca723017462a4f6
Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/63190d909cc3fd00080bf4a6
Deploy Preview https://deploy-preview-265--astro-docs-2.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Mar 26 '22 00:03 netlify[bot]

I think this looks good! Short and sweet! Just left one comment re: the header for the example. :)

sarah11918 avatar Mar 27 '22 22:03 sarah11918

(FYI @zadeviggers , I'm just waiting on this one until a larger PR on that Routing page is merged. Then, this will just be a tiny, non-conflicting addition to it.) :)

sarah11918 avatar Mar 28 '22 14:03 sarah11918

This is good documentation but I'm actually not sure if we meant for this feature to exist. If you're alright with sitting tight, I'd like to run this by our maintainers group and get their +1/-1 before we document.

FredKSchott avatar Mar 29 '22 03:03 FredKSchott

I really hope this feature continues to exist, or my projects will become significantly more work than what I already have to do because I can't co-locate static assets with my content :heavy_plus_sign: :infinity:

In fact, please consider adding pattern-based allow/deny lists for Astro to process someday in the future :blush:

5310 avatar Apr 05 '22 12:04 5310

Poor @zadeviggers still waiting to hear whether he found an undocumented feature, or an easter egg, or what! Just wanted to let you know that I haven't forgotten about you, and I have added a label to prompt core to weigh in on this.

sarah11918 avatar May 12 '22 18:05 sarah11918

Lets bring this up on an RFC call! The feature has come up a few times before but was never decided on, since it already technically works the question really is just whether it's officially supported 👍

tony-sull avatar May 17 '22 16:05 tony-sull

@tony-sull Should @zadeviggers make an official RFC proposal for this on withastro/rfc ?

One "gotcha" coming up: I suspect we're going to move this Routing page back into "Learn" (and out of API). We've already worked so hard to get the wording/diagram just right, but so much has changed and I can see there are already going to be some conflicts to resolve, even before we move the page...

I'm wondering whether it makes sense for @zadeviggers to capture these exact edits and stash them somewhere (in an RFC?!) and we close this PR since it still seems no where near getting the go-ahead to merge.

That way, the rest of the site can change, this page can move to an entirely new location... and maybe as a result of the RFC the team decides that they want to implement this slightly differently anyway, so we're waiting on those decisions before we know what to document?

What does everyone think?

sarah11918 avatar May 17 '22 23:05 sarah11918

Does @zadeviggers want to do that? It does seem like it might be a path to grabbing some of core's attention and getting a decision. But don't know if this feature is important enough to you that you would want to champion it in this way.

delucis avatar May 18 '22 18:05 delucis

Well, THAT's a good point, too! Sorry, @zadeviggers , didn't mean to be putting RFCs in your mouth! ;)

Even if we end up closing this PR, the info is still "stashed" here, should we need it again. I just think this feels no where near close to being an actual thing to document yet, and I'm trying to think about how to proceed in light of that. Open to other ideas, too!

A problem with just documenting it as it currently happens to work (as I might tend to do for convenience) without a clear committment of future support is that people might build their entire projects around it not realizing that it's not a core/key thing and no one is working to ensure that it supported.

sarah11918 avatar May 18 '22 19:05 sarah11918

I think it makes sense to at least convert this to a draft.

@zadeviggers Would you like me to take on writing up an RFC? I think this feature or something like it would be super helpful and given it already exists I think it would be good to get a quick-ish 👍/👎 from the team.

delucis avatar May 19 '22 23:05 delucis

@zadeviggers Would you like me to take on writing up an RFC? I think this feature or something like it would be super helpful and given it already exists I think it would be good to get a quick-ish 👍/👎 from the team.

Of course! Feel free to do whatever you want, no need to ask me first.

zadeviggers avatar May 20 '22 01:05 zadeviggers

I think it makes sense to at least convert this to a draft.

@zadeviggers Would you like me to take on writing up an RFC? I think this feature or something like it would be super helpful and given it already exists I think it would be good to get a quick-ish 👍/👎 from the team.

Can you point me to the location of this RFC? Failed to find it in https://github.com/withastro/rfcs

I found this excluding feature to be confusing when used alongside Astro.glob, since there's no pages generated when their names are prefixed with underscore, but you still have them listed in Astro.glob's result, which means you'll have to filter them with code like:

allPosts
      .filter((post) => {
        return !post.file.split(path.sep).some((name) => name.startsWith('_'))
      })

chenxsan avatar Nov 26 '22 16:11 chenxsan