Skip to content

Commit

Permalink
Merge pull request #55 from illacloud/fix/nginx_error
Browse files Browse the repository at this point in the history
Fix/nginx error
  • Loading branch information
AruSeito authored Jan 4, 2024
2 parents c03aa00 + 6fe15c6 commit 12d7281
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 121 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy-to-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- develop

permissions:
contents: write
Expand All @@ -19,7 +18,7 @@ jobs:
env:
ILLA_URL: "https://illacloud.github.io"
ILLA_BASE_URL: "/illa-website/"

steps:
- uses: actions/checkout@v3

Expand Down
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM nginx:stable-alpine as runner
FROM node:lts as base
ENV FORCE_COLOR=0
RUN corepack enable
WORKDIR /opt/docusaurus

## copy frontend
COPY nginx.conf /etc/nginx/nginx.conf
COPY illa-website-frontend.conf /etc/nginx/conf.d/illa-website-frontend.conf
COPY ./build /opt/illa/illa-website-frontend
RUN rm /etc/nginx/conf.d/default.conf
FROM base as prod
WORKDIR /opt/docusaurus
COPY ./package.json /opt/docusaurus/
COPY ./pnpm-lock.yaml /opt/docusaurus/
RUN pnpm install --frozen-lockfile
COPY ./build /opt/docusaurus/build
COPY ./docusaurus.config.ts /opt/docusaurus/

# test nginx
RUN nginx -t

# run
EXPOSE 3000
FROM prod as serve
EXPOSE 3000
CMD ["pnpm", "serve"]
4 changes: 2 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { themes as prismThemes } from "prism-react-renderer"
import type { Config } from "@docusaurus/types"
import type * as Preset from "@docusaurus/preset-classic"
import { DEFAULT_KEYWORDS } from "./src/constants/meta"

const config: Config = {
title: "ILLA Cloud",
Expand Down Expand Up @@ -69,7 +68,8 @@ const config: Config = {
},
{
name: "keywords",
content: DEFAULT_KEYWORDS,
content:
"illa,illacloud,illa cloud,艾拉云科,Retool,Budibase,Tooljet,UIBakery, Low-code,open-source, developers, developer tool, internal, rust,illa, illabuilder, illa-builder, retool alternative, Appsmith, Appsmith alternative, open-source alternative, budibase alternative,ローコード,低代码,开发者工具,낮은 코드,오픈 소스,オープンソース",
},
],
prism: {
Expand Down
26 changes: 0 additions & 26 deletions illa-website-frontend.conf

This file was deleted.

38 changes: 0 additions & 38 deletions nginx.conf

This file was deleted.

3 changes: 1 addition & 2 deletions src/ILLATheme/CommonFooter/FooterItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import clsx from "clsx"
import Link from "@docusaurus/Link"
import Translate from "@docusaurus/Translate"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { fixedPath } from "@site/src/utils/fixedPath"

export const FooterItems = ({ items, whiteTheme }) => {
const [showMore, setShowMore] = useState(false)
Expand All @@ -26,7 +25,7 @@ export const FooterItems = ({ items, whiteTheme }) => {
{items.slice(0, 6).map(({ label, href = "", tagCategory }) => (
<Link
key={label}
to={getUtmParams(fixedPath(href))}
to={getUtmParams(href)}
className="hover:no-underline"
>
<span
Expand Down
5 changes: 2 additions & 3 deletions src/ILLATheme/CommonFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import { useElementFirstShow } from "@site/src/hooks/useElementFirstShow"
import { useRef, FC, useCallback } from "react"
import LocaleDropdownNavbarItem from "@theme/NavbarItem/LocaleDropdownNavbarItem"
import { FOOTER_CONTENT } from "./constants"
import Translate, { translate } from "@docusaurus/Translate"
import Translate from "@docusaurus/Translate"
import { ICommonFooterProps } from "./interface"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { POLICY, SERVICE } from "@site/src/constants/url"
import { fixedPath } from "@site/src/utils/fixedPath"

const CommonFooter: FC<ICommonFooterProps> = ({
whiteTheme = false,
Expand Down Expand Up @@ -90,7 +89,7 @@ const CommonFooter: FC<ICommonFooterProps> = ({
return (
<Link
key={label}
to={getUtmParams(fixedPath(href))}
to={getUtmParams(href)}
className="hover:no-underline"
>
{icon ? (
Expand Down
5 changes: 2 additions & 3 deletions src/ILLATheme/CommonHeader/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { sendTagEvent } from "@site/src/utils/gtag"
import style from "./index.module.css"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { Solutions } from "../SolutionsItem"
import { fixedPath } from "@site/src/utils/fixedPath"

export const HeaderMenu: FC<IHeaderMenuProps> = (props) => {
const { whiteTheme, hasBgColor } = props
Expand All @@ -24,7 +23,7 @@ export const HeaderMenu: FC<IHeaderMenuProps> = (props) => {
return (
<Link
key={item.label}
to={getUtmParams(fixedPath(item.href))}
to={getUtmParams(item.href)}
onClick={() => {
sendTagEvent({
action: "click",
Expand Down Expand Up @@ -96,7 +95,7 @@ export const HeaderMenu: FC<IHeaderMenuProps> = (props) => {
}}
>
<Link
to={getUtmParams(fixedPath(subItem.href))}
to={getUtmParams(subItem.href)}
className={clsx(
style.panelItemStyle,
whiteTheme
Expand Down
3 changes: 1 addition & 2 deletions src/ILLATheme/CommonHeader/MobileMenu/menuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import Link from "@docusaurus/Link"
import { IMenuItemProps } from "../interface"
import style from "./index.module.css"
import { sendTagEvent } from "@site/src/utils/gtag"
import { fixedPath } from "@site/src/utils/fixedPath"

export const MenuItem: React.FC<IMenuItemProps> = ({ item }) => {
return (
<Link
to={fixedPath(item.href)}
to={item.href}
className={style.menuItemStyle}
onClick={() => {
sendTagEvent({
Expand Down
3 changes: 1 addition & 2 deletions src/ILLATheme/CommonHeader/SolutionsItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import clsx from "clsx"
import { sendTagEvent } from "@site/src/utils/gtag"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import style from "./index.module.css"
import { fixedPath } from "@site/src/utils/fixedPath"

export const Solutions: FC<{ whiteTheme: boolean }> = ({ whiteTheme }) => {
const getUtmParams = useUtmParams()
Expand Down Expand Up @@ -60,7 +59,7 @@ export const Solutions: FC<{ whiteTheme: boolean }> = ({ whiteTheme }) => {
<Menu.Item key={subItem.label}>
{() => (
<Link
to={getUtmParams(fixedPath(subItem.href))}
to={getUtmParams(subItem.href)}
className={clsx(
style.basePanelItemContainerStyle,
whiteTheme
Expand Down
3 changes: 1 addition & 2 deletions src/ILLATheme/LandingLayout/ResourceTemplateLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { LpHeader } from "../../../components/landingPage/Header"
import styles from "./style.module.css"
import CommBottom from "../../../components/common/CommBottom"
import { LpTemplate } from "../../../components/landingPage/Template"
import { fixedPath } from "@site/src/utils/fixedPath"

const ResourceTemplateLayout: FC<IResourceTemplateLayoutProps> = (props) => {
const { title, description, headerConfig, footerConfig, schemaData } = props
Expand All @@ -27,7 +26,7 @@ const ResourceTemplateLayout: FC<IResourceTemplateLayoutProps> = (props) => {
leftImage={headerConfig.leftImage}
isShowBack={headerConfig.isShowBack}
backText={headerConfig.backText}
prevPagePath={fixedPath(headerConfig.prevPagePath)}
prevPagePath={headerConfig.prevPagePath}
/>
<LpTemplate />
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/components/blog/FeaturedBlogPostItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import BlogPostItemContainer from "@theme/BlogPostItem/Container"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { Date } from "@site/src/components/blog/common/date"
import clsx from "clsx"
import { fixedPath } from "@site/src/utils/fixedPath"

export const FeaturedBlogPostItem = () => {
const { metadata } = useBlogPost()
Expand All @@ -22,11 +21,10 @@ export const FeaturedBlogPostItem = () => {
const author = metadata.authors[0]
const getUtmParams = useUtmParams()

const fixedPermalink = fixedPath(permalink)

return (
<BlogPostItemContainer>
<Link itemProp="url" to={getUtmParams(fixedPermalink)}>
<Link itemProp="url" to={getUtmParams(permalink)}>
<div className="not-prose relative m-0 h-40 hover:brightness-90 md:h-64">
<img
src={`${frontMatter.image}?h=256`}
Expand All @@ -53,7 +51,7 @@ export const FeaturedBlogPostItem = () => {
"rounded",
"px-2 py-1",
)}
href={getUtmParams(fixedPath(tag.permalink))}
href={getUtmParams(tag.permalink)}
key={tag.permalink}
>
{tag.label}
Expand Down
11 changes: 4 additions & 7 deletions src/components/blog/PostPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ import {
LinkedinIcon,
} from "react-share"
import clsx from "clsx"

import { Date } from "@site/src/components/blog/common/date"
import { ReadingTime } from "@site/src/components/blog/common/reading-time"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import DiscordAndGithubBanner from "@site/src/components/blog/discord-and-github-banner"
import { fixedPath } from "@site/src/utils/fixedPath"

export const BlogPostPageView = ({ children }) => {
const { metadata, isBlogPostPage } = useBlogPost()
Expand All @@ -36,7 +34,6 @@ export const BlogPostPageView = ({ children }) => {
const author = authors[0]
const getUtmParams = useUtmParams()

const fixedPermalink = fixedPath(permalink)

const {
siteConfig: { url },
Expand Down Expand Up @@ -75,7 +72,7 @@ export const BlogPostPageView = ({ children }) => {
<TwitterShareButton
windowWidth={750}
windowHeight={800}
url={url + fixedPermalink}
url={url + permalink}
className="flex"
title={title}
hashtags={tags.map((tag) => tag.label)}
Expand All @@ -86,13 +83,13 @@ export const BlogPostPageView = ({ children }) => {
className="flex"
windowWidth={750}
windowHeight={600}
url={url + fixedPermalink}
url={url + permalink}
title={title}
>
<RedditIcon size={26} round />
</RedditShareButton>
<LinkedinShareButton
url={url + fixedPermalink}
url={url + permalink}
title={title}
source={url}
summary={description}
Expand Down Expand Up @@ -133,7 +130,7 @@ export const BlogPostPageView = ({ children }) => {
{isBlogPostPage ? (
title
) : (
<Link itemProp="url" to={getUtmParams(fixedPermalink)}>
<Link itemProp="url" to={getUtmParams(permalink)}>
{title}
</Link>
)}
Expand Down
3 changes: 1 addition & 2 deletions src/components/blog/PostPaginator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Link from "@docusaurus/Link"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { Date } from "@site/src/components/blog/common/date"
import clsx from "clsx"
import { fixedPath } from "@site/src/utils/fixedPath"

export const PostPaginator = ({ posts, title }) => {
const getUtmParams = useUtmParams()
Expand Down Expand Up @@ -40,7 +39,7 @@ export const PostPaginator = ({ posts, title }) => {
)}
>
<Link
to={getUtmParams(fixedPath(post.permalink))}
to={getUtmParams(post.permalink)}
rel="dofollow"
className={clsx(
"font-bold",
Expand Down
3 changes: 1 addition & 2 deletions src/components/blog/Tags/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Link from "@docusaurus/Link"
import { useBlogPost } from "@docusaurus/theme-common/internal"
import clsx from "clsx"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { fixedPath } from "@site/src/utils/fixedPath"

export const Tags = () => {
const { metadata } = useBlogPost()
Expand All @@ -12,7 +11,7 @@ export const Tags = () => {
<div className="flex flex-wrap gap-2 pb-6 pl-1">
{metadata.tags.map((tag) => (
<Link
to={getUtmParams(fixedPath(tag.permalink))}
to={getUtmParams(tag.permalink)}
className={clsx(
"text-xs",
"bg-gray-100 dark:bg-gray-700",
Expand Down
3 changes: 1 addition & 2 deletions src/components/landingPage/IndexContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import clsx from "clsx"
import { IContentItemsProps, IIndexContentProps } from "./interface"
import { LearnMore } from "../LearnMore"
import { useUtmParams } from "@site/src/hooks/useUtmParams"
import { fixedPath } from "@site/src/utils/fixedPath"

const ContentItems: FC<IContentItemsProps> = ({ contentList, pageName }) => {
const getUtmParams = useUtmParams()
Expand Down Expand Up @@ -52,7 +51,7 @@ const ContentItems: FC<IContentItemsProps> = ({ contentList, pageName }) => {
<span className={styles.itemDescription}>{description}</span>
</div>
<LearnMore
href={getUtmParams(fixedPath(`/${pageName}/${path}`))}
href={getUtmParams(`/${pageName}/${path}`)}
onClick={() => onClick(name)}
/>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/constants/meta.ts

This file was deleted.

Loading

0 comments on commit 12d7281

Please sign in to comment.