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

Add option to specify the mime type for files matching a pattern #37

Open
wants to merge 1 commit into
base: py3
Choose a base branch
from

Conversation

debbiedub
Copy link
Contributor

The option is saved per added site.

First time that this version is used, the option is saved for all sites. This is not different from how other options are handled but could be confusing because on subsequent updates, the option is ignored and the value is set for all sites in your config-dir, even the ones you do not update.

The option is saved per added site.

First time that this version is used, the option is saved for all sites.
This is not different from how other options are handled but could be
confusing because on subsequent updates, the option is ignored and the
value is set for all sites in your config-dir, even the ones you do not
update.
@@ -271,6 +271,10 @@ def help():
print(" - index file (default is index.html)")
print(" -m, --mime-type")
print(" - mime-type of the index file (default is \"text/html\")")
print(" --mime-type-match=PATTERN=MIME/TYPE")
print(" Set mime-type for files matching PATTERN. Can be given")
print(" multiple times to match distinct patterns.")
Copy link
Contributor Author

@debbiedub debbiedub Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot more to say about this but I don't think this is the place.

Among other things:

  • If no files match, the mime-type will be determined my fcp3/node.py guestMimeType(filename) that in turn uses mimetypes.guess_type(filename, False).
  • The order is significant, i.e. --mime-type-match=*.gif=image/gif --mime-type-match=databasefiles/*=text/plain will, for the file databasefiles/somedir/*.gif give the mime-type image/gif while --mime-type-match=databasefiles/*=text/plain --mime-type-match=*.gif=image/gif will give the mime-type text/plain for the same file name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add that information in a file in doc/? Maybe with an example how to use this to upload a repo for dgof? Maybe as doc/freesitemgr.org ? (in org-mode format — markdown would also work)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, yes. I will see if I understand the org-mode format. I will do that in another pull request.

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