scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 91 forks source link

Should 'info' be a property of a wiki page model? #148

Open gazpachoking opened 8 years ago

gazpachoking commented 8 years ago

While working on #147, I started wondering why the 'info' information was even attached to the get_page method return of wiki model. It seems to me that information about the last edit to the page is no more inherent to the page than any other commit in the page's history.

I propose it be removed altogether, if any place is really needing info about the last commit, it can access that info via the page history.

It looks like about the only place that is using it is to be indexed for searches, which also doesn't make sense to me. Say I make an edit to a page, with a message like "remove references to the foobar model", now that commit message gets indexed and comes up on a search for "foobar" (even though the page now doesn't even contain that word)? Also, if it's going to index the commit messages, why would only the latest one be relevant? I propose that message, email, and username just be removed from the search index. Even if they are deemed important for searching, it doesn't make sense that only the latest one is indexed.

Totally willing to make a PR with these changes, just wanted to get some feedback first, and see if there was anything I'm missing.