#!/bin/bash
# ==========================================================
# Sngine v3.11.1 - REAL Header Update (Bhaskar-style)
# Yeh script "_header.tpl" (jo login + guest dono ko milta hai)
# ko Bhaskar jaisa banata hai - custom logo + nav icons.
#
# IMPORTANT: Yeh tumhari ASLI "_header.tpl" ko OVERWRITE karega.
# Yeh script khud pehle ek .backup file bana deta hai.
#
# Usage:
# cd /path/to/your/sngine
# bash update_header.sh
# ==========================================================
set -e
TARGET="content/themes/default/templates/_header.tpl" if [ ! -f "$TARGET" ]; then
echo "ERROR: $TARGET nahi mila. Sngine root folder mein script chalao."
exit 1
fi
echo "Backing up original _header.tpl -> _header.tpl.backup"
cp "$TARGET" "$TARGET.backup"
echo "Writing new _header.tpl ..."
cat > "$TARGET" << 'EOF_HEADERTPL'
EOF_HEADERTPL
echo "Writing content/themes/default/css/header-custom.css ..."
mkdir -p content/themes/default/css
cat > content/themes/default/css/header-custom.css << 'EOF_HEADERCSS' /**
* Path: content/themes/default/css/header-custom.css
*
* Yeh file "_head.tpl" mein "style.css" ke just neeche load karni hai:
*
*
* Yeh "_header.tpl" (asli Sngine header - login aur guest dono ko milta hai)
* ke custom logo aur Bhaskar-jaise nav icons ko style karta hai.
*/
/* ===== CUSTOM LOGO ===== */
.news-custom-logo {
display: flex;
align-items: center;
gap: 6px;
text-decoration: none;
}
.news-logo-sun {
color: #ff8c00;
font-size: 22px;
line-height: 1;
}
.news-logo-text {
font-size: 24px;
font-weight: 900;
color: #1a1a1a;
letter-spacing: -0.5px;
}
.news-logo-accent {
color: #d32f2f;
}
/* night mode ke liye text color fix */
.night-mode .news-logo-text {
color: #fff;
}
/* ===== COMMON NAV ICONS (Home/Video/Search/Watch/Web Stories/E-Paper) ===== */
.navbar-wrapper ul {
display: flex;
align-items: center;
list-style: none;
}
.news-nav-link {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 0 12px;
text-decoration: none;
color: #333;
font-size: 12px;
font-weight: 600;
}
.news-nav-link:hover {
color: #d32f2f;
}
.news-nav-link .header-icon {
font-size: 20px;
}
.night-mode .news-nav-link {
color: #ddd;
}
.night-mode .news-nav-link:hover {
color: #ff8c00;
}
/* responsive: chhoti screen par sirf icon row scrollable rahe */
@media (max-width: 1199px) {
.news-nav-link span { display: none; }
}
EOF_HEADERCSS
echo ""
echo "=========================================================="
echo "DONE!"
echo " content/themes/default/templates/_header.tpl (UPDATED)"
echo " content/themes/default/templates/_header.tpl.backup (purani file ka backup)"
echo " content/themes/default/css/header-custom.css (naya)"
echo ""
echo "1 MANUAL STEP zaroori hai:"
echo "content/themes/default/templates/_head.tpl kholo,"
echo "jahan 'style.css' load hoti hai (line ~52), uske neeche ye daalo:"
echo ""
echo '
' echo ""
echo "Fir koi bhi page kholo (login ya guest, dono mein) - naya"
echo "logo + Home/Video/Search/Watch/Web Stories/E-Paper icons dikhenge."
echo ""
echo "Agar revert karna ho:"
echo " cp content/themes/default/templates/_header.tpl.backup content/themes/default/templates/_header.tpl"
echo "=========================================================="