Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
add basic text file imports #172
this adds basic support for importing files as blog posts. .txt and .md are supported at this time and the collection is selectable, defaulting to draft. if a collection is specified the post is federated.
I got a big sidetracked down the rabbit hole of #96, once I figured out what was getting in my way I remembered seeing something about the
so there may be things I missed migrating to a fresh branch, but quick manual tests were successful.
It's looking pretty good. I would prefer if the errors could be in a similar style box as the success alert, it would look a bit more polished.
Other than that I might change the form to allow all plain text files, not just .txt and .md. Then verify they are plain text again on the server. Not everyone will use files extensions.
- Changes Import link location in dropdown menu - Makes design consistent with Invite People page (and extracts some common CSS into core.less) - Selects the user's first blog by default in the dropdown - Changes the copy a bit Ref T609
- Only retrieve a collection from database if an alias is submitted - Only call GetCollection() once (previously, it was inside the loop) - Return error if user doesn't own the collection Ref T609
Thanks for getting those things! After testing, I made a few changes.
I tweaked the design and copy on the Import page to be consistent with the rest of the site.
I also ran into problems when importing Draft posts -- whether from bad local data or something else, the
I also reduced the number of database calls (previously, this was repeatedly making the same
Next I'll probably tweak the stuff around temporary files a bit.