Compare commits
10 Commits
31ded813e0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f605a0e732 | ||
|
|
3900ad391d | ||
|
|
ea12b6dec6 | ||
|
|
812a836a92 | ||
|
|
2a9a4f980a | ||
|
|
9179caf200 | ||
|
|
05ae698cd7 | ||
|
|
8bb0667b18 | ||
|
|
df6eb44bcc | ||
|
|
d79e6c0b94 |
72
.gitea/workflows/ci.yaml
Normal file
72
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
check-latest: true
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run checks
|
||||
run: npm run check
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Ensure build and bundle info
|
||||
run: npx quartz build --bundleInfo
|
||||
|
||||
docker-build:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.dgse.cloud/dgroothuis/garden:${{ gitea.sha }},git.dgse.cloud/dgroothuis/garden:latest
|
||||
deploy:
|
||||
needs: docker-build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fake Deploy
|
||||
run: echo "Deploying"
|
||||
@@ -1,3 +1,4 @@
|
||||
public
|
||||
node_modules
|
||||
.quartz-cache
|
||||
content
|
||||
|
||||
15
content/DevOps/GitOps/index.md
Normal file
15
content/DevOps/GitOps/index.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: GitOps
|
||||
tags:
|
||||
- Sub-Topic
|
||||
---
|
||||
## Introduction
|
||||
Introdution here
|
||||
|
||||
---
|
||||
## Sub Topics
|
||||
[[_Topic Template]] • [[_Topic Template]]
|
||||
|
||||
---
|
||||
## Helpful Links
|
||||
[Link 1](https://git.dgse.cloud/DGSE/kubernetes-platform) • [Link 2](https://k3s.io)
|
||||
14
content/DevOps/Kubernetes/index.md
Normal file
14
content/DevOps/Kubernetes/index.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: Kubernetes
|
||||
tags:
|
||||
---
|
||||
## Introduction
|
||||
Introdution here
|
||||
|
||||
---
|
||||
## Sub Topics
|
||||
[[_Topic Template]] • [[_Topic Template]]
|
||||
|
||||
---
|
||||
## Helpful Links
|
||||
[Link 1](https://git.dgse.cloud/DGSE/kubernetes-platform) • [Link 2](https://k3s.io)
|
||||
17
content/DevOps/index.md
Normal file
17
content/DevOps/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: DevOps
|
||||
tags:
|
||||
- Topic
|
||||
---
|
||||
## Introduction
|
||||
All things regarding DevOps
|
||||
|
||||
Some intro here
|
||||
|
||||
---
|
||||
## Sub Topics
|
||||
[[DevOps/GitOps/index|GitOps]] • [[DevOps/Kubernetes/index|Kubernetes]]
|
||||
|
||||
---
|
||||
## Helpful Links
|
||||
[GitOps Repository](https://git.dgse.cloud/DGSE/kubernetes-platform) • [K3s](https://k3s.io)
|
||||
1
content/Glossary/API.md
Normal file
1
content/Glossary/API.md
Normal file
@@ -0,0 +1 @@
|
||||
Short for `Application Program Interface`. A standard for communicating with different applications across the web.
|
||||
3
content/Glossary/Cluster (Kubernetes).md
Normal file
3
content/Glossary/Cluster (Kubernetes).md
Normal file
@@ -0,0 +1,3 @@
|
||||
A Cluster is a collection of one or multiple [[Node (Kubernetes)|Nodes]] that are managed by [[Kubernetes]] for [[Container]] orchestration.
|
||||
|
||||
Clusters make use of a set of [[API|API's]] that control the different [[Node (Kubernetes)|Nodes]] and make sure that they are all in sync.
|
||||
1
content/Glossary/Kubernetes.md
Normal file
1
content/Glossary/Kubernetes.md
Normal file
@@ -0,0 +1 @@
|
||||
A platform for [[Container|container]] orchestration. It manages the creation and virtualization of [[Container|containers]].
|
||||
1
content/Glossary/Node (Kubernetes).md
Normal file
1
content/Glossary/Node (Kubernetes).md
Normal file
@@ -0,0 +1 @@
|
||||
A Node is a single server or VM that, when integrated in a [[Cluster (Kubernetes)]], enables the [[Cluster (Kubernetes)]] to make use of the resources of that given [[Server]] or VM.
|
||||
1
content/Glossary/Server.md
Normal file
1
content/Glossary/Server.md
Normal file
@@ -0,0 +1 @@
|
||||
A server is a physical machine where applications can be hosted on.
|
||||
14
content/_templates/_Topic Template.md
Normal file
14
content/_templates/_Topic Template.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: TITLE
|
||||
tags:
|
||||
---
|
||||
## Introduction
|
||||
Introdution here
|
||||
|
||||
---
|
||||
## Sub Topics
|
||||
[[_Topic Template]] • [[_Topic Template]]
|
||||
|
||||
---
|
||||
## Helpful Links
|
||||
[Link 1](https://git.dgse.cloud/DGSE/kubernetes-platform) • [Link 2](https://k3s.io)
|
||||
7
content/index.md
Normal file
7
content/index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Digital Garden
|
||||
---
|
||||
Hi there! Welcome to my digital garden. A place where all my notes and guides are collected. Focused on IT, Development and Dev/Ops.
|
||||
|
||||
## Paths to take
|
||||
- [[DevOps/index|DevOps]]
|
||||
@@ -16,8 +16,8 @@ const config: QuartzConfig = {
|
||||
provider: "plausible",
|
||||
},
|
||||
locale: "en-US",
|
||||
baseUrl: "quartz.jzhao.xyz",
|
||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||
baseUrl: "groothuis.io",
|
||||
ignorePatterns: ["private", "_templates", "templates", ".obsidian"],
|
||||
defaultDateType: "modified",
|
||||
theme: {
|
||||
fontOrigin: "googleFonts",
|
||||
|
||||
@@ -5,45 +5,12 @@ import * as Component from "./quartz/components"
|
||||
export const sharedPageComponents: SharedLayout = {
|
||||
head: Component.Head(),
|
||||
header: [],
|
||||
afterBody: [
|
||||
Component.DesktopOnly(Component.Flex({
|
||||
components: [
|
||||
{
|
||||
Component: Component.Graph(),
|
||||
align: "start",
|
||||
justify: "center",
|
||||
basis: "50%",
|
||||
},
|
||||
{
|
||||
Component: Component.Backlinks(),
|
||||
align: "start",
|
||||
justify: "center",
|
||||
basis: "50%",
|
||||
},
|
||||
],
|
||||
})),
|
||||
],
|
||||
footer: Component.Flex({
|
||||
direction: "column",
|
||||
components: [
|
||||
{
|
||||
Component: Component.Footer({
|
||||
afterBody: [],
|
||||
footer: Component.Footer({
|
||||
links: {
|
||||
Repository: "https://git.dgse.cloud/dgroothuis/digital-garden"
|
||||
"Kubernetes GitOps Repo": "https://git.dgse.cloud/DGSE/kubernetes",
|
||||
},
|
||||
}),
|
||||
align: "start",
|
||||
justify: "center",
|
||||
basis: "100%",
|
||||
},
|
||||
{
|
||||
Component: Component.Darkmode(),
|
||||
align: "center",
|
||||
justify: "center",
|
||||
basis: "100%",
|
||||
},
|
||||
]
|
||||
}),
|
||||
}
|
||||
|
||||
// components for pages that display a single page (e.g. a single note)
|
||||
@@ -60,21 +27,32 @@ export const defaultContentPageLayout: PageLayout = {
|
||||
left: [
|
||||
Component.PageTitle(),
|
||||
Component.MobileOnly(Component.Spacer()),
|
||||
Component.Search(),
|
||||
Component.TableOfContents(),
|
||||
Component.DesktopOnly(Component.Explorer({
|
||||
title: "Explore",
|
||||
folderClickBehavior: "collapse",
|
||||
Component.Flex({
|
||||
components: [
|
||||
{
|
||||
Component: Component.Search(),
|
||||
grow: true,
|
||||
},
|
||||
{ Component: Component.Darkmode() },
|
||||
{ Component: Component.ReaderMode() },
|
||||
],
|
||||
}),
|
||||
Component.Explorer({
|
||||
title: "Browse",
|
||||
folderDefaultState: "collapsed",
|
||||
useSavedState: true,
|
||||
})),
|
||||
Component.RecentNotes({
|
||||
title: "Recent notes",
|
||||
limit: 5,
|
||||
filter: (f) => f.slug! !== "index",
|
||||
})
|
||||
mapFn: (node) => {
|
||||
if (node.isFolder) {
|
||||
node.displayName = "🗄️ " + node.displayName
|
||||
} else {
|
||||
node.displayName = "📄 " + node.displayName
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
right: [
|
||||
Component.Graph(),
|
||||
Component.DesktopOnly(Component.TableOfContents()),
|
||||
Component.Backlinks(),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -93,7 +71,17 @@ export const defaultListPageLayout: PageLayout = {
|
||||
{ Component: Component.Darkmode() },
|
||||
],
|
||||
}),
|
||||
Component.Explorer(),
|
||||
Component.Explorer({
|
||||
title: "Browse",
|
||||
folderDefaultState: "collapsed",
|
||||
mapFn: (node) => {
|
||||
if (node.isFolder) {
|
||||
node.displayName = "🗄️ " + node.displayName
|
||||
} else {
|
||||
node.displayName = "📄 " + node.displayName
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
right: [],
|
||||
}
|
||||
|
||||
@@ -1,34 +1,16 @@
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
|
||||
|
||||
import style from "../styles/listPage.scss"
|
||||
import { PageList, SortFn } from "../PageList"
|
||||
import { PageList } from "../PageList"
|
||||
import { Root } from "hast"
|
||||
import { htmlToJsx } from "../../util/jsx"
|
||||
import { i18n } from "../../i18n"
|
||||
import { QuartzPluginData } from "../../plugins/vfile"
|
||||
import { ComponentChildren } from "preact"
|
||||
import { concatenateResources } from "../../util/resources"
|
||||
import { trieFromAllFiles } from "../../util/ctx"
|
||||
|
||||
interface FolderContentOptions {
|
||||
/**
|
||||
* Whether to display number of folders
|
||||
*/
|
||||
showFolderCount: boolean
|
||||
showSubfolders: boolean
|
||||
sort?: SortFn
|
||||
}
|
||||
|
||||
const defaultOptions: FolderContentOptions = {
|
||||
showFolderCount: true,
|
||||
showSubfolders: true,
|
||||
}
|
||||
|
||||
export default ((opts?: Partial<FolderContentOptions>) => {
|
||||
const options: FolderContentOptions = { ...defaultOptions, ...opts }
|
||||
|
||||
export default (() => {
|
||||
const FolderContent: QuartzComponent = (props: QuartzComponentProps) => {
|
||||
const { tree, fileData, allFiles, cfg } = props
|
||||
const { tree, fileData, allFiles } = props
|
||||
|
||||
const trie = (props.ctx.trie ??= trieFromAllFiles(allFiles))
|
||||
const folder = trie.findNode(fileData.slug!.split("/"))
|
||||
@@ -36,65 +18,8 @@ export default ((opts?: Partial<FolderContentOptions>) => {
|
||||
return null
|
||||
}
|
||||
|
||||
const allPagesInFolder: QuartzPluginData[] =
|
||||
folder.children
|
||||
.map((node) => {
|
||||
// regular file, proceed
|
||||
if (node.data) {
|
||||
return node.data
|
||||
}
|
||||
|
||||
if (node.isFolder && options.showSubfolders) {
|
||||
// folders that dont have data need synthetic files
|
||||
const getMostRecentDates = (): QuartzPluginData["dates"] => {
|
||||
let maybeDates: QuartzPluginData["dates"] | undefined = undefined
|
||||
for (const child of node.children) {
|
||||
if (child.data?.dates) {
|
||||
// compare all dates and assign to maybeDates if its more recent or its not set
|
||||
if (!maybeDates) {
|
||||
maybeDates = { ...child.data.dates }
|
||||
} else {
|
||||
if (child.data.dates.created > maybeDates.created) {
|
||||
maybeDates.created = child.data.dates.created
|
||||
}
|
||||
|
||||
if (child.data.dates.modified > maybeDates.modified) {
|
||||
maybeDates.modified = child.data.dates.modified
|
||||
}
|
||||
|
||||
if (child.data.dates.published > maybeDates.published) {
|
||||
maybeDates.published = child.data.dates.published
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (
|
||||
maybeDates ?? {
|
||||
created: new Date(),
|
||||
modified: new Date(),
|
||||
published: new Date(),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
slug: node.slug,
|
||||
dates: getMostRecentDates(),
|
||||
frontmatter: {
|
||||
title: node.displayName,
|
||||
tags: [],
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
.filter((page) => page !== undefined) ?? []
|
||||
const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? []
|
||||
const classes = cssClasses.join(" ")
|
||||
const listProps = {
|
||||
...props,
|
||||
sort: options.sort,
|
||||
allFiles: allPagesInFolder,
|
||||
}
|
||||
|
||||
const content = (
|
||||
(tree as Root).children.length === 0
|
||||
@@ -105,18 +30,6 @@ export default ((opts?: Partial<FolderContentOptions>) => {
|
||||
return (
|
||||
<div class="popover-hint">
|
||||
<article class={classes}>{content}</article>
|
||||
<div class="page-listing">
|
||||
{options.showFolderCount && (
|
||||
<p>
|
||||
{i18n(cfg.locale).pages.folderContent.itemsUnderFolder({
|
||||
count: allPagesInFolder.length,
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
<div>
|
||||
<PageList {...listProps} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FolderPageOptions>> = (user
|
||||
const opts: FullPageLayout = {
|
||||
...sharedPageComponents,
|
||||
...defaultListPageLayout,
|
||||
pageBody: FolderContent({ sort: userOpts?.sort }),
|
||||
pageBody: FolderContent(),
|
||||
...userOpts,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user