Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for "non root" sites .. #38

Merged
merged 2 commits into from
May 1, 2024
Merged

prepare for "non root" sites .. #38

merged 2 commits into from
May 1, 2024

Conversation

gavineadie
Copy link
Contributor

In preparation for allowing Ignite to construct "non root" sites (ie: https://site.com/NONROOT/index.html), some protection and adjustments:

  • issue a warning if there's a \ in buildDirectoryPath
    (the warning is emitted in an Xcode build but not a CLI build)
  • allow the site directory to be created
    (change withIntermediateDirectories to true in PublishingContext)
  • don't copy hidden (".") files into site
    (I don't think web sites use hidden files, certainly not .DS_Store !)

My first PR -- please suggest any improvements

-- issue a warning
-- allow site directory to be created
-- don't copy hidden (".") files into site
@twostraws
Copy link
Owner

Thank you for this! Your first PR is always the most stressful, but it gets easier 🙂

The second change is a good step forward. The third change is interesting, although I'm not sure it's necessarily a good idea – some web servers use hidden files, e.g. .htaccess on Apache, to provide custom configurations for websites. If users put these into a directory, it would be annoying if they weren't copied. Perhaps if we copied hidden files, excluding those that appear in a blocklist? (Also, randomly: that method is called copyResources(), which is a bit confusing now that I added a separate Resources directory!)

I'm afraid I don't understand what the first change is trying to do 😅

Broadly speaking, it's a good idea to make each pull request solve one distinct problem, unless of course many things are tied together. So, if this were three individual PRs, I'd merge 2 on the spot, and we'd discuss 1 and 3 further. That's okay, though; leave this as one PR for now, and we can figure it out bit by bit.

@gavineadie
Copy link
Contributor Author

I submitted (1) to reduce an accidental use of a/b [I just noticed my PR talks about \ instead of /] failing in some nasty way if I submit a buggy or incomplete later PR. Prior to (2), having a / in buildDirectoryPath would not generate a site. It was my intent to remove that warning when I was done.

(3) .. yes, .htaccess trumps number (3) so don't use it -- after all, a .DS_Store or two isn't a big deal.

Summary: Take (2) and reject (1) and (3)! As a PR novice should I back out the two, or you just ignore them?

-- issue a warning
-- don't copy hidden (".") files into site
@gavineadie
Copy link
Contributor Author

I removed/reverted (1) and (3) from this branch ..

@twostraws
Copy link
Owner

Nailed it – thank you!

@twostraws twostraws merged commit 303eb63 into twostraws:main May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants