diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 259f8e3d..4d1c956c 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions/setup-node@v3 with: node-version: 16 @@ -35,6 +37,8 @@ jobs: run: sleep 30s shell: bash - uses: actions/checkout@v3 + with: + submodules: recursive - name: install prince run: | curl https://www.princexml.com/download/prince-14.2-linux-generic-x86_64.tar.gz -O diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e2c06be7..0fdf80f8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/.gitmodules b/.gitmodules index ae3383a8..b658cef9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "examples"] path = examples - url = git@github.com:novalagung/dasarpemrogramanrust-example.git + url = https://github.com/novalagung/dasarpemrogramanrust-example.git +[submodule "src"] + path = src + url = https://github.com/novalagung/my-docusaurus-global-src.git diff --git a/docusaurus.config.js b/docusaurus.config.js index 544ba286..0f7ef119 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -41,7 +41,10 @@ const config = { }, blog: false, theme: { - customCss: require.resolve('./src/css/custom.css'), + customCss: [ + require.resolve('./src/css/global.css'), + require.resolve('./src-local/css/custom.css'), + ], }, gtag: { trackingID: 'G-HKPC8ZGM74', diff --git a/examples b/examples index d4824ef3..e550dc08 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit d4824ef3cca83a433e4a4b1046f346f499e469fa +Subproject commit e550dc08169bc849ae83818ec48c6315fdaf0f47 diff --git a/package-lock.json b/package-lock.json index f5fe2e3c..2e42805a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@docusaurus/preset-classic": "^2.2.0", "@docusaurus/theme-search-algolia": "^2.2.0", "@mdx-js/react": "^1.6.22", - "@stackql/docusaurus-plugin-structured-data": "novalagung/docusaurus-plugin-structured-data", + "@stackql/docusaurus-plugin-structured-data": "adamstudiogh/docusaurus-plugin-structured-data", "clsx": "^1.2.1", "disqus-react": "^1.1.5", "prism-react-renderer": "^1.3.5", @@ -2833,7 +2833,7 @@ }, "node_modules/@stackql/docusaurus-plugin-structured-data": { "version": "1.3.1", - "resolved": "git+ssh://git@github.com/novalagung/docusaurus-plugin-structured-data.git#b72b7083f96cdf4698dce94b694d57cefb7e9741", + "resolved": "git+ssh://git@github.com/adamstudiogh/docusaurus-plugin-structured-data.git#9810b83c02edcce40911f468aa332e0e0a3d7555", "license": "MIT", "dependencies": { "jsdom": "^21.0.0" @@ -14890,8 +14890,8 @@ } }, "@stackql/docusaurus-plugin-structured-data": { - "version": "git+ssh://git@github.com/novalagung/docusaurus-plugin-structured-data.git#b72b7083f96cdf4698dce94b694d57cefb7e9741", - "from": "@stackql/docusaurus-plugin-structured-data@novalagung/docusaurus-plugin-structured-data", + "version": "git+ssh://git@github.com/adamstudiogh/docusaurus-plugin-structured-data.git#9810b83c02edcce40911f468aa332e0e0a3d7555", + "from": "@stackql/docusaurus-plugin-structured-data@adamstudiogh/docusaurus-plugin-structured-data", "requires": { "jsdom": "^21.0.0" } diff --git a/src b/src new file mode 160000 index 00000000..9e20e687 --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit 9e20e687794b6424fcc2171295a7cd9ecd0ba0de diff --git a/src-local/css/custom.css b/src-local/css/custom.css new file mode 100644 index 00000000..3459b46c --- /dev/null +++ b/src-local/css/custom.css @@ -0,0 +1,33 @@ +/* You can override the default Infima variables here. */ +:root { + --ifm-color-primary: #2e8555; + --ifm-color-primary-dark: #29784c; + --ifm-color-primary-darker: #277148; + --ifm-color-primary-darkest: #205d3b; + --ifm-color-primary-light: #33925d; + --ifm-color-primary-lighter: #359962; + --ifm-color-primary-lightest: #3cad6e; + --ifm-code-font-size: 95%; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); + --doc-sidebar-width: 400px !important; + --ifm-blockquote-border-left-width: 4px; + --ifm-blockquote-border-color: #2e8555; +} + +/* For readability concerns, you should choose a lighter palette in dark mode. */ +[data-theme='dark'] { + --ifm-color-primary: #25c2a0; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); +} + +/* custom css */ + +.theme-code-block[class*="language-"] { + background: #FF874B !important; +} diff --git a/src/components/.gitkeep b/src/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/css/custom.css b/src/css/custom.css deleted file mode 100644 index a508872e..00000000 --- a/src/css/custom.css +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Any CSS included here will be global. The classic template - * bundles Infima by default. Infima is a CSS framework designed to - * work well for content-centric websites. - */ - -/* You can override the default Infima variables here. */ -:root { - --ifm-color-primary: #2e8555; - --ifm-color-primary-dark: #29784c; - --ifm-color-primary-darker: #277148; - --ifm-color-primary-darkest: #205d3b; - --ifm-color-primary-light: #33925d; - --ifm-color-primary-lighter: #359962; - --ifm-color-primary-lightest: #3cad6e; - --ifm-code-font-size: 95%; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); - --doc-sidebar-width: 400px !important; - --ifm-blockquote-border-left-width: 4px; - --ifm-blockquote-border-color: #2e8555; -} - -/* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); -} - -/* custom css */ -.markdown h1:first-child { - font-weight: normal; -} - -.theme-doc-markdown.markdown hr, .theme-doc-markdown.markdown + hr { - background-color: #eeeeee; - margin-top: 40px; - margin-bottom: 40px; -} - -blockquote { - margin-left: 15px; - background-color: #fbfbfb; - padding: 15px; - font-style: italic; -} -[data-theme='dark'] blockquote { - background-color: #282a36; -} - -.theme-code-block.language-rust, -.theme-code-block.language-bash { - background: #2e8555 !important; - color: #ffffff !important; -} - -.navbar__brand { - margin-right: 1.5rem; -} - -.aa-DetachedSearchButton { - width: 100px !important; - border-color: #d5d8da !important; - background-color: white; - height: 33px; -} -.aa-DetachedSearchButton .aa-DetachedSearchButtonIcon { - color: #d5d8da; -} -.aa-DetachedSearchButton .aa-DetachedSearchButtonIcon .aa-DetachedSearchButtonPlaceholder { - display: block; -} -.aa-DetachedSearchButton .aa-DetachedSearchButtonIcon .aa-DetachedSearchButtonPlaceholder::after { - content: "Search ..."; -} - -.menu.thin-scrollbar { - padding-bottom: 25px; -} \ No newline at end of file diff --git a/src/pages/intro.js b/src/pages/intro.js deleted file mode 100644 index 76f9048a..00000000 --- a/src/pages/intro.js +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -import { Redirect } from 'react-router-dom'; - -export default function Home() { - return ; -} diff --git a/src/theme/DocItem/Content/index.js b/src/theme/DocItem/Content/index.js deleted file mode 100644 index 2865c74e..00000000 --- a/src/theme/DocItem/Content/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import Content from '@theme-original/DocItem/Content'; -import BrowserOnly from '@docusaurus/BrowserOnly'; - -const SubStack = () => { - return <> - - -} - -export default function ContentWrapper(props) { - return ( - <> - -
- - {() => window?.location?.pathname === '/' && } - - - ); -} diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js deleted file mode 100644 index 17478a10..00000000 --- a/src/theme/DocItem/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react' -import {DiscussionEmbed} from 'disqus-react' -import DocItem from '@theme-original/DocItem'; - -export default function DocItemWrapper(props) { - const { metadata } = props.content - const { comments = true } = metadata.frontMatter - - const title = `Dasar Pemrograman Rust - ${metadata.title.split('. ').reverse()[0]}` - const slug = `https://dasarpemrogramanrust.novalagung.com${metadata.slug}` - - return ( - <> - -
- {comments && ( - - )} -
- - ); -} diff --git a/src/theme/DocSidebarItems/index.js b/src/theme/DocSidebarItems/index.js deleted file mode 100644 index 20fbd8b0..00000000 --- a/src/theme/DocSidebarItems/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React, {memo} from 'react'; -import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal'; -import DocSidebarItem from '@theme/DocSidebarItem'; -// TODO this item should probably not receive the "activePath" props -// TODO this triggers whole sidebar re-renders on navigation -function DocSidebarItems({items, ...props}) { - const itemsFiltered = items.filter((d) => (d.href || '').indexOf('/wip/') === -1) - return ( - - {itemsFiltered.map((item, index) => ( - - ))} - - ); -} -// Optimize sidebar at each "level" -export default memo(DocSidebarItems); diff --git a/src/theme/Navbar/Content/index.js b/src/theme/Navbar/Content/index.js deleted file mode 100644 index bc73e344..00000000 --- a/src/theme/Navbar/Content/index.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, { useEffect } from 'react'; -import {useThemeConfig} from '@docusaurus/theme-common'; -import { - splitNavbarItems, - useNavbarMobileSidebar, -} from '@docusaurus/theme-common/internal'; -import NavbarItem from '@theme/NavbarItem'; -import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle'; -import SearchBar from '@theme/SearchBar'; -import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle'; -import NavbarLogo from '@theme/Navbar/Logo'; -import NavbarSearch from '@theme/Navbar/Search'; -import styles from './styles.module.css'; -function useNavbarItems() { - // TODO temporary casting until ThemeConfig type is improved - return useThemeConfig().navbar.items; -} -function NavbarItems({items}) { - return ( - <> - {items.map((item, i) => ( - - ))} - - ); -} -function NavbarContentLayout({left, right}) { - useEffect(() => { - var s = document.createElement("script"); - s.type = "text/javascript"; - s.src = "https://buttons.github.io/buttons.js"; - document.querySelector("head").append(s); - }); - - return ( -
-
{left}
-
- - {right} -
-
- ); -} -export default function NavbarContent() { - const mobileSidebar = useNavbarMobileSidebar(); - const items = useNavbarItems(); - const [leftItems, rightItems] = splitNavbarItems(items); - const searchBarItem = items.find((item) => item.type === 'search'); - return ( - - {!mobileSidebar.disabled && } - - - - } - right={ - // TODO stop hardcoding items? - // Ask the user to add the respective navbar items => more flexible - <> - - - {!searchBarItem && ( - - - - )} - - } - /> - ); -} diff --git a/src/theme/Navbar/Content/styles.module.css b/src/theme/Navbar/Content/styles.module.css deleted file mode 100644 index 4c9471e1..00000000 --- a/src/theme/Navbar/Content/styles.module.css +++ /dev/null @@ -1,8 +0,0 @@ -/* -Hide color mode toggle in small viewports - */ -@media (max-width: 996px) { - .colorModeToggle { - display: none; - } -}