Comments (3)
Based on our in-person conversation with @mburridge here are some more details about Frontity Options and their use case. I think that it can be useful to think about the Frontity Options as this:
Dynamic configuration that can be specified via query string but which does not form part of the canonical link
The important part here being the does not form part of the canonical link. That means that whatever is passed in the frontity_***
query is not going to be used to be matched by handlers or used to fetch data from WordPress. Its purpose is to allow dynamic configuration of Frontity like the configuration that Luis has specified above:
Some of these "Frontity Query Options" will be used by the core, like for example:
- frontity_name -> state.frontity.options.name: The name of the site you want to load.
- frontity_public_path -> state.frontity.options.publicPath: The public path that you want to use (not ready yet, but it will exist).
But packages can also make use of them, like for example:
- frontity_source_auth -> state.frontity.options.sourceAuth: A authentication token for the source package.
- frontity_comments_skip -> state.frontity.options.commentsSkip: A boolean to skip rendering the comments (it's not real, I've just made it up).
from api-reference.
Great summary Michal 🙂
I'd like to add that we are looking for a name for the query parameters that start with frontity_
. It's a new concept in Frontity, so I think it deserves its own name. We've used Frontity Query Options and I think it is good so we can stick to that.
The "Frontity Query Options" could have their own section in the docs. They work as described by Michal:
- Any query param in the URL that starts with
frontity_
is a "Frontity Query Option". - Those queries are reserved to "send special information to Frontity", not related to the URL that needs to be rendered (a post, a page, or whatever), but to the Frontity configuration.
- Those parameters are removed from the
state.frontity.initialLink
andstate.router.link
because they should not affect the content of what needs to be rendered (a post, a page, or whatever). - Those parameters are added to
state.frontity.options
. Packages that use them will look for them there. - The name of those parameters is converted to camelcase. The value is not transformed.
- Some of these "Frontity Query Options" will be used by the core, like for example:
frontity_name
->state.frontity.options.name
: The name of the site you want to load.frontity_public_path
->state.frontity.options.publicPath
: The public path that you want to use (not ready yet, but it will exist).
- But packages can also make use of them, like for example:
frontity_source_auth
->state.frontity.options.sourceAuth
: A authentication token for the source package.frontity_comments_skip
->state.frontity.options.commentsSkip
: A boolean to skip rendering the comments (it's not real, I've just made it up).
from api-reference.
Closed by #24 and frontity/docs#281
from api-reference.
Related Issues (20)
- [Packages] Add docs for the state populated by the Frontity core package HOT 1
- "Embedded Mode" documentation as WordPress plugin HOT 5
- Document the Infinite Scroll hooks HOT 1
- Client-side navigation for links found in the content HOT 3
- Document type guards for Data objects and Entities
- Document the @frontity/[email protected] HOT 3
- Explain how pageviews work with the `@frontity/google-tag-manager-analytics` package HOT 6
- Smart Ads package HOT 1
- WordPress Post Preview HOT 5
- Add image and link processors
- Document the new "Frontity Slot Block" plugin and "slot-block" processor HOT 1
- Broken links HOT 1
- Add documentation for `state.source.url` HOT 4
- Document the new typed version of Mars Theme HOT 5
- Add installation section for themes
- Add documentation for the Google Ad Manager package HOT 2
- wp-source with graphql
- Typo in libraries.source.parse() > return value section
- Write docs for the @frontity/yoast package HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-reference.