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

Search by JSON file #7

Open
agusmakmun opened this issue Jun 15, 2016 · 2 comments
Open

Search by JSON file #7

agusmakmun opened this issue Jun 15, 2016 · 2 comments

Comments

@agusmakmun
Copy link

Hello, how about JSON file? I think it would be simple than .xml file. but, in this problem, only available for title. Can you create it please?

---
layout: null

---
[{% for post in site.posts %}
  {
    "title": "{{ post.title }}",
    "date" : "{{ post.date | date_to_string }}",
    "link" : "{{ post.url | prepend: site.baseurl | prepend: site.url }}"
  }{% if forloop.last == false %},{% endif %}
{% endfor %}]

Example Result JSON file:

[
  {
    "title": "get Month Name [CF]",
    "date" : "11 Jun 2016",
    "link" : "https://agusmakmun.github.io/python/codefights/2016/06/11/get-month-name-cf.html"
  },

  {
    "title": "Find the number of even digits in the given integer [CF]",
    "date" : "11 Jun 2016",
    "link" : "https://agusmakmun.github.io/python/codefights/2016/06/11/find-the-number-of-even-digits-in-the-given-integer-cf.html"
  },

  {
    "title": "Find Substrings for line Encoding [CF]",
    "date" : "11 Jun 2016",
    "link" : "https://agusmakmun.github.io/python/codefights/2016/06/11/find-substrings-for-line-encoding-cf.html"
  }
]
@chinchang
Copy link
Owner

But XML was chosen because blogs generally already have an XML file for its RSS/Atom feeds. Thus this library simply uses whats already available. Why would one create a JSON file as you mentioned?

@agusmakmun
Copy link
Author

I minded when it has a post over hundreds, whether this super-search is still able to work well?

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