-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
API for Dashboard #329
API for Dashboard #329
Conversation
1859e6f
to
a04644e
Compare
@ashmaroli can you explain a bit more about what's going on here? It looks like you're aggregating many existing endpoints into a single call? |
With this call, the current site's entire payload gets streamed in to the API after being stripped off any content data. Except for appearing to be similar to existing endpoints, this cumulative call is a different object. We can either use this goldmine of data or further strip to make things leaner. |
Why do we need a different object here? Is there data in this endpoint not exposed in those other endpoints? Can we expose that data via the existing endpoints? Can we accomplish the same user experience with multiple calls? My concern here is that we're creating a purpose-build endpoint for a single view when the data is already exposed in subject-specific (and generalized endpoints). |
relevant data (IMO) not exposed via existing endpoints: {
"content": null,
+ "jekyll": {
+ "version": "3.4.2",
+ "environment": "development"
+ },
"highlighter_prefix": null,
"highlighter_suffix": null,
"site": {
"time": "2017-03-19 14:18:53 -0400",
"tags": {},
"pages": [
"page.md",
"page-dir/test/page2.md",
"page-dir/page1.md",
"assets/style.scss",
"assets/app.coffee"
],
"posts": [
"2016-01-01-test-post.md",
"test/2016-01-02-test2.md",
"2016-02-01-test-post-2.md",
"2016-03-01-test-post-3.md",
"more posts/2016-04-01-post-within-subdirectory.md",
"more posts/some more posts/2016-05-01-a-test-post-within-subdirectory.md",
"more posts/some more posts/2016-05-02-another-test-post-within-subdirectory.md"
],
"static_files": [
"#<Jekyll::StaticFile:0x3cf4860>",
"#<Jekyll::StaticFile:0x3cf47d0>",
"#<Jekyll::StaticFile:0x3cf46e0>",
"#<Jekyll::StaticFile:0x3cf4638>"
],
"categories": {},
"collections": [
"posts",
"puppies"
],
"html_pages": [
"page.md",
"page1.md",
"page2.md"
],
"source": "[--redacted--]/spec/fixtures/site",
"destination": "[--redacted--]/spec/fixtures/site/_site",
"plugins_dir": "_plugins",
"layouts_dir": "_layouts",
"data_dir": "_data",
"includes_dir": "_includes",
"safe": false,
"include": [
".htaccess"
],
"exclude": [
"Gemfile",
"Gemfile.lock",
"README.md"
],
"keep_files": [
".git",
".svn"
],
"encoding": "utf-8",
"markdown_ext": "markdown,mkdown,mkdn,mkd,md",
"show_drafts": null,
"limit_posts": 0,
"future": false,
"unpublished": false,
"whitelist": [],
"gems": [
"jekyll-admin"
],
"markdown": "kramdown",
"highlighter": "rouge",
"lsi": false,
"excerpt_separator": "\n\n",
"incremental": false,
"detach": false,
"port": "4000",
"host": "127.0.0.1",
"baseurl": "",
"show_dir_listing": false,
"permalink": "date",
"paginate_path": "/page:num",
"timezone": null,
"quiet": false,
"verbose": true,
"defaults": [
{
"scope": {
"path": ""
},
"values": {
"some_front_matter": "default"
}
}
],
"liquid": {
"error_mode": "warn"
},
"rdiscount": {
"extensions": []
},
"redcarpet": {
"extensions": []
},
"kramdown": {
"auto_ids": true,
"toc_levels": "1..6",
"entity_output": "as_char",
"smart_quotes": "lsquo,rsquo,ldquo,rdquo",
"input": "GFM",
"hard_wrap": false,
"footnote_nr": 1,
"syntax_highlighter": "rouge",
"syntax_highlighter_opts": {},
"coderay": {}
},
"title": "Your awesome title",
"foo": "bar",
+ "watch": true,
"serving": true,
"url": "http://localhost:4000",
"related_posts": null,
"data_files": [
"data_file.yml",
"template-config.yml"
]
},
"layout": null,
"page": null,
"paginator": null
} the above data also exposes the entire
I'm sorry, I don't have the stats to comment on this. The |
Nice. Thanks @ashmaroli. Since #320 |
yes, |
a point in favor of outputting
|
|
Any feedback here @mertkahyaoglu ? |
If @benbalter also approves, we can merge this. |
@ashmaroli see my questions above
In my mind, the API should be modeled after the data, not the presentation. If there's data in this endpoint not exposed elsewhere, let's expose it where it makes sense, but I'm less inclined to add (and support) and new endpoint to support a specific view, especially when making additional local network calls are so cheap. |
@benbalter Thank you for the feedback.
Excellent diagnosis. You caught me! 😃
sounds reasonable 👍 |
Proposing an API for the dashboard.
The API outputs a modified version the current site's site-wide payload: