Code Monkey home page Code Monkey logo

tina.io's Introduction

Tina.io website

Source code for the tina.io website.

Development

cp .env.example .env
yarn install
yarn dev

Testing Local TinaCMS Changes

If you have the tinacms repository cloned locally you can use it when running tina.io:

TINA=../path/to/tinacms yarn dev

You can also specify which packages you want to watch:

TINA=../path/to/tinacms TINA_WATCH=@tinacms/forms,react-tinacms-inline

Warning

This will only work for packages loaded by webpack. That means that environments which don't use webpack (i.e. SSR builds) will not use this alias.

tina.io's People

Contributors

ashleyjanedoiron avatar austincondiff avatar danitulp avatar dependabot[bot] avatar dirtyf avatar dwalkr avatar enigmatical avatar jamespohalloran avatar jbevis avatar jeffsee55 avatar jhuggett avatar jpatters avatar kendallstrautman avatar kldavis4 avatar laurenclark avatar logan-anderson avatar lukedigby avatar mitchmac avatar mittonface avatar ncphillips avatar omarcostahamido avatar perkinsjr avatar phoenix-alpha avatar pixelmord avatar ruudwelten avatar scottgallant avatar sh-cho avatar spbyrne avatar tina-cloud-app[bot] avatar tinymachine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tina.io's Issues

Misalignment in the Docs Footer

Screen Shot 2020-02-13 at 8 20 10 AM

Seems like if the title doesn't occupy two lines, it sits at the bottom of the footer and is out of sync with the chevron.

Document screen plugins

At a bare minimum provide the interface and some basic context of what this is. Could be a blog post later on creating our own.

Document Form Actions

We don't really mention passing Actions to the form. Let's describe this as a concept and add some examples of actions. I've added an example for the delete action.

Update Docs for tinacms#607

A pull request in tinacms may require documentation updates.

The following files may need to be updated:

File Reason
three-ways-to-edit-md.md Shows how to use remarkForm HOC
inline-editing.md Depends on remarkForm & liveRemarkForm hoc in example

!Breaking!

The referenced PR requires a change to docs describe how to get started with TinaCMS.

yarn add gatsby-plugin-tinacms styled-components

will now need to be

yarn add tinacms gatsby-plugin-tinacms styled-components

We should make sure to update any effected blog posts and notify anyone else who wrote a blog post.

chore: Fix all warnings in the site

For example:

  • Warning: Each child in a list should have a unique "key" prop.
  • Warning: Invalid DOM property fill-rule. Did you mean fillRule?

Let's cleanup up all these little issues.

Newsletter signup: if duplicate, get ugly alert

Right now if you attempt to signup for the newsletter and you've already signed-up, the alert looks like this. Let's make a custom modal -- In general we should make that alert for newsletter signup more custom and better looking.

Screen Shot 2019-10-08 at 8 19 22 AM

Open Authoring - what should the behaviour be after a PR has been merged

After a PR has been merged, I will be looking at a stale copy of the site. What should happen to the branch? What should happen to the fork?

Some thoughts:
On the next visit, we could alert the user and say that their pr has been merged and ask them if they would like to create a new fork. We could then delete their existing fork and create a new one for them. We could also look into rebasing it.

For now, we could just show an alert and tell them that their changes have been merged and that their fork is out of date.

Using Group Fields to organize flat front matter

I setup Tina on my blog and made this form:

const BlogPostForm = {
  label: "Post",
  fields: [
    {
      name: "rawFrontmatter.title",
      component: "text",
      label: "Title",
      required: true,
    },
    {
      name: "description",
      component: "textarea",
      label: "Description",
    },
    {
      name: "date",
      component: "date",
      label: "Last Updated",
    },
    {
      name: "publishDate",
      component: "date",
      label: "Published",
    },

    { name: "rawMarkdownBody", component: "markdown", label: "Body" },
  ],
}

export default remarkForm(BlogPostTemplate, BlogPostForm)

I didn't love the organization in the sidebar though. I rarely care about the descriptions or dates when editing my content. It really lengthens out the form:

image

I used the group field shove those hide those extra fields. Now the form template looks like this:

const BlogPostForm = {
  label: "Post",
  fields: [
    {
      name: "rawFrontmatter",
      label: "Metadata",
      component: "group",
      fields: [
        {
          name: "date",
          component: "date",
          label: "Last Updated",
        },
        {
          name: "publishDate",
          component: "date",
          label: "Published",
        },
        {
          name: "description",
          component: "textarea",
          label: "Description",
        },
      ]
    },
    {
      name: "rawFrontmatter.title",
      component: "text",
      label: "Title",
      required: true,
    },

    { name: "rawMarkdownBody", component: "markdown", label: "Body" },
  ],
}

And my sidebar looks like this:

image

image

How to contextually create sub-pages

Thanks to the ability to dynamically create, add, and remove plugins from Tina, it's incredibly easy to add a button for contextually creating sub-pages!

import { liveRemarkForm, createRemarkButton } from "gatsby-tinacms-remark"
import slugify from "slugify"
import { usePlugin } from "react-tinacms"

function BlogPostTemplate(props) {
  const post = props.data.markdownRemark
  const siteTitle = props.data.site.siteMetadata.title
  const { previous, next } = props.pageContext
  const { setIsEditing, isEditing } = props

  const CreateChildPost = React.useMemo(() => {
    return createRemarkButton({
      label: "Child Post",
      fields: [{ name: "title", label: "Title", component: "text" }],
      filename(form) {
        let currentDir = post.fileRelativePath.replace("index.md", "")
        let sluggifiedTitle = slugify(form.title)

        return `${currentDir}${sluggifiedTitle}/index.md`
      },
      frontmatter(form) {
        return {
          title: form.title,
          date: new Date(),
        }
      },
    })
  }, [post.fileRelativePath])

  usePlugin(CreateChildPost)

  return (
    <Layout location={props.location} title={siteTitle}>
      <SEO
        title={post.frontmatter.title}

Checkout a video in the community slack:

https://tinacms.slack.com/archives/CNMPL8LDT/p1571330174005400?thread_ts=1571329743.004900&cid=CNMPL8LDT

Warn people about global styles with `styled-components`

The component created by createGlobalStyles function in styled-components is extremely inefficient. This will cause sites being edited with TinaCMS to eventually start to crawl.

Any global styles should be memoized:

const GlobalStyle = createGlobalStyle`
  html {
    min-height: 100%;
  }
`
export default React.memo(() => <GlobalStyles />);

We should have a guide/blog post about this.

Website shows Privacy Error

Website shows Privacy Error

Your connection is not private
Attackers might be trying to steal your information from tinacms.org (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_AUTHORITY_INVALID

Help improve Chrome security by sending URLs of some pages you visit, limited system information, and some page content to Google. Privacy policy

Update Docs for tinacms#760

A pull request in tinacms may require documentation updates.

The following files may need to be updated:

File Reason
using-tinacms-with-nextjs.md Demonstrates using useLocalForm on a Next.js site
creating-forms.md Demonstrates using useLocalForm on a Next.js site
inline-editing.md HOC examples depends on useLocalRemarkForm hook
json.md Demonstrates use of useLocalJsonForm and JsonForm
markdown.md Demonstrates useRemarkForm usage
forms.md Creates custom form with useForm & useLocalForm

We need to document the new loadInitialValues promise and update the Form interface or any examples of initialValues manually getting set.

Open Authoring - POC: Allow editing before authorizing with Github

A few technical/UX challenges to overcome:

  • The following actions will be difficult without being about to make commits within git:
    Add/remove image
    Add/remove page

  • We will not have the user's auth token, and perform Github requests from the server, so we may run into issues with Github rate limiting
    - We can just read from the filesystem if unauthenticated.

Questions:

  • Will we still switch to Edit mode to use Tina?
  • What happens if I make changes before logging in (which are saved to local-storage) -> log-in (to an account with an existing fork). Do I see my localstorage changes from base? or my forked changes?

Open Authoring - Dynamic Save button text

The save button in the toolbar should say:
"Save Draft" before a PR is created
"Update Draft" after PR has been created

@ncphillips mentioned having cms.sidebar.buttons.save take in a component which would allow this to be possible

Update Docs for tinacms#520

A pull request in tinacms may require documentation updates.

The following files may need to be updated:

File Reason
creating-forms.md Demonstrates using useLocalForm on a Next.js site

Probable Change

We may want to add a Tip on how to prevent forms from being registered in production

Open Authoring - Ability to add new docs pages

It would be nice to be able to create/edit new docs pages with Tina open-authoring.
There's currently no create button in the Docs pages.
I manually created the page in my fork, but the new page 404'ed (I assume because fallback: false on the docs layouts)

Newsletter signup: Error with tracker-blocking browsers

Depending on the settings of Firefox or Brave, i.e. how intense the ad-blocking etc. is, the newsletter signup will throw an error and not allow someone to signup. Right now it will at least communicate this to them with an alert.

See benjaminhoffman/gatsby-plugin-mailchimp#45 & benjaminhoffman/gatsby-plugin-mailchimp#34

I reset my firefox browser to factory settings and was able to sign up okay since all my blocker settings were chilled out but this is definitely unfortunate / something we'll want to address.

One thing I didn't try was embedding the entire mailchimp form in like was mentioned in one of the issues...I wasn't sure how that would play with Gatsby. Would be my first step to looking into this.

RFC: separate docs into "docs" and "guides"

Our documentation needs to serve a spectrum of users, ranging from those looking for a quick + easy way to get started with Tina, to those interested in wielding parts of the API on their own for highly custom use cases, or building integrations. For simplicity I'll refer to these as lower-investment and higher-investment groups, referring to how much time/energy they want to invest in understanding/implementing Tina.

Trying to serve this entire spectrum from the documentation is challenging and can lead to the docs being confusing/unhelpful.

Proposal

  1. Add a new top-level nav item to tinacms.org, titled "Guides"
  2. Remove the Tina+Gatsby and Tina+NextJS sections from /docs and repurpose them into Guides as appropriate

Docs

Docs should focus on the APIs and components of Tina, and cater primarily to developers in the medium- and higher-investment part of the spectrum. Naive examples to demonstrate functionality (like what's in the Plugin docs) would be preferred over examples that assume a specific setup.

We should consider a linear path through the documentation. Docs should attempt to present the most common/ubiquitous APIs and components first, leaving more esoteric or uncommonly-needed features for later. This organization should not come at the expense of cohesiveness, however.

Guides

Guides aim to serve the lower- to medium-investment developers, but will likely be useful to everyone.

The attitude of a Guide will be somewhere between documentation and a blog post. Guides should start with an overview of what will be achieved, and may be broken up into multiple logical steps, each in its own markdown file.

| guides
\
  |--nextjs-github-public-repo
  \
    |--overview.md
    |--1-add-github-api.md
    |--2-bootstrap-api-routes.md

We should encourage guides to be as small in scope as seems appropriate, and have guides reference each other. For example, a guide on using the GitHub packages with NextJS should assume you have already bootstrapped Tina into your NextJS site (adding TinaProvider to _app.js,) and should link to a guide on how to do that rather than explaining it all over again.

Discoverability

Guides should be:

  1. searchable via algolia
  2. discoverable via tags

Guide Layout

something like this

image

Docs(Github): Need milestones in onboarding to verify successful steps

When going through the Next Tinacms Github setup process, it takes a while to verify that you're on the right track. We should document sanity checks that prove that your prior steps have been successful.

E.g, After you add the TinacmsGithubProvider, you should see an authentication modal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.