mirror of
http://nostr-git-proxy.forgejo.svc.cluster.local/git/45387ca441053e230b2126802005eb03767ab59d84555e8bac86b6e7def14e27/bestdadjokes
synced 2026-11-03 07:26:59 +00:00
feat(seo): target long-tail, optimize CTR and sitemap
This commit is contained in:
parent
1fb711c4c5
commit
67add2a5dc
1 changed files with 20 additions and 9 deletions
29
build.py
29
build.py
|
|
@ -106,6 +106,13 @@ TOPICS = [
|
|||
{"slug": "work-dad-jokes", "name": "Work Dad Jokes", "emoji": "🏢",
|
||||
"intro": "Break the ice at your next meeting with clean office dad jokes. Workplace-safe humor, corporate puns, and harmless water cooler groaners.",
|
||||
"keywords": r"\b(work|office|job|boss|meeting|employee|coworker|business|company|career)\b"},
|
||||
|
||||
{"slug": "software-engineers", "name": "Dad Jokes About Software Engineers", "emoji": "💻",
|
||||
"intro": "Did you hear about the programmer who got locked out of their house? They lost their keys! These software engineer dad jokes are fully debugged and ready to compile into instant groans.",
|
||||
"keywords": r"\b(software|engineer|code|coding|programmer|dev|developer|bug|python|java|html|internet|wifi|tech)\b"},
|
||||
{"slug": "clean-dad-jokes-for-5-year-olds", "name": "Clean Dad Jokes for 5 Year Olds", "emoji": "👧",
|
||||
"intro": "Why did the toddler cross the playground? To get to the other slide! These clean dad jokes for 5-year-olds are kindergarten-approved and perfectly tailored for the juice-box crowd.",
|
||||
"keywords": r"\b(kid|child|children|kindergarten|toddler|play|preschool|toy|five|5)\b"},
|
||||
{"slug": "eyes", "name": "Dad Jokes About Eyes", "emoji": "👀",
|
||||
"intro": "Eye see what you did there! These dad jokes about eyes are a sight for sore... well, you know.",
|
||||
"keywords": r"\b(eyes?|see|sight|glasses|vision)\b"}
|
||||
|
|
@ -547,10 +554,10 @@ def page_category(slug):
|
|||
<div class="chips">{others_html}</div>
|
||||
<p class="center-link"><a class="btn" href="/dad-joke-generator/">🎲 Random Dad Joke Generator</a></p>
|
||||
</div>"""
|
||||
title = '%d+ Best %s (Clean Puns & Groaners for Kids & Family)' % (len(js), c['name'])
|
||||
desc = '%s Browse %d clean, funny %s for instant groans.' % (c['blurb'], len(js), c['name'].lower())
|
||||
title = '%d+ Unbeatable %s - Try Not To Laugh (Or Groan)' % (len(js), c['name'])
|
||||
desc = '%s Read our ultimate collection of %d %s - 100%% clean and painfully funny.' % (c['blurb'], len(js), c['name'].lower())
|
||||
if len(desc) > 155:
|
||||
desc = '%s %d clean, funny %s.' % (c['blurb'], len(js), c['name'].lower())
|
||||
desc = '%s %d clean %s.' % (c['blurb'], len(js), c['name'].lower())
|
||||
if len(desc) > 155:
|
||||
desc = desc[:152] + '...'
|
||||
|
||||
|
|
@ -598,9 +605,9 @@ def page_topic(slug):
|
|||
<div class="chips">{chips}</div>
|
||||
<p class="center-link"><a class="btn" href="/dad-joke-generator/">🎲 Random Dad Joke Generator</a></p>
|
||||
</div>"""
|
||||
title = '%d+ Best %s (Clean Puns & Groaners for Kids & Family)' % (len(js), t['name'])
|
||||
desc = t['intro']
|
||||
suffix = ' Browse %d clean, funny jokes.' % len(js)
|
||||
title = '%d+ Hilarious %s - Perfect for Groans & Laughs' % (len(js), t['name'])
|
||||
desc = 'Looking for %s? %s Guaranteed to make anyone roll their eyes. Read %d completely clean jokes now.' % (t['name'].lower(), t['intro'], len(js))
|
||||
suffix = ''
|
||||
if len(desc + suffix) <= 155:
|
||||
desc = desc + suffix
|
||||
elif len(desc) > 155:
|
||||
|
|
@ -676,8 +683,10 @@ def page_joke(j):
|
|||
<button class="btn btn-ghost" data-jod-share>🖼️ Share as image</button>
|
||||
</div>
|
||||
</div>
|
||||
<h2>More {esc(cat['name'])}</h2>
|
||||
<p class="center-link"><a class="btn" href="/category/{j['cat']}/">Browse all {esc(cat['name'])} →</a></p>
|
||||
<h2>You Might Also Suffer From...</h2>
|
||||
<p class="center-link"><a class="btn" href="/category/{j['cat']}/">More {esc(cat['name'])} →</a></p>
|
||||
<p class="center-link"><a class="btn btn-ghost" href="/dad-joke-generator/">Keep groaning (Random Joke) →</a></p>
|
||||
<p class="center-link"><a class="btn btn-ghost" href="/joke-of-the-day/">Joke of the Day →</a></p>
|
||||
</div>"""
|
||||
title = '%s - Funny Dad Joke' % esc(j['setup'])
|
||||
if len(title) > 60:
|
||||
|
|
@ -977,8 +986,10 @@ Best Dad Jokes provides over 430 hand-curated, school-safe dad jokes, puns, and
|
|||
sm = ['<?xml version="1.0" encoding="UTF-8"?>',
|
||||
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">']
|
||||
for p in pages:
|
||||
freq = 'weekly' if p == '/' or '/topic/' in p or '/category/' in p else 'monthly'
|
||||
pri = '1.0' if p == '/' else '0.9' if '/topic/' in p or '/category/' in p else '0.7'
|
||||
sm.append('<url><loc>%s%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%s</priority></url>'
|
||||
% (SITE_URL, p, today, 'weekly' if p == '/' else 'monthly', '1.0' if p == '/' else '0.8'))
|
||||
% (SITE_URL, p, today, freq, pri))
|
||||
sm.append('</urlset>')
|
||||
write('sitemap.xml', '\n'.join(sm) + '\n')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue