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

Separate storage of mentions from the actual posts #13

Closed
aaronpk opened this issue Dec 9, 2013 · 7 comments
Closed

Separate storage of mentions from the actual posts #13

aaronpk opened this issue Dec 9, 2013 · 7 comments

Comments

@aaronpk
Copy link
Owner

aaronpk commented Dec 9, 2013

Currently mentions of my posts are stored within the post file itself. (Only the URL and date are stored there, the actual mention content is stored using IndieArchive).

However this is causing some problems, mainly conflicts when updating post content since someone mentioning a post will cause the file to be updated too.

Instead, I want to store mentions of the URLs somewhere else, such as in a mirror file for each post. For example, if my post has a filename of content/notes/2013/11/01-1.md, then all mentions could be stored in a file mentions/notes/2013/11/01-1.yml.

@sandeepshetty
Copy link

You would still have to deal with concurrency issues on the mentions file. Why not deal with concurrency and leave them together?

@aaronpk
Copy link
Owner Author

aaronpk commented Dec 11, 2013

Actually it wasn't the concurrency I was worried about, but yes you're right that I'll still have to deal with that.

The main problem I've been running into is when a new webmention is added on the server, and then I update the post content on my laptop. I have to merge the changes manually.

@sandeepshetty
Copy link

Ah, this is why I didn't go the static site generator route, especially cause I knew content would be added dynamically on the site and because it doesn't work too well on mobile phones.

@aaronpk
Copy link
Owner Author

aaronpk commented Dec 21, 2013

This is now complete! All existing mentions have been migrated, and new mentions are being stored separately.

@aaronpk aaronpk closed this as completed Dec 21, 2013
@bcomnes
Copy link

bcomnes commented Jan 22, 2014

Separately, as in, indiearchive?

@aaronpk
Copy link
Owner Author

aaronpk commented Jan 22, 2014

For a post with a filename on disk of ./content/notes/2014/01/19-1.md there is a corresponding file that contains references to the URLs that have mentioned that note, at ./mentions/notes/2014/01/19/1/indieweb-micropub.yml. The mention file looks like this:

mentions:
- source: http://waterpigs.co.uk/notes/4UAVp/
  target: http://aaronparecki.com/notes/2014/01/19/1/indieweb-micropub
  date_received: "2014-01-20 00:29:56"
  type: reply

Then when I need to go actually render a comment, I get the post data from my IndieArchive data store from a file named: ./external/waterpigs.co.uk/notes/4UAVp which is the raw HTML. The microformats parser parses the page and stores the parsed JSON at ./external/waterpigs.co.uk/notes/4UAVp.json

@bcomnes
Copy link

bcomnes commented Jan 26, 2014

Thanks @aaronpk for that insight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants