Comments (3)
I assume it has to do with the fact that Mike is actually using git fast-import with a Stream File it creates by reading the actual content of the files (including binaries). So the git lfs filter is by-passed.
https://github.com/jimporter/mike/blob/master/mike/git_utils.py#L301
What do you think?
from mike.
Ugly quick test with hardcoded .jpg extension and a change of the signature, but it seems to work:
def add_file(self, file_info, original=None):
self._write('M {mode:06o} inline {path}\n'.format(
path=git_path(file_info.path), mode=file_info.mode
))
if file_info.path.endswith(".jpg"):
cmd = ['git', 'lfs', 'pointer', '--file={}'.format(original.path)]
p = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True)
if p.returncode != 0:
raise GitError('error getting lfs pointer', p.stderr)
data = p.stdout.strip()
self._write_data(data)
else:
self._write_data(file_info.data)
from mike.
Sorry, but I don't intend to support this directly (maybe #161 could provide the necessary hooks for this, but then again maybe not). Mike is already quite a bit more complex than I ever wanted it to be, and given that Git LFS isn't even the only way of storing large binaries with Git, I'd prefer not to open this particular can of worms.
Instead, I'd recommend hosting your large binaries elsewhere (ideally not in a Git branch at all), such as by using Github releases and just linking to them. If you're deploying this site to some non-Github location (e.g. your own server), I'd recommend using something other than mike entirely. You could probably make a better solution than this without too much work: one that doesn't shove build artifacts (including generated HTML docs) into a Git branch, which really isn't the ideal place for them. (Of course, you could still use the versions.json
management code from mike so that things work smoothly with your theme.)
If you're dead-set on using mike and storing large binaries with Git LFS in your gh-pages
branch, then I'd recommend managing those binaries separately from mike. You could add an assets
directory to the root of your gh-pages
branch and add+commit any binary files you want to that directory using the normal Git commands.
from mike.
Related Issues (20)
- Setting Up Multi-Product Documentation URLs with MkDocs and Mike HOT 2
- Use `canonical_version` to defer Google etc. indexing old docs, but how?
- Some config values are not supported despite that they are mentioned in Configuration description. HOT 2
- gh-pages redirect/forward to default version not working HOT 2
- [HELP WANTED] versioning doesn't appear on setup (serve locally) HOT 1
- PyPI release HOT 1
- versioning doesn't appear on setup (serve locally) HOT 1
- Add support for "hidden" versions to the built-in theme extensions HOT 2
- The `latest` folder with redirects deleted by mike 2.0.0 HOT 20
- "Nice to have" FR: a way to do the equivalent of `git show --stat` *if* a commit is created HOT 3
- 'mike deploy'does not honor the mkdocs extra HOT 3
- mkdocs-material deployment with Groups plugin fails with Error: 'GroupPlugin' object has no attribute 'is_serve' HOT 7
- Help/clarification on replacing `--rebase` in `mike v2.0` HOT 7
- Can't mike deploy when using !relative in mkdocs config HOT 11
- Improve usability on non-Github forges HOT 2
- Mike fails to deploy HOT 6
- Is it possible to use mkdocs --no-directory-urls option from mike? HOT 2
- Versioning of sub-folders
- Recommendations on removing versions from a GHA published site
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mike.