|
| 1 | +{{/* Enhanced JSON-LD that auto-generates from Hugo content and page data using jsonify to ensure valid JSON */}} |
| 2 | +{{- $graph := slice -}} |
| 3 | + |
| 4 | +{{- /* Organization */ -}} |
| 5 | +{{- $org := dict |
| 6 | + "@type" "Organization" |
| 7 | + "@id" (print .Site.BaseURL "#organization") |
| 8 | + "name" .Site.Title |
| 9 | + "url" .Site.BaseURL |
| 10 | + "logo" (dict "@type" "ImageObject" "url" (print .Site.BaseURL "images/IconCodefrydev.svg") "width" 96 "height" 96) |
| 11 | + "description" .Site.Params.description |
| 12 | + "foundingDate" "2023" |
| 13 | + "founder" (dict "@type" "Person" "name" .Site.Author.name) |
| 14 | + "sameAs" (slice "https://github.com/codefrydev" "https://play.google.com/store/apps/developer?id=CodeFryDev") |
| 15 | + "contactPoint" (dict "@type" "ContactPoint" "contactType" "customer service" "url" (print .Site.BaseURL "about")) |
| 16 | + "areaServed" "Worldwide" |
| 17 | + "knowsAbout" (slice "Web Development" "Mobile App Development" "Game Development" "AI Tools" "Creative Design" "Productivity Tools") |
| 18 | +-}} |
| 19 | +{{- $graph = $graph | append $org -}} |
| 20 | + |
| 21 | +{{- /* Website */ -}} |
| 22 | +{{- $website := dict |
| 23 | + "@type" "WebSite" |
| 24 | + "@id" (print .Site.BaseURL "#website") |
| 25 | + "name" .Site.Title |
| 26 | + "url" .Site.BaseURL |
| 27 | + "description" .Site.Params.description |
| 28 | + "publisher" (dict "@id" (print .Site.BaseURL "#organization")) |
| 29 | + "potentialAction" (dict "@type" "SearchAction" "target" (dict "@type" "EntryPoint" "urlTemplate" (print .Site.BaseURL "search?q={search_term_string}")) "query-input" "required name=search_term_string") |
| 30 | + "inLanguage" (.Site.LanguageCode | default "en-us") |
| 31 | + "copyrightYear" (now.Format "2006") |
| 32 | + "copyrightHolder" (dict "@id" (print .Site.BaseURL "#organization")) |
| 33 | +-}} |
| 34 | +{{- $graph = $graph | append $website -}} |
| 35 | + |
| 36 | +{{- /* FAQ */ -}} |
| 37 | +{{- $faqItems := slice -}} |
| 38 | +{{- range .Site.Data.faq.faqs -}} |
| 39 | + {{- $faqItems = $faqItems | append (dict "@type" "Question" "name" .question "acceptedAnswer" (dict "@type" "Answer" "text" .answer)) -}} |
| 40 | +{{- end -}} |
| 41 | +{{- $faq := dict "@type" "FAQPage" "mainEntity" $faqItems -}} |
| 42 | +{{- $graph = $graph | append $faq -}} |
| 43 | + |
| 44 | +{{- /* Home ItemList */ -}} |
| 45 | +{{- if .IsHome -}} |
| 46 | + {{- $homeLists := slice -}} |
| 47 | + {{- range .Site.Data.home.categories -}} |
| 48 | + {{- $catName := .name -}} |
| 49 | + {{- $items := slice -}} |
| 50 | + {{- range $idx, $it := .items -}} |
| 51 | + {{- $items = $items | append (dict "@type" "ListItem" "position" (add $idx 1) "item" (dict "@type" "WebApplication" "name" $it.name "url" ($it.url | absURL) "description" (print $it.name " - " $catName " tool by CodeFryDev") "applicationCategory" $catName "operatingSystem" "Web Browser" "offers" (dict "@type" "Offer" "price" "0" "priceCurrency" "USD" "availability" "https://schema.org/InStock") "publisher" (dict "@id" (print $.Site.BaseURL "#organization")))) -}} |
| 52 | + {{- end -}} |
| 53 | + {{- $homeLists = $homeLists | append (dict "@type" "ItemList" "name" .name "description" (print .name " tools and resources") "numberOfItems" (len .items) "itemListElement" $items) -}} |
| 54 | + {{- end -}} |
| 55 | + {{- $home := dict "@type" "ItemList" "name" "CodeFryDev Tools and Games Collection" "description" "Complete collection of creative tools, games, and utilities" "url" .Site.BaseURL "numberOfItems" (len .Site.Data.home.categories) "itemListElement" $homeLists -}} |
| 56 | + {{- $graph = $graph | append $home -}} |
| 57 | +{{- end -}} |
| 58 | + |
| 59 | +{{- /* Games page */ -}} |
| 60 | +{{- if eq .Section "games" -}} |
| 61 | + {{- $gameItems := slice -}} |
| 62 | + {{- range $idx, $g := .Site.Data.games.data -}} |
| 63 | + {{- $gameItems = $gameItems | append (dict "@type" "ListItem" "position" (add $idx 1) "item" (dict "@type" "VideoGame" "name" $g.name "url" ($g.url | absURL) "description" (print $g.name " - A fun game by CodeFryDev") "genre" "Casual Game" "gamePlatform" "Web Browser" "operatingSystem" "Any" "applicationCategory" "Game" "offers" (dict "@type" "Offer" "price" "0" "priceCurrency" "USD" "availability" "https://schema.org/InStock") "publisher" (dict "@id" (print $.Site.BaseURL "#organization")))) -}} |
| 64 | + {{- end -}} |
| 65 | + {{- $games := dict "@type" "ItemList" "name" "CodeFryDev Games Collection" "description" "Collection of fun and engaging games developed by CodeFryDev" "url" .Permalink "numberOfItems" (len .Site.Data.games.data) "itemListElement" $gameItems -}} |
| 66 | + {{- $graph = $graph | append $games -}} |
| 67 | +{{- end -}} |
| 68 | + |
| 69 | +{{- /* AI page */ -}} |
| 70 | +{{- if eq .Section "ai" -}} |
| 71 | + {{- $toolItems := slice -}} |
| 72 | + {{- range $idx, $t := .Site.Data.ai.data -}} |
| 73 | + {{- $toolItems = $toolItems | append (dict "@type" "ListItem" "position" (add $idx 1) "item" (dict "@type" "SoftwareApplication" "name" $t.name "url" ($t.url | absURL) "description" (print $t.name " - AI-powered tool by CodeFryDev") "applicationCategory" "AI Tool" "operatingSystem" "Web Browser" "softwareVersion" "1.0" "offers" (dict "@type" "Offer" "price" "0" "priceCurrency" "USD" "availability" "https://schema.org/InStock") "publisher" (dict "@id" (print $.Site.BaseURL "#organization")) "featureList" (slice "AI-powered functionality" "Easy to use interface" "No installation required" "Cross-platform compatibility"))) -}} |
| 74 | + {{- end -}} |
| 75 | + {{- $ai := dict "@type" "ItemList" "name" "CodeFryDev AI Tools Collection" "description" "Collection of AI-powered tools and utilities for productivity and creativity" "url" .Permalink "numberOfItems" (len .Site.Data.ai.data) "itemListElement" $toolItems -}} |
| 76 | + {{- $graph = $graph | append $ai -}} |
| 77 | +{{- end -}} |
| 78 | + |
| 79 | +{{- /* About page */ -}} |
| 80 | +{{- if eq .Section "about" -}} |
| 81 | + {{- $about := dict "@type" "AboutPage" "name" .Title "description" (.Description | default "Learn more about CodeFryDev and our mission") "url" .Permalink "mainEntity" (dict "@id" (print .Site.BaseURL "#organization")) "breadcrumb" (dict "@type" "BreadcrumbList" "itemListElement" (slice (dict "@type" "ListItem" "position" 1 "name" "Home" "item" .Site.BaseURL) (dict "@type" "ListItem" "position" 2 "name" "About" "item" .Permalink))) -}} |
| 82 | + {{- $graph = $graph | append $about -}} |
| 83 | +{{- end -}} |
| 84 | + |
| 85 | +{{- /* Store page */ -}} |
| 86 | +{{- if eq .Section "store" -}} |
| 87 | + {{- $store := dict "@type" "Store" "name" "CodeFryDev Store" "description" "Official store for CodeFryDev products and applications" "url" .Permalink "seller" (dict "@id" (print .Site.BaseURL "#organization")) "paymentAccepted" "Free" "currenciesAccepted" "USD" -}} |
| 88 | + {{- $graph = $graph | append $store -}} |
| 89 | +{{- end -}} |
| 90 | + |
| 91 | +{{- /* Breadcrumb for all non-home pages */ -}} |
| 92 | +{{- if not .IsHome -}} |
| 93 | + {{- $crumbs := slice (dict "@type" "ListItem" "position" 1 "name" "Home" "item" .Site.BaseURL) -}} |
| 94 | + {{- if .Section -}} |
| 95 | + {{- $crumbs = $crumbs | append (dict "@type" "ListItem" "position" 2 "name" (.Section | title) "item" (print .Site.BaseURL .Section "/")) -}} |
| 96 | + {{- end -}} |
| 97 | + {{- if .Title -}} |
| 98 | + {{- $crumbs = $crumbs | append (dict "@type" "ListItem" "position" (cond (ne .Section "") 3 2) "name" .Title "item" .Permalink) -}} |
| 99 | + {{- end -}} |
| 100 | + {{- $breadcrumb := dict "@type" "BreadcrumbList" "itemListElement" $crumbs -}} |
| 101 | + {{- $graph = $graph | append $breadcrumb -}} |
| 102 | +{{- end -}} |
| 103 | + |
| 104 | +<script type="application/ld+json"> |
| 105 | +{{ dict "@context" "https://schema.org" "@graph" $graph | jsonify | safeJS }} |
| 106 | +</script> |
0 commit comments