#!/usr/bin/env python3 """Static site generator for bestdadjokes.lol. Python 3.6 stdlib only.""" import json, os, re, shutil, html, datetime ROOT = os.path.dirname(os.path.abspath(__file__)) CONTENT = os.path.join(ROOT, 'content', 'jokes.json') SITE_DIR = os.path.join(ROOT, 'site') STATIC = os.path.join(ROOT, 'static') SITE_URL = 'https://bestdadjokes.lol' SITE_NAME = 'Best Dad Jokes' TAGLINE = 'The best dad jokes on the internet โ short, clean, and groan-worthy.' YEAR = datetime.date.today().year with open(CONTENT) as f: DATA = json.load(f) CATS = DATA['categories'] JOKES = DATA['jokes'] CAT_BY_SLUG = {c['slug']: c for c in CATS} for i, j in enumerate(JOKES): j['id'] = i # Long-tail topic pages: jokes matched by keyword across all categories. TOPICS = [ {"slug": "coffee", "name": "Dad Jokes About Coffee", "emoji": "โ", "intro": "Fuel for dads and their worst puns alike. These coffee dad jokes are best served strong, black, and with a healthy amount of eye-rolling.", "keywords": r"\b(coffee|espresso|latte|caffeine|beans?|mugs?)\b"}, {"slug": "cats", "name": "Dad Jokes About Cats", "emoji": "๐ฑ", "intro": "For the cat dads out there. These cat dad jokes will make your feline walk out of the room in disgust โ which, for a cat, is a standing ovation.", "keywords": r"\b(cats?|kittens?|purr|feline|meow)\b"}, {"slug": "dogs", "name": "Dad Jokes About Dogs", "emoji": "๐", "intro": "A dog is the only audience that wags at dad jokes. Fetch! These dog dad jokes are good boys, every one of them.", "keywords": r"\b(dogs?|puppy|puppies|pup|hound)\b"}, {"slug": "cows", "name": "Dad Jokes About Cows", "emoji": "๐", "intro": "Outstanding in their field and in our pun archive. These cow dad jokes are udderly relentless.", "keywords": r"\b(cows?|cattle|moo|udder|beef|herd)\b"}, {"slug": "pizza", "name": "Dad Jokes About Pizza", "emoji": "๐", "intro": "A slice of comedy gold. These pizza dad jokes are cheesy by design โ that's not a bug, it's the whole point.", "keywords": r"\bpizzas?\b"}, {"slug": "money", "name": "Dad Jokes About Money", "emoji": "๐ฐ", "intro": "Money can't buy happiness, but it can buy these money dad jokes, which are basically the same thing but cheaper.", "keywords": r"\b(money|cash|coins?|dollars?|penn(y|ies)|bank|rich|spen[dt]|salary)\b"}, {"slug": "sleep", "name": "Dad Jokes About Sleep", "emoji": "๐ด", "intro": "Read these sleep dad jokes in bed. Groaning yourself to sleep counts as a lullaby.", "keywords": r"\b(sleep|nap|bed|pillow|blanket|tired|asleep|dream)\b"}, {"slug": "love", "name": "Dad Jokes About Love", "emoji": "โค๏ธ", "intro": "Romance, dad-style. These love dad jokes have walked someone down the aisle against their will and lived to pun about it.", "keywords": r"\b(love|romantic|valentine|marri(ed|age)|attract|wife|husband|buoy)\b"}, {"slug": "birthday", "name": "Birthday Dad Jokes", "emoji": "๐", "intro": "Because every birthday needs at least one groan with the cake. These birthday dad jokes are tradition now, sorry.", "keywords": r"\b(birthday|cake|candles?|party|presents?)\b"}, {"slug": "winter", "name": "Winter Dad Jokes", "emoji": "โ", "intro": "These winter dad jokes are snow joke. Perfect for breaking the ice at any cold-weather gathering.", "keywords": r"\b(winter|snow|snowman|ic(y|icle)|frost|chill)\b"}, {"slug": "school", "name": "Dad Jokes About School", "emoji": "\U0001F392", "intro": "Class clown certified jokes for teachers, students, and anyone who survived homework. These school dad jokes will get you a passing grade in groans.", "keywords": r"\b(school|teacher|class|student|homework|math|book|read|study)\b"}, {"slug": "cars", "name": "Dad Jokes About Cars", "emoji": "๐", "intro": "Drive everyone up the wall during your next road trip. These car dad jokes are strictly automatic when it comes to terrible punchlines.", "keywords": r"\b(car|drive|road|truck|tire|wheel|traffic)\b"}, {"slug": "teacher", "name": "Dad Jokes About Teachers", "emoji": "๐", "intro": "Grade A puns that will get you sent to the principal's office. These teacher dad jokes are strictly for extra credit.", "keywords": r"\b(teacher|teachers|teach|principal)\b"}, {"slug": "computer", "name": "Dad Jokes About Computers", "emoji": "๐ป", "intro": "Hard drive full of jokes? Boot up these tech puns. These computer dad jokes are guaranteed to crash your family dinner.", "keywords": r"\b(computer|computers|laptop|pc|keyboard|mouse)\b"}, {"slug": "snowman", "name": "Dad Jokes About Snowmen", "emoji": "โ๏ธ", "intro": "Frosty reception guaranteed. These snowman dad jokes are stone cold classics that will melt your heart (and your patience).", "keywords": r"\b(snowman|snowmen|frosty)\b"}, {"slug": "ocean", "name": "Dad Jokes About the Ocean", "emoji": "๐", "intro": "Water you waiting for? Dive into these shore-fire maritime puns. These ocean dad jokes will make waves at any beach party.", "keywords": r"\b(ocean|sea|beach|water|tides?|waves?|boat|ship|sail|sand|sharks?|fish)\b"}, {"slug": "moon", "name": "Dad Jokes About the Moon", "emoji": "๐", "intro": "These jokes are out of this world! Get ready for some stellar dad jokes about the moon.", "keywords": r"\b(moon|space|stars?|planet)\b"}, {"slug": "vacation", "name": "Dad Jokes About Vacation", "emoji": "๐๏ธ", "intro": "Time to pack your bags and your best puns! These dad jokes about vacation will have you laughing all the way to your destination.", "keywords": r"\b(vacation|trip|travel|holiday|packing)\b"}, {"slug": "work", "name": "Dad Jokes About Work", "emoji": "๐ข", "intro": "Don't work too hard... unless it's working on your punchlines. These dad jokes about work are perfect for the water cooler.", "keywords": r"\b(work|office|job|boss|meeting)\b"}, {"slug": "kids", "name": "Dad Jokes About Kids", "emoji": "๐ถ", "intro": "They grow up so fast, but these jokes never get old. Here are the best dad jokes about kids.", "keywords": r"\b(kid|child|children|son|daughter)\b"}, {"slug": "food", "name": "Dad Jokes About Food", "emoji": "๐", "intro": "Hungry for a laugh? These dad jokes about food will hit the spot.", "keywords": r"\b(food|eat|dinner|lunch|breakfast|hungry|pizza|coffee|cheese|lettuce)\b"}, {"slug": "animals", "name": "Dad Jokes About Animals", "emoji": "๐", "intro": "Lions, tigers, and puns - oh my! Enjoy these wild dad jokes about animals.", "keywords": r"\b(animal|animals|dog|cat|fish|bird|bear|horse|cows?|deer)\b"}, {"slug": "music", "name": "Dad Jokes About Music", "emoji": "๐ต", "intro": "Strike a chord with these dad jokes about music. They are sure to be a hit.", "keywords": r"\b(music|song|sing|band|guitar|piano|drum|notes?)\b"}, {"slug": "clothing", "name": "Dad Jokes About Clothing", "emoji": "๐", "intro": "You will look stylish telling these dad jokes about clothing.", "keywords": r"\b(clothes|shirt|pants|shoes|hat|wear|socks?|tie|suit)\b"}, {"slug": "space", "name": "Dad Jokes About Space", "emoji": "๐", "intro": "These space dad jokes are out of this world.", "keywords": r"\b(space|astronauts?|planets?|moon|sun|stars|aliens?)\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"} ] MIN_TOPIC_JOKES = 5 def esc(s): return html.escape(s, quote=True) def joke_count(slug): return sum(1 for j in JOKES if j['cat'] == slug) def json_ld_script(obj): """Serialize structured data cleanly without HTML escaping quotes.""" return '' % json.dumps(obj, ensure_ascii=False).replace('', r'<\/') def joke_card(j, reveal=False): """A single joke card. Punchline is in the DOM (SEO-safe); JS blurs until clicked.""" cls = 'joke-card' if j.get('type') == 'knock': body = '
%s
' % esc(j['setup']).replace('\n', '%s
' % esc(j['setup']) punch = 'Short. Clean. Painfully punny. {len(JOKES)}+ jokes your kids don't want to hear but absolutely need to.
{esc(rnd['setup'])}
A dad joke is a short, clean, pun-based joke delivered with maximum confidence and zero shame. It's the kind of joke that makes your kids groan, your wife roll her eyes, and your dog leave the room. Science has yet to explain why hearing one makes you feel briefly smarter and visibly worse at the same time.
This site is a growing collection of the best dad jokes on the internet: one-liners, knock-knock jokes, and puns about animals, food, work, school, sports, tech, space and more. Every joke is family-friendly โ the only thing at risk of injury is everyone's patience. Start with the dad joke generator, browse the categories, or come back every day for a new dad joke of the day.
{esc(c['blurb'])} That's {len(js)} jokes of pure dad energy.
{esc(t['intro'])} That's {len(js)} of them, carefully curated for maximum groan.
One click. One random dad joke. Zero apologies. Works at parties, in the car line, and mid-argument.
Click the button to summon a dad joke.
Looking for something specific? Search all dad jokes or browse by category.
A brand-new dad joke every single day. Doctors recommend exactly one per day. We won't tell if you don't.
Every recent dad joke of the day, one per day, no repeats (for a few months, anyway):
Looking for a dad joke about coffee, cats, or cardio? Type it in. We probably have a pun for that.
Welcome to BestDadJokes.lol โ a growing collection of the internet's best dad jokes: short, clean, pun-heavy, and delivered with the quiet confidence only a dad can muster.
The mission is simple: build the most useful dad joke resource on the internet. That means:
Because a dad joke is never just a joke. It's a love language. It's saying "I would rather embarrass myself than miss a chance to make you laugh." Also, they're free, and this is a budget operation.
Got a joke that deserves to be here? Found a bug? Want to license 300 dad jokes for your family group chat? Head to the contact page.
Want to send us the greatest dad joke of all time? Report a joke that's more "dad" than "joke"? Tell us the site made you laugh so hard you spilled your coffee? We read everything.
Email us at hello@bestdadjokes.lol โ responses may be delayed by naps.
Include the setup and the punchline in your email. If we use it, you get full bragging rights and absolutely no money, which is exactly how dad economics works.
Last updated: %s
BestDadJokes.lol respects your privacy, which is ironic because dads famously respect nothing more than a good interruption. Here's the deal in plain English:
We keep standard web server logs (IP address, browser type, pages visited) for security and aggregate traffic statistics. We do not ask for your name, email, or your kids' report cards. There are no accounts on this site.
We may display advertising on this site to keep it free. Advertising partners, which may include Google, use cookies and similar technologies to serve ads based on your prior visits to this and other websites.
Google's use of advertising cookies enables it and its partners to serve ads based on your visits to this site and/or other sites on the Internet. You may opt out of personalized advertising by visiting Google Ads Settings, or opt out of third-party vendor cookies at aboutads.info.
If we run a consent banner for visitors from the EEA/UK, your choices will be honored and stored locally.
We use aggregate, privacy-respecting analytics to count page views and understand which categories people enjoy. This data cannot reasonably be used to identify you.
We do not sell personal data. We have no personal data to sell. We barely have data.
Content on this site is family-friendly by design. The site is not directed at children under 13, and we do not knowingly collect personal information from children.
Questions about this policy? Email hello@bestdadjokes.lol.
Last updated: %s
By using BestDadJokes.lol you agree to the following terms. Reading them aloud in a dad voice is optional but encouraged.
The jokes on this site are provided for personal, non-commercial enjoyment. Share them freely at dinner tables, offices, and group chats. If you want to republish jokes in bulk or use this site commercially, contact us first โ we're reasonable people.
This site is provided "as is." We make no guarantees that jokes will be funny, that groans will be produced, or that your teenagers will acknowledge your existence. All comedic risk is yours.
To the fullest extent permitted by law, BestDadJokes.lol is not liable for any damages arising from use of the site, including but not limited to eye-rolling, sighing, involuntary chuckling, and children hiding your phone.
We are not responsible for the content of external websites, including their jokes, which are almost certainly worse than ours.
We may update these terms occasionally. Continued use of the site means you accept the updated terms, and possibly a fresh dad joke.
This page is like a dad joke that got cut from the site โ it just didn't land.
Why did the web page go to therapy?