How to reverse the chronological order of pages? - jekyll

I use page.previous and page.next to create links to neighbor pages.
The problem is that the "next" page is the one which is chronologically earlier. In other words, my latest page has one link, page.next (linking to an older page)
Is it possible to reverse the order?

The solution is actually obvious: just use the names the other way round:
page.previous points to the next item, chronologically speaking
page.next points to the previous item, chronologically speaking
I wonder why the names were set up like this (counter-intuitively, since all the posts must be time-stamped).

Related

Do I need a database to handle my website content?

So I'm building a website that contains information about a bunch of different animal species. I will have a list of 500 items, that should be able to be filtered and sorted by different criteria. For example, I will have a 'country selection' option. If Brazil is selected, the Capuchin monkey among other animals (living in Brazil) should be added to the list.
I could see myself making a list with 50 species with no problem, as the HTML would be manageable. But would having 500 items in a list with filterabilty even be possible without using some sort of database?
I was thinking of just pairing animal items from the list with certain filter criteria. For example, Capuchin monkey with "Brazil", "Mammal", "Omnivore", etc.
And when e.g. "Mammal" is selected in the filter, all animals paired with that property (all mammals of the list) is added to the list, or if not paired with the property, then removed from the list.
As you probably can tell, I'm really uneducated on how to go about creating this filterable list. Down the road I might even look into adding a search function.
After pluggin in all content, I would never need to change anything. I've read that databases should only be used if you have dynamic content.
I wouldn't list all 500 items on the same page, as that would make it very slow. I would have 10 items per page.
I don't need a solution per se. I just wish to be pushed in the right direction.
Should I look into MySQL? Can a filterable list of 500 items be possible with just HTML/CSS/Javascript? I am somewhat familiar with javascript, and have read that JSON might be able to provide the things I need.
Sorry if my question is vague or if I'm in the wrong anywhere (this is my first post). Please ask for any clarification and any advice or suggestion is greatly appreciated.
Thanks,
Manne
No you don't need a database. Have a look at this very robust jQuery plugin that will easily allow you to sort/filter/search 500 items in JavaScript alone:
https://datatables.net/
There are examples that are powered from JSON alone so I would suggest you simply store your data in a JSON file until you grow large enough that you need to change that (if you ever do).
Here is an example where the data is pulled from a .txt file:
https://datatables.net/examples/data_sources/ajax.html

Algorithm for suggesting new content

I have a list of articles that have increasing ids associated with them. Some ids are missing because the articles were deleted so the order is going up, but not always incremented by 1.
I am trying to dynamically recommend content like related articles but don't always want to recommend the same articles, but want to make sure that
1) Every article is recommended in another article
2) A page always recommends the same article - so randomness algorithms do not help.
Is there a good way to do this?
Thanks!!
In your sql think like this.
-Select List of catagorically alike stories that match some key
-grab a random 1
However the only way to ENSURE every article is attached to another is to set up a key list. Make the key list hold every article on the left, and random input for other articles on the right categorically again of course. Make this a temp table so when you add articles the left side increments, and the right side re-randoms the related articles, while using everyone in the list.

Is it good to generate dynamic keywords every time when page loaded?(SEO)

For an example generate 10 random keywords from web content.
Thanks..
UPDATED.
For SEO.
I'm assuming you mean for display ...
The only advantage I can think of is that search engines might possibly go "This page is updated frequently, we should check it more often", maybe. I'm not up enough on the latest search engine workings to say if this would actually work or not. I wouldn't trust it to.
Disadvantages depend on usage, but I can't picture any scenario where it's immensely helpful to be "random". If you better describe the reasoning that led you to this conclusion, we can tell you whether it's right or not. My gut feeling however is ... no. If you want to display summary data, then "random" shouldn't fit into the equation, or at least, not at the top level. You should first filter the content based on some useful criteria, then apply random at the last step if necessary.
Example Process:
Filter out words on the stop list (if, is, you, etc).
Count occurences of words, prefer words with high occurence counts.
Prefer words which aren't featured prominently in other content items.
If there are more than 10 words remaining, randomly select 10 from the better scorers.
Keywords for this post: I, of, is, it, to, but, you, on, we, if.

User interface for addition/deletion of items to a list?

I have a ban list that I'm building as part of an application that displays articles. This ban list will contain keywords, which if found in an article, would lead to the article being disabled(the article will not be displayed on the front-end)
I'm having a tough time visualizing the UI. I could always display a textarea and ask the user to enter keywords comma separated and when they want to delete again the textarea will be presented and they can edit the entered keywords. But I find my idea very unfriendly to the user.
My question is how do I program the UI so that its easy to add new keywords. I also would like to be adviced on a nifty way showing the existing keywords and also deleting them.
This ban list will be part of the admin panel/backend and will be accessible only to the site administrator.
How many banned words will there be? If a handfull then your suggestion of a comma separated list makes sense - perhaps sorted alphabetically when re-presented for editing.
I speculate that the list could become quite extensive, and hence perhaps you would need to present several pages of excluded words. In which case, some form of paginated, alphabetic display, with a little (x) beside each entry to permit deletion.
And a separate entry field which would accept single words and add them into the list, displaying the relevent page might work.
One other thought: will your list contain profane or otherwise potentially offensive words? if is possible that representing the list could itself be offensive in some way? You may need to find a way to O??????e the O??????e. Which might present a few challenges.
I would display them as a list, with a textfield at the top or bottom to add new ones.
Add an icon to each to let the user delete it, and implement both adding and deletion by Ajax: then you can sort the list before redisplaying it.
(Actually, you could do that all in the browser with Javascript and not use Ajax: in that case you'll have to pass the whole list to the server when it's needed).

best way to present huge html forms

My application has a requirement such that I have to display a huge number of HTML input textfields (maybe 2,000 text fields). The fields can be logically grouped into sections and the sections are repetitive. What is the best way to display it to the user so that they can enter data with minimum clicks?
I'm not sure what kind of users you have that would willingly sit through 2,000 text fields, but if it's a requirement, then you do what you have to. :)
You say it can be grouped into sections and the sections are repetitive. I'm not sure what parts are repetitive, but managing the sections carefully seems of utmost importance. Some sort of Javascript hiding/showing seems likely to be a big help... I think I would choose JQuery's Accordion effect or something similar.
You could add Tab key events to each section in order to assist with navigation and open a new section once an old one was complete. Adding change events to the fields might assist with that as well.
If you need to break the form up across multiple pages, then you'll probably want to utilize AJAX to load new sections/pages and store the submitted data into a session until the user is done.
Depending on the format of the required answer, there are two ways:
If the answer is of a known length or the answer is one of a few choices, you may auto-advance the cursor w/some javascript/jquery. For instance, if you're expecting phone numbers, when the person enters the 10th digit in the box, move the cursor to the next box.
If you don't know and you can't apply (1), the quickest way is to encourage users to tab their way through the boxes.
Speaking of tabs, if the boxes can be logically grouped, you could create tabs and have the users page their way through the questions. This will create more clicks, but will improve user experience.
But holy crap, 2k text boxes on one page is crazy!
I work on a similar product, and perhaps the number one thing would be to make sure that tabbing between fields works logically and quickly. The people who do data entry on this type of thing are lightning fast and fairly mindless (I don't mean that in a pejorative sense), typing in numbers from a log or printout without looking at a screen.
Apart from that, we implement tabs (like tabbed browsing) on the page, group boxes, and other things like "dynamic lists" which is like a data grid of text boxes that the user can add and delete rows from client-side.
Paged format, like a survey? You could then use SESSION to store the input for each page and retrieve the prior answers when the user switch between them. Another method is to use ajax to navigate between different . I think the issue is not the number of clips, but 2000 textfields is going to look scary on just one single page.