Skip to content

Commit

Permalink
Merge branch 'main' into ADAPP-18656-cocos-2-dx-v-5-migration-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Sep 27, 2024
2 parents 87cc17d + 27160dd commit bb7ed0c
Show file tree
Hide file tree
Showing 20 changed files with 568 additions and 163 deletions.
3 changes: 3 additions & 0 deletions markdoc.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export default defineMarkdocConfig({
}
}
},
deflist: {
render: component("src/components/DefList.astro"),
},
listcolumns: {
render: component("src/components/ListColumns.astro"),
},
Expand Down
134 changes: 67 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 16 additions & 13 deletions src/components/BigToc.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@ const { title, headings } = Astro.props;
headings.length > 0 &&
headings
.filter(({ depth }) => depth > 1 && depth < 5)
.map((heading) => (
<li
class={`toc-item depth-${heading.depth} ml-${heading.depth > 2 ? 6 : 0}`}
>
<a
class="toc-link text-gray-700 hover:text-blue-600 hover:no-underline"
data-slug={heading.slug}
href={`#${heading.slug}`}
>
{heading.text}
</a>
</li>
))
.map(
(heading) =>
heading.slug && (
<li
class={`toc-item depth-${heading.depth} ml-${heading.depth > 2 ? 6 : 0}`}
>
<a
class="toc-link text-gray-700 hover:text-blue-600 hover:no-underline"
data-slug={heading.slug}
href={`#${heading.slug}`}
>
{heading.text}
</a>
</li>
),
)
}
</ul>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/components/DefList.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import { decode } from "tiny-decode";
import { parseDefList } from "@components/utils/parseDefList";
const content = decode(await Astro.slots.render("default"));
const parsedContent = await parseDefList(content);
---

<Fragment set:html={parsedContent} />
2 changes: 1 addition & 1 deletion src/components/ListColumns.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const content = Astro.slots.has("default")
const lists = content.split("<hr>");
---

<div class="col-group grid grid-flow-row lg:grid-flow-col gap-6">
<div class="col-group grid grid-flow-row lg:grid-flow-col gap-6 mb-7">
{
lists.map((list) => (
<div class="column">
Expand Down
8 changes: 4 additions & 4 deletions src/components/pages/search/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const Pagination: FC<PaginationProps> = ({ canRefine, lang }) => {
const iconRightColor = isLastPage ? "#808080" : "#000";

return (
<>
<div className="flex justify-center items-center mb-16">
{isPaginaton && (
<div className="flex justify-center items-center mb-16">
<>
<span
className={classNames(
"mr-3 flex items-center justify-center min-h-[20px] min-w-[20px]",
Expand Down Expand Up @@ -65,9 +65,9 @@ const Pagination: FC<PaginationProps> = ({ canRefine, lang }) => {
>
<Icon name="ChevronRight" size="small" color={iconRightColor} />
</span>
</div>
</>
)}
</>
</div>
);
};

Expand Down
Loading

0 comments on commit bb7ed0c

Please sign in to comment.