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
|
||||
quartz/
|
||||
!quartz_overrides/quartz/
|
||||
|
||||
# Node
|
||||
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.layout.ts ./quartz.layout.ts
|
||||
|
||||
# If you have other custom files/dirs at the root of your deployment repo that Quartz needs:
|
||||
# e.g., custom assets not part of Obsidian content, or custom components to overlay
|
||||
# COPY --chown=node:node assets/ ./assets/
|
||||
# COPY --chown=node:node components/ ./components/
|
||||
# Copy your custom overrides.
|
||||
# This copies the contents of 'quartz_overrides/' from your deployment repo
|
||||
# into /home/node/app/, overlaying any matching paths from the original framework.
|
||||
COPY --chown=node:node quartz_overrides/ .
|
||||
|
||||
# Copy the Obsidian content prepared by the host script into ./content
|
||||
COPY --chown=node:node content/ ./content/
|
||||
|
||||
+5
-3
@@ -8,9 +8,11 @@ export const sharedPageComponents: SharedLayout = {
|
||||
afterBody: [],
|
||||
footer: Component.Footer({
|
||||
links: {
|
||||
GitHub: "https://github.com/jackyzha0/quartz",
|
||||
"Discord Community": "https://discord.gg/cRFFHYye7t",
|
||||
},
|
||||
Git: "https://git.c0smere.net/",
|
||||
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
|
||||
+17
-6
@@ -20,6 +20,12 @@ cd "$QUARTZ_PROJECT_DIR" || { log_message "FATAL: Failed to cd to project direct
|
||||
|
||||
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 ---
|
||||
FRAMEWORK_FULL_PATH="${QUARTZ_PROJECT_DIR}/${QUARTZ_FRAMEWORK_DIR_NAME}"
|
||||
if [ -d "${FRAMEWORK_FULL_PATH}/.git" ]; then
|
||||
@@ -43,20 +49,25 @@ fi
|
||||
|
||||
# --- Step 2: Change Detection for Obsidian Content ---
|
||||
NEEDS_REBUILD=false
|
||||
|
||||
if [ ! -d "$OBSIDIAN_CONTENT_SOURCE" ]; then
|
||||
log_message "ERROR: Obsidian content source directory does not exist: ${OBSIDIAN_CONTENT_SOURCE}"
|
||||
NEEDS_REBUILD=false
|
||||
elif [ ! -f "$LAST_BUILD_TIMESTAMP_FILE" ]; then
|
||||
log_message "No last build timestamp found. Triggering initial rebuild."
|
||||
if [ "$FORCE_REBUILD" = true ]; then
|
||||
log_message "Forcing rebuild as per argument."
|
||||
NEEDS_REBUILD=true
|
||||
else
|
||||
if [ ! -d "$OBSIDIAN_CONTENT_SOURCE" ]; then
|
||||
log_message "ERROR: Obsidian content source directory does not exist: ${OBSIDIAN_CONTENT_SOURCE}"
|
||||
# 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
|
||||
log_message "No last build timestamp found at ${LAST_BUILD_TIMESTAMP_FILE}. Triggering initial rebuild."
|
||||
NEEDS_REBUILD=true
|
||||
else
|
||||
if find "$OBSIDIAN_CONTENT_SOURCE" -type f -newer "$LAST_BUILD_TIMESTAMP_FILE" -print -quit | grep -q .; then
|
||||
log_message "Changes detected in Obsidian content. Triggering rebuild."
|
||||
NEEDS_REBUILD=true
|
||||
else
|
||||
log_message "No changes detected in Obsidian content since last build."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user