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

bashblog shouldn't rely on file date for post ordering #96

Closed
cig0 opened this issue Feb 8, 2016 · 6 comments
Closed

bashblog shouldn't rely on file date for post ordering #96

cig0 opened this issue Feb 8, 2016 · 6 comments
Assignees

Comments

@cig0
Copy link

cig0 commented Feb 8, 2016

May be it would be best to store posts' index + date on a separate index tree.

@cig0
Copy link
Author

cig0 commented Feb 8, 2016

A workaround could be:

  1. Store .md and .html files time stamp
  2. Do the rebuild magic
  3. Touch -d $original_timestamp -m _file_

@cig0 cig0 changed the title $ ./bb.sh rebuild shouldn't update posts' date bashblog shouldn't rely on file date for post ordering Feb 8, 2016
@cig0
Copy link
Author

cig0 commented Feb 8, 2016

Just changed the name of the ticket as this has nothing to be with the 'rebuild' command.

These are however valid scenarios when the time stamps of the posts are updated - thus messing with the blog contents:

  1. When reverting a commit (git revert, git reset, etc.)
  2. When cloning the _user_.github.io repo

@cfenollosa
Copy link
Owner

Ordering files by timestamp is super convenient and fast and I'd like to keep it that was as much as possible. However, I understand that there are some scenarios which change timestamps and thus break ordering.

The post date is already stored inside the <div class="subtitle"> for each file, though it doesn't contain the time by default, just the day, month and year.

A middle ground solution could be to add a post timestamp to each file, inside a comment, and add a new bb.sh regenerate_timestamps to fix these after they have been modified externally.

What do you think of this option? Let's try to find a good solution that can work for the future before starting coding :)

@cfenollosa cfenollosa self-assigned this Feb 8, 2016
@cig0
Copy link
Author

cig0 commented Feb 8, 2016

Hi Carlos,
+1
That would be really useful, I'm very happy with the idea!

@cfenollosa
Copy link
Owner

@cig0
Copy link
Author

cig0 commented May 20, 2016

Grrrreat, now I can clone my blog on the different computers I work daily and blog from them all - thanks!

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

No branches or pull requests

2 participants