Skip to content

Commit

Permalink
Merge branch 'main' into appwrite#1499-update-contributing-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gurjeetsinghvirdee authored Jan 29, 2025
2 parents f9958ab + 856ad06 commit 3313f2a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
18 changes: 17 additions & 1 deletion src/markdoc/nodes/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@
export let href: string;
export let title: string;
const isExternal = ['http://', 'https://'].some((prefix) => href.startsWith(prefix));
const whitelisted = ['appwrite.io', 'cloud.appwrite.io'];
const isExternal = ['http://', 'https://'].some((prefix) => {
if (href.startsWith(prefix)) {
try {
// Remove 'www.' if it exists.
const hostname = new URL(href).hostname.replace(/^www\./, '');
// if hostname matches, its internal
return !whitelisted.includes(hostname);
} catch {
return true; // URL invalid, treat as external
}
}
return false; // doesn't start with the prefix, consider it internal
});
const target = isExternal ? '_blank' : undefined;
const doFollow = href.includes('?dofollow=true') || href.includes('&dofollow=true');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,20 @@
preferredPlatform.set($page.params.platform as Platform);
});
// cleaned service description without Markdown links.
$: serviceDescription = (data.service?.description ?? '').replace(
/\[([^\]]+)]\([^)]+\)/g,
'$1'
);
// the service description up to the first full stop, providing sufficient information.
$: shortenedDescription = serviceDescription.substring(0, serviceDescription.indexOf('.') + 1);
$: platform = $page.params.platform as Platform;
$: platformType = platform.startsWith('client-') ? 'CLIENT' : 'SERVER';
$: serviceName = serviceMap[data.service?.name];
$: title = serviceName + API_REFERENCE_TITLE_SUFFIX;
$: description = data.service?.description;
$: description = shortenedDescription;
$: ogImage = DEFAULT_HOST + '/images/open-graph/docs.png';
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The Teams service allows you to group users of your project and to enable them to share [read and write](/docs/advanced/platform/permissions) access to your project resources, such as database documents or storage files.
The Teams service allows you to group users of your project and share [read and write](/docs/advanced/platform/permissions) access to resources like database documents or storage files.

Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to their team.
2 changes: 1 addition & 1 deletion src/scss/6-elements/_mini-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
--p-mini-card-bg-color: var(--web-color-white);
--p-mini-card-border-color: var(--web-color-greyscale-100);

padding:pxToRem(10); padding-inline-start:pxToRem(16);
padding:pxToRem(10);

background-color: hsl(var(--p-mini-card-bg-color));
border: solid pxToRem(1) hsl(var(--p-mini-card-border-color));
Expand Down

0 comments on commit 3313f2a

Please sign in to comment.