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

Add a :post/sites attribute to the :post schema #39

Closed
jacobobryant opened this issue Jul 11, 2022 · 0 comments · Fixed by #46
Closed

Add a :post/sites attribute to the :post schema #39

jacobobryant opened this issue Jul 11, 2022 · 0 comments · Fixed by #46

Comments

@jacobobryant
Copy link
Owner

The type should be [:vector :site/id]. Add it as an optional key in the :post schema for backwards compatibility.

Then we need to update the UI. Posts should have an additional field somewhere on the sidebar in the edit post page. There are at least three ways we could do it:

  • use a native html single-select element. (
    (defn select
    ). Even though the schema allows posts to have multiple sites, for now we have the UI support only one site per post. Then we wait to see if anyone actually does ever want a single post to be under multiple sites.
  • Use checkboxes (I don't like the native multiple select element, at least not on desktop)
  • Use a JS multiselect component, like https://sa-si-dev.github.io/virtual-select/

I'm ok with any of those options--I probably lean towards using a single-select element for now.

Also we should update the Posts page to show the sites that posts belong to, similar to how currently tags are listed.

Then we need to update the theme code to use the new attribute. See this line:

((:post/tags post) (:site/tag site)))))
. For backwards compatibility we can continue checking for a match against the :site/tag attribute. We just wrap it in an or and have the other condition be "does the :post/sites attribute match the site's :xt/id".

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

Successfully merging a pull request may close this issue.

1 participant