Modified dockerfile to support overriding files within quartz repo by placing modified files under quartz_overrides/ with an identical folder structure. Modified Footer.tsx to include some quotes at the very bottom of each page. Added force option to rebuild script. Updated links appearing in page footer.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# .gitignore
|
# .gitignore
|
||||||
quartz/
|
quartz/
|
||||||
|
!quartz_overrides/quartz/
|
||||||
|
|
||||||
# Node
|
# Node
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|||||||
+4
-4
@@ -22,10 +22,10 @@ RUN npm ci
|
|||||||
COPY --chown=node:node quartz.config.ts ./quartz.config.ts
|
COPY --chown=node:node quartz.config.ts ./quartz.config.ts
|
||||||
COPY --chown=node:node quartz.layout.ts ./quartz.layout.ts
|
COPY --chown=node:node quartz.layout.ts ./quartz.layout.ts
|
||||||
|
|
||||||
# If you have other custom files/dirs at the root of your deployment repo that Quartz needs:
|
# Copy your custom overrides.
|
||||||
# e.g., custom assets not part of Obsidian content, or custom components to overlay
|
# This copies the contents of 'quartz_overrides/' from your deployment repo
|
||||||
# COPY --chown=node:node assets/ ./assets/
|
# into /home/node/app/, overlaying any matching paths from the original framework.
|
||||||
# COPY --chown=node:node components/ ./components/
|
COPY --chown=node:node quartz_overrides/ .
|
||||||
|
|
||||||
# Copy the Obsidian content prepared by the host script into ./content
|
# Copy the Obsidian content prepared by the host script into ./content
|
||||||
COPY --chown=node:node content/ ./content/
|
COPY --chown=node:node content/ ./content/
|
||||||
|
|||||||
+5
-3
@@ -8,9 +8,11 @@ export const sharedPageComponents: SharedLayout = {
|
|||||||
afterBody: [],
|
afterBody: [],
|
||||||
footer: Component.Footer({
|
footer: Component.Footer({
|
||||||
links: {
|
links: {
|
||||||
GitHub: "https://github.com/jackyzha0/quartz",
|
Git: "https://git.c0smere.net/",
|
||||||
"Discord Community": "https://discord.gg/cRFFHYye7t",
|
Blog: "https://blog.c0smere.net/",
|
||||||
},
|
Resume: "https://resume.c0smere.net/",
|
||||||
|
LinkedIn: "https://www.linkedin.com/in/wesley-m-ray/"
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||||
|
import style from "./styles/footer.scss"
|
||||||
|
import { version } from "../../package.json"
|
||||||
|
import { i18n } from "../i18n"
|
||||||
|
|
||||||
|
interface Options {
|
||||||
|
links: Record<string, string>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ((opts?: Options) => {
|
||||||
|
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
|
||||||
|
const year = new Date().getFullYear()
|
||||||
|
const links = opts?.links ?? []
|
||||||
|
const quote1 = "Failure is unique among sin, in that we can turn it into a virtue when it drives us to succeed."
|
||||||
|
const quote2 = "The living diminish, but the machine endures..."
|
||||||
|
|
||||||
|
return (
|
||||||
|
<footer class={`${displayClass ?? ""}`}>
|
||||||
|
<p>
|
||||||
|
{i18n(cfg.locale).components.footer.createdWith}{" "}
|
||||||
|
<a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year}
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
{Object.entries(links).map(([text, link]) => (
|
||||||
|
<li>
|
||||||
|
<a href={link}>{text}</a>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
<em>{quote1}</em>
|
||||||
|
<br />
|
||||||
|
<em>{quote2}</em>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Footer.css = style
|
||||||
|
return Footer
|
||||||
|
}) satisfies QuartzComponentConstructor
|
||||||
+14
-3
@@ -20,6 +20,12 @@ cd "$QUARTZ_PROJECT_DIR" || { log_message "FATAL: Failed to cd to project direct
|
|||||||
|
|
||||||
log_message "--- Quartz Docker Update Script Started ---"
|
log_message "--- Quartz Docker Update Script Started ---"
|
||||||
|
|
||||||
|
FORCE_REBUILD=false
|
||||||
|
if [ "$1" == "force" ]; then
|
||||||
|
log_message "Force rebuild argument ('$1') received."
|
||||||
|
FORCE_REBUILD=true
|
||||||
|
fi
|
||||||
|
|
||||||
# --- Step 1: Ensure Quartz Framework Source is Present and Updated ---
|
# --- Step 1: Ensure Quartz Framework Source is Present and Updated ---
|
||||||
FRAMEWORK_FULL_PATH="${QUARTZ_PROJECT_DIR}/${QUARTZ_FRAMEWORK_DIR_NAME}"
|
FRAMEWORK_FULL_PATH="${QUARTZ_PROJECT_DIR}/${QUARTZ_FRAMEWORK_DIR_NAME}"
|
||||||
if [ -d "${FRAMEWORK_FULL_PATH}/.git" ]; then
|
if [ -d "${FRAMEWORK_FULL_PATH}/.git" ]; then
|
||||||
@@ -43,12 +49,16 @@ fi
|
|||||||
|
|
||||||
# --- Step 2: Change Detection for Obsidian Content ---
|
# --- Step 2: Change Detection for Obsidian Content ---
|
||||||
NEEDS_REBUILD=false
|
NEEDS_REBUILD=false
|
||||||
|
if [ "$FORCE_REBUILD" = true ]; then
|
||||||
|
log_message "Forcing rebuild as per argument."
|
||||||
|
NEEDS_REBUILD=true
|
||||||
|
else
|
||||||
if [ ! -d "$OBSIDIAN_CONTENT_SOURCE" ]; then
|
if [ ! -d "$OBSIDIAN_CONTENT_SOURCE" ]; then
|
||||||
log_message "ERROR: Obsidian content source directory does not exist: ${OBSIDIAN_CONTENT_SOURCE}"
|
log_message "ERROR: Obsidian content source directory does not exist: ${OBSIDIAN_CONTENT_SOURCE}"
|
||||||
NEEDS_REBUILD=false
|
# Decide if this is fatal or if you want to try building without new content
|
||||||
|
# For now, it will not set NEEDS_REBUILD=true, so script might exit if no prior timestamp
|
||||||
elif [ ! -f "$LAST_BUILD_TIMESTAMP_FILE" ]; then
|
elif [ ! -f "$LAST_BUILD_TIMESTAMP_FILE" ]; then
|
||||||
log_message "No last build timestamp found. Triggering initial rebuild."
|
log_message "No last build timestamp found at ${LAST_BUILD_TIMESTAMP_FILE}. Triggering initial rebuild."
|
||||||
NEEDS_REBUILD=true
|
NEEDS_REBUILD=true
|
||||||
else
|
else
|
||||||
if find "$OBSIDIAN_CONTENT_SOURCE" -type f -newer "$LAST_BUILD_TIMESTAMP_FILE" -print -quit | grep -q .; then
|
if find "$OBSIDIAN_CONTENT_SOURCE" -type f -newer "$LAST_BUILD_TIMESTAMP_FILE" -print -quit | grep -q .; then
|
||||||
@@ -58,6 +68,7 @@ else
|
|||||||
log_message "No changes detected in Obsidian content since last build."
|
log_message "No changes detected in Obsidian content since last build."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$NEEDS_REBUILD" = false ]; then
|
if [ "$NEEDS_REBUILD" = false ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user