chore: remove domain references

This commit is contained in:
Daniel Lautzenheiser
2024-09-09 10:34:35 -04:00
parent fce4c8e2ff
commit 581d7c64a3
13 changed files with 62 additions and 123 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"base_url": "https://staticcms.org/",
"base_url": "https://staticjscms.netlify.app/",
"repo_url": "https://github.com/StaticJsCMS/static-cms",
"site_title": "Static CMS | Open Source Content Management System",
"site_description": "Open source content management for your Git workflow. Use Static CMS with any static site generator for a faster and more flexible web project.",

View File

@ -15,7 +15,7 @@ Alternatively, you can specify a custom config file using a link tag:
If you prefer, you can use a javascript file (`admin/config.js`) instead of a yaml file. Simply import the javascript config and pass it into your `CMS.init({ config })` call.
To see working configuration examples, you can [start from a template](/docs/start-with-a-template) or check out the [CMS demo site](https://demo.staticcms.org/). (No login required: click the login button and Static CMS will open.) You can refer to the demo [configuration code](https://github.com/StaticJsCMS/static-cms/blob/main/core/dev-test/config.yml) to see how each option was configured.
To see working configuration examples, you can [start from a template](/docs/start-with-a-template) or check out the [CMS demo site](https://demo-staticjscms.netlify.app/). (No login required: click the login button and Static CMS will open.) You can refer to the demo [configuration code](https://github.com/StaticJsCMS/static-cms/blob/main/core/dev-test/config.yml) to see how each option was configured.
You can find details about all configuration options below. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
@ -66,13 +66,13 @@ backend: {
Static CMS generates the following commit types:
| Commit type | When is it triggered? | Available template tags |
| ------------- | ---------------------------- | ----------------------------------------------------------- |
| Commit type | When is it triggered? | Available template tags |
| ------------- | ---------------------------- | --------------------------------------------------------------------- |
| `create` | A new entry is created | `slug`, `path`, `collection`, `author-login`, `author-name`, `fields` |
| `update` | An existing entry is changed | `slug`, `path`, `collection`, `author-login`, `author-name`, `fields` |
| `delete` | An existing entry is deleted | `slug`, `path`, `collection`, `author-login`, `author-name` |
| `uploadMedia` | A media file is uploaded | `path`, `author-login`, `author-name` |
| `deleteMedia` | A media file is deleted | `path`, `author-login`, `author-name` |
| `delete` | An existing entry is deleted | `slug`, `path`, `collection`, `author-login`, `author-name` |
| `uploadMedia` | A media file is uploaded | `path`, `author-login`, `author-name` |
| `deleteMedia` | A media file is deleted | `path`, `author-login`, `author-name` |
#### Template Tags

View File

@ -17,7 +17,7 @@ At its core, Static CMS is an open-source React app that acts as a wrapper for t
## Find out more
- Get a feel for the UI in the [demo site](https://demo.staticcms.org/). (No login required. Click the login button to go straight to the Static CMS editor UI.)
- Get a feel for the UI in the [demo site](https://demo-staticjscms.netlify.app/). (No login required. Click the login button to go straight to the Static CMS editor UI.)
- [Start with a template](/docs/start-with-a-template/) to make a Static CMS-enabled site of your own.
- Configure your existing site by following a [tutorial](/docs/add-to-your-site/) or checking [configuration options](/docs/configuration-options).
- Ask questions and share ideas in the Static CMS [community chat](/chat).

View File

@ -6,7 +6,7 @@ weight: 60
- **Name**: `gitlab`
You can use the `test-repo` backend to try out Static CMS without connecting to a Git repo. With this backend, you can write and publish content normally, but any changes will disappear when you reload the page. This backend powers the Static CMS [demo site](https://demo.staticcms.org/).
You can use the `test-repo` backend to try out Static CMS without connecting to a Git repo. With this backend, you can write and publish content normally, but any changes will disappear when you reload the page. This backend powers the Static CMS [demo site](https://demo-staticjscms.netlify.app/).
**Note:** The `test-repo` backend cannot access your local file system, nor does it connect to a Git repo, thus you will not see any existing files while using it.

View File

@ -8,7 +8,7 @@ Widgets define the data type and interface for entry fields. Static CMS comes wi
Widgets are specified as collection fields in the Static CMS `config` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
To see working examples of all of the built-in widgets, try making a 'Kitchen Sink' collection item on the [CMS demo site](https://demo.staticcms.org/). (No login required: click the login button and Static CMS will open.) You can refer to the demo [configuration code](https://github.com/StaticJsCMS/static-cms/blob/main/dev-test/config.yml) to see how each field was configured.
To see working examples of all of the built-in widgets, try making a 'Kitchen Sink' collection item on the [CMS demo site](https://demo-staticjscms.netlify.app/). (No login required: click the login button and Static CMS will open.) You can refer to the demo [configuration code](https://github.com/StaticJsCMS/static-cms/blob/main/dev-test/config.yml) to see how each field was configured.
## Available Widgets
@ -37,16 +37,16 @@ To see working examples of all of the built-in widgets, try making a 'Kitchen Si
The following options are available on all fields:
| Name | Type | Default | Description |
| --------- | -------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| name | string | | The name of the field |
| widget | string | `'string'` | _Optional_. The type of widget to render for the field |
| label | string | `name` | _Optional_. The display name of the field |
| required | boolean | `true` | _Optional_. Specify as `false` to make a field optional |
| hint | string | | _Optional_. Adds helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links. |
| pattern | list of strings | | _Optional_. Adds field validation by specifying a list with a [regex pattern](https://regexr.com/) and an error message; more extensive validation can be achieved with [custom widgets](/docs/custom-widgets/#advanced-field-validation) |
| Name | Type | Default | Description |
| --------- | -------------------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | string | | The name of the field |
| widget | string | `'string'` | _Optional_. The type of widget to render for the field |
| label | string | `name` | _Optional_. The display name of the field |
| required | boolean | `true` | _Optional_. Specify as `false` to make a field optional |
| hint | string | | _Optional_. Adds helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links. |
| pattern | list of strings | | _Optional_. Adds field validation by specifying a list with a [regex pattern](https://regexr.com/) and an error message; more extensive validation can be achieved with [custom widgets](/docs/custom-widgets/#advanced-field-validation) |
| i18n | boolean<br />\| 'translate'<br />\| 'duplicate'<br />\| 'none' | | _Optional_. <ul><li>`translate` - Allows translation of the field</li><li>`duplicate` - Duplicates the value from the default locale</li><li>`true` - Accept parent values as default</li><li>`none` or `false` - Exclude field from translations</li></ul> |
| condition | FilterRule<br />\| List of FilterRules | | _Optional_. See [Field Conditions](#field-conditions) |
| condition | FilterRule<br />\| List of FilterRules | | _Optional_. See [Field Conditions](#field-conditions) |
## Example Widget
@ -280,7 +280,7 @@ collections:
- yes
- no
```
````
```js
collections: [
@ -332,6 +332,6 @@ collections: [
]
}
],
```
````
</CodeTabs>

View File

@ -104,8 +104,8 @@ const StyledDesktopLink = styled(Button)(
`,
) as ExtendButtonBase<ButtonTypeMap<{}, 'a'>>;
const STATIC_CMS_DOMAIN = 'staticcms.org';
const DEFAULT_DEMO_SITE = 'demo.staticcms.org';
const STATIC_CMS_DOMAIN = 'staticjscms.netlify.app';
const DEFAULT_DEMO_SITE = 'demo-staticjscms.netlify.app';
const STATIC_CMS_DOMAIN_REGEX = /staticcms\.org$/g;
function createDemoUrl(subdomain?: string): string {

View File

@ -1,11 +1,8 @@
import Alert from '@mui/material/Alert';
import AlertTitle from '@mui/material/AlertTitle';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { styled } from '@mui/material/styles';
import { format, parseISO } from 'date-fns';
import Link from 'next/link';
import { useMemo } from 'react';
import Container from '../components/layout/Container';
import Page from '../components/layout/Page';
@ -94,33 +91,7 @@ const StyledLink = styled(Link)(
`,
);
function getVersionNumber(version: string): number {
return +version.replace('v', '');
}
function isNextVersion(latestMajorVersionNumber: number, version: string): boolean {
if (getVersionNumber(version) > latestMajorVersionNumber) {
return true;
}
return false;
}
function getMajorVersion(version: string): string {
return version.split('.')[0];
}
const Releases = ({ docsGroups, searchablePages }: DocsMenuProps) => {
const latestMajorVersion = useMemo(
() => getMajorVersion((releaseData.find(r => r.type === 'major') ?? releaseData[0]).version),
[],
);
const latestMajorVersionNumber = useMemo(
() => getVersionNumber(latestMajorVersion),
[latestMajorVersion],
);
return (
<Page url="/releases" docsGroups={docsGroups} searchablePages={searchablePages} fullWidth>
<StyledReleaseContent>
@ -138,29 +109,9 @@ const Releases = ({ docsGroups, searchablePages }: DocsMenuProps) => {
</Typography>
</StyledTitle>
</Container>
<Container>
<Alert severity="warning" sx={{ alignSelf: 'flex-start' }}>
<AlertTitle>
<strong>Note</strong>
</AlertTitle>
<Typography variant="subtitle1" component="div" color="inherit">
<span>
The current docs are for Static CMS v{latestMajorVersionNumber}. For Static CMS v
{latestMajorVersionNumber - 1}, see&nbsp;
</span>
<StyledLink href={`https://v${latestMajorVersionNumber - 1}.staticcms.org`}>
https://v{latestMajorVersionNumber - 1}.staticcms.org
</StyledLink>
.
</Typography>
</Alert>
</Container>
<Container>
<StyledReleaseLinksContent>
{releaseData.map(release => {
const majorVersion = getMajorVersion(release.version);
const isNext = isNextVersion(latestMajorVersionNumber, majorVersion);
return (
<StyledReleaseSection key={release.version}>
<Typography variant="h3" color="primary.main">
@ -184,18 +135,6 @@ const Releases = ({ docsGroups, searchablePages }: DocsMenuProps) => {
>
Changelog
</StyledLink>
<StyledLink
href={`https://${
isNext
? 'next'
: majorVersion !== latestMajorVersion
? majorVersion
: 'www'
}.staticcms.org/docs`}
target={majorVersion !== latestMajorVersion ? '_blank' : undefined}
>
Docs
</StyledLink>
</Box>
</Typography>
</StyledReleaseSection>