added quartz external wiki
This commit is contained in:
@@ -24,19 +24,48 @@ cp -r /app/content/* /app/quartz-repo/content/ 2>/dev/null || true
|
||||
echo "Building Quartz site..."
|
||||
cd /app/quartz-repo
|
||||
|
||||
# Build the site with default Quartz setup
|
||||
npx quartz build 2>&1 || {
|
||||
echo "Default Quartz build failed, trying alternative method..."
|
||||
# Try building with explicit paths
|
||||
npx quartz build --contentDir ./content --outputDir /app/public 2>&1 || {
|
||||
echo "Default build also failed, creating fallback static site..."
|
||||
|
||||
# Create fallback static site
|
||||
mkdir -p /app/public
|
||||
cd /app/content
|
||||
|
||||
# Create index.html
|
||||
cat > /app/public/index.html << 'EOFHTML'
|
||||
# Check if Quartz CLI exists and try different methods
|
||||
QUARTZ_CLI="/app/quartz-repo/node_modules/@jackyzha0/quartz/cli/index.js"
|
||||
QUARTZ_BUILD_SUCCESS=false
|
||||
|
||||
# Method 1: Direct node call to Quartz CLI (avoids npx BusyBox issue)
|
||||
if [ -f "$QUARTZ_CLI" ]; then
|
||||
echo "Trying direct node call to Quartz CLI..."
|
||||
if node "$QUARTZ_CLI" build --contentDir ./content --outputDir /app/public 2>&1; then
|
||||
QUARTZ_BUILD_SUCCESS=true
|
||||
echo "Quartz build successful!"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Method 2: Try using npm run script
|
||||
if [ "$QUARTZ_BUILD_SUCCESS" = false ] && [ -f "package.json" ]; then
|
||||
echo "Trying npm run build..."
|
||||
if npm run build 2>&1; then
|
||||
QUARTZ_BUILD_SUCCESS=true
|
||||
echo "Quartz build successful via npm!"
|
||||
# Copy output if it went to default location
|
||||
if [ -d "./public" ] && [ -n "$(ls -A ./public 2>/dev/null)" ]; then
|
||||
cp -r ./public/* /app/public/ 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# If Quartz build succeeded, copy output
|
||||
if [ "$QUARTZ_BUILD_SUCCESS" = true ]; then
|
||||
if [ -d "/app/quartz-repo/public" ] && [ -n "$(ls -A /app/quartz-repo/public 2>/dev/null)" ]; then
|
||||
echo "Copying Quartz output to public directory..."
|
||||
cp -r /app/quartz-repo/public/* /app/public/ 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# If build failed, create fallback static site
|
||||
if [ "$QUARTZ_BUILD_SUCCESS" = false ]; then
|
||||
echo "Quartz build failed, creating fallback static site..."
|
||||
mkdir -p /app/public
|
||||
cd /app/content
|
||||
|
||||
# Create index.html
|
||||
cat > /app/public/index.html << 'EOFHTML'
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
@@ -94,12 +123,6 @@ npx quartz build 2>&1 || {
|
||||
color: #d4d4d4;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.content-preview {
|
||||
background: #1c1c1e;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -110,27 +133,24 @@ npx quartz build 2>&1 || {
|
||||
<ul id="content-list">
|
||||
EOFHTML
|
||||
|
||||
# Find all markdown files and create links
|
||||
# Find all markdown files and create links
|
||||
if [ -n "$(find /app/content -name "*.md" -type f 2>/dev/null)" ]; then
|
||||
find /app/content -name "*.md" -type f | while read file; do
|
||||
title=$(basename "$file" .md)
|
||||
relative_path=$(echo "$file" | sed "s|/app/content/||")
|
||||
echo " <li><a href=\"/$relative_path\">$title</a></li>" >> /app/public/index.html
|
||||
done
|
||||
|
||||
echo " </ul>" >> /app/public/index.html
|
||||
echo " </div>" >> /app/public/index.html
|
||||
echo "</body>" >> /app/public/index.html
|
||||
echo "</html>" >> /app/public/index.html
|
||||
|
||||
# Copy markdown files to public
|
||||
cp -r /app/content/* /app/public/ 2>/dev/null || true
|
||||
}
|
||||
}
|
||||
|
||||
# If Quartz build succeeded, check if public directory exists
|
||||
if [ -d "/app/quartz-repo/public" ] && [ -n "$(ls -A /app/quartz-repo/public 2>/dev/null)" ]; then
|
||||
echo "Copying Quartz output to public directory..."
|
||||
cp -r /app/quartz-repo/public/* /app/public/ 2>/dev/null || true
|
||||
else
|
||||
echo " <li><em>Keine Inhalte gefunden</em></li>" >> /app/public/index.html
|
||||
fi
|
||||
|
||||
echo " </ul>" >> /app/public/index.html
|
||||
echo " </div>" >> /app/public/index.html
|
||||
echo "</body>" >> /app/public/index.html
|
||||
echo "</html>" >> /app/public/index.html
|
||||
|
||||
# Copy markdown files to public
|
||||
cp -r /app/content/* /app/public/ 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Ensure public directory exists
|
||||
|
||||
2
quartz-setup/public/Doing IT!.md
Executable file
2
quartz-setup/public/Doing IT!.md
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
This Knowledge Database is about to get greatly organized and will grow soon for you!
|
||||
5
quartz-setup/public/Test Note linked.md
Executable file
5
quartz-setup/public/Test Note linked.md
Executable file
@@ -0,0 +1,5 @@
|
||||
|
||||
this note is linked to a test note :D
|
||||
|
||||
[[Welcome]]
|
||||
|
||||
5
quartz-setup/public/Welcome.md
Executable file
5
quartz-setup/public/Welcome.md
Executable file
@@ -0,0 +1,5 @@
|
||||
This is your new *vault*.
|
||||
|
||||
Make a note of something, [[create a link]], or try [the Importer](https://help.obsidian.md/Plugins/Importer)!
|
||||
|
||||
When you're ready, delete this note and make the vault your own.
|
||||
@@ -55,12 +55,6 @@
|
||||
color: #d4d4d4;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.content-preview {
|
||||
background: #1c1c1e;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -69,10 +63,13 @@
|
||||
<p class="intro">Willkommen im doing-it Wiki! Hier finden Sie nützliche Informationen rund um IT-Weiterbildung und Schulungen.</p>
|
||||
<h2>Inhalte</h2>
|
||||
<ul id="content-list">
|
||||
<li><a href="/Doing IT!.md">Doing IT!</a></li>
|
||||
<li><a href="/Home.md">Home</a></li>
|
||||
<li><a href="/IT-Grundlagen.md">IT-Grundlagen</a></li>
|
||||
<li><a href="/Ressourcen.md">Ressourcen</a></li>
|
||||
<li><a href="/Schulungsmethoden.md">Schulungsmethoden</a></li>
|
||||
<li><a href="/Test Note linked.md">Test Note linked</a></li>
|
||||
<li><a href="/Welcome.md">Welcome</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user