Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Generate a GUID when creating a new draft or generating the rss file #198
I wonder if we could generate a GUID(Globally Unique Identifier) when we creating a new draft, or at least attach such information via the rss generator.
Without the GUID info, it will be difficult for some application e.g. RSS readers to determine whether an article is a new post or just an update.
And it will be tedious when we try to migrate the articles from one site to another(For instance, we may need to do a lot of works to redirect the comments from the old site).
Would you propose to just do a
hmm... according to the related reading they actually mean permalink, not guid or uuid. It's poor nomenclature.
In RSS feeds each
The purpose is so that if the name of the article were to change, the aggregator would count it as the same article, not a new one.
Judging by the vagueness of the specification and the example given as a URL, I'd say it's a safer bet to use the permalink than a true uuid.
Hi @coolaj86 ,
Yes! GUID can be a permalink! Here is a more clear specification on GUID: http://www.ietf.org/rfc/rfc4151.txt
When generating the rss.xml, also add the guid tag can be useful.
Yes. Maybe ruhoh need to know whether a post is an new one or just an update. Otherwise, if we modify the title, even thought it is just an update, RSS reader will regard it as a new post because the guid has changed(to the new permalink).
As I know(not 100% sure), WordPress firstly generates a
When generating rss, also generate a guid from postid. I think a better guid should be
The more I thought about it, the more I feel the importance of
I don't quite in favor of the way ruhoh sorts my posts - they are not sorted alphabetically nor exactly by time. For example, take a look at these two posts from my homepage.
What's worse, all the articles from my wiki are sorted even more "randomly", because I didn't add the "date" metadata so ruhoh seems to sort them in a strange way.
Therefore, I think a better choice to sort the posts is by
Probably with a step works better. For example, when I create draft A, ruhoh will distribute a post id
A log is needed to keep tracking the post id counter - each time ruhoh try to create a draft, it get the last post id by reading the log file, and calculate the new post id(=id_old + step) and then write it into the draft. After that, write the new post id back into the log file.
Also make it optional. Without the postid, ruhoh sort the articles by time, and attach the permalink as the guid tag to the rss.xml. For that will guarantee the downward compatibility.
I hope you carefully consider my advice. It is the key to save my wiki! ;-)
I think that extending the DATE to include the TIME would be a better approach than a number that increments by 5.
Time is much more granular.
Although I wouldn't want it to necessarily display the second of the time I created the post, It should be there for history's sake.
I'd prefer the date be
Time is more complex and longer than a post id, so it will brings more storage and transfering cost.
In fact I seldom use
Compare to time, postid should be more transparent and controllable. The step can be changed too, I suggest to make it a variable value at
The process id in Linux is incremental with a step, too.
I like both ideas, but I don't think they should get mixed up:
But why should this affect the ordering of the articles?
This should be pretty easy to understand for everybody.
just my 2c
Hi @karfau ,
Thanks for your comment.
OK, I will try to (informally) explain more on why I dislike using time for sorting.
In most situation, like blogging, yes - sorting by time is enough.
However, if I decide to write a book via ruhoh(why not?
Now how to fix it? Well, you may think that by modifying the created time of the second or the third post can change the order. But isn't it dirty?
Now the problem get even more troublesome: I've finished all the chapters. "That's so nice. I'm really great!", suddenly I come up with an idea: "Oh shit! I forgot to insert an exercise chapter after each chapter!!!" Now I need to do so many evil modifying on created time. Finally I got mad and suicided.
If the posts are sorted by post id however, I can easily modify the post id of each post to put it ahead. It saved my life.
But *nix file system are NOT able to record the file created time!
Ok, i totally get your point about the ordering.
In my view then there is another issue mixed in here: which is the one about ordering (which should be discussed in another ticket maybe?):
I had this problem multiple times, specially for sites, which I needed a(t least one) custom, changable order for.
Custom sort order is supported in v2+ via the base model_view
You can specify the attribute and sort direction on a per collection basis by updating config.yml:
#config.yml essays : sort : ['guid', 'asc'] # Array is required
This will sort
Sorry this is not documented =/.