diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 82ac46d23..a884a3207 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: run: npx quartz build --bundleInfo publish-tag: - if: ${{ github.repository == 'jackyzha0/quartz' }} + if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v4' }} runs-on: ubuntu-latest permissions: contents: write diff --git a/docs/configuration.md b/docs/configuration.md index 558fe52fe..556668210 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -30,6 +30,7 @@ This part of the configuration concerns anything that can affect the whole site. - `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com); - `{ provider: 'posthog', apiKey: '', host: '' }`: use [Posthog](https://posthog.com/); - `{ provider: 'tinylytics', siteId: '' }`: use [Tinylytics](https://tinylytics.app/); + - `{ provider: 'cabin' }` or `{ provider: 'cabin', host: 'https://cabin.example.com' }` (custom domain): use [Cabin](https://withcabin.com); - `locale`: used for [[i18n]] and date formatting - `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes. - This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`. diff --git a/quartz/cfg.ts b/quartz/cfg.ts index 61bfea6ef..fd01e7098 100644 --- a/quartz/cfg.ts +++ b/quartz/cfg.ts @@ -34,6 +34,10 @@ export type Analytics = provider: "tinylytics" siteId: string } + | { + provider: "cabin" + host?: string + } export interface GlobalConfiguration { pageTitle: string diff --git a/quartz/components/ExplorerNode.tsx b/quartz/components/ExplorerNode.tsx index 819f29a58..9cddd36b4 100644 --- a/quartz/components/ExplorerNode.tsx +++ b/quartz/components/ExplorerNode.tsx @@ -183,10 +183,8 @@ export function ExplorerNode({ const isDefaultOpen = opts.folderDefaultState === "open" // Calculate current folderPath - let folderPath = "" - if (node.name !== "") { - folderPath = joinSegments(fullPath ?? "", node.name) - } + const folderPath = node.name !== "" ? joinSegments(fullPath ?? "", node.name) : "" + const href = resolveRelative(fileData.slug!, folderPath as SimpleSlug) + "/" return ( <> diff --git a/quartz/components/styles/listPage.scss b/quartz/components/styles/listPage.scss index c8fc9e957..d51568dc0 100644 --- a/quartz/components/styles/listPage.scss +++ b/quartz/components/styles/listPage.scss @@ -11,7 +11,7 @@ li.section-li { & > .section { display: grid; - grid-template-columns: 6em 3fr 1fr; + grid-template-columns: fit-content(8em) 3fr 1fr; @media all and (max-width: $mobileBreakpoint) { & > .tags { @@ -24,8 +24,7 @@ li.section-li { } & > .meta { - margin: 0; - flex-basis: 6em; + margin: 0 1em 0 0; opacity: 0.6; } } @@ -33,7 +32,8 @@ li.section-li { // modifications in popover context .popover .section { - grid-template-columns: 6em 1fr !important; + grid-template-columns: fit-content(8em) 1fr !important; + & > .tags { display: none; } diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index 0d26c1d49..31ddb6842 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -149,6 +149,14 @@ function addGlobalPageResources( tinylyticsScript.defer = true document.head.appendChild(tinylyticsScript) `) + } else if (cfg.analytics?.provider === "cabin") { + componentResources.afterDOMLoaded.push(` + const cabinScript = document.createElement("script") + cabinScript.src = "${cfg.analytics.host ?? "https://scripts.cabin.dev"}/cabin.js" + cabinScript.defer = true + cabinScript.async = true + document.head.appendChild(cabinScript) + `) } if (cfg.enableSPA) { diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 3d93800a9..e4fa26849 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -485,11 +485,14 @@ video { flex: 1 1 auto; } +div:has(> .overflow) { + position: relative; +} + ul.overflow, ol.overflow { max-height: 400; overflow-y: auto; - position: relative; // clearfix content: "";