From e9493498a24461bc554cb0302a44207458ef0f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 28 Jun 2021 11:19:38 +0200 Subject: [PATCH] Refactor --- ...githubrepos.json => 0001.githubrepos.json} | 0 .../build/cache/0002.githubrepos.json | 1 + cmd/hugothemesitebuilder/build/go.mod | 2 +- pkg/buildcmd/build.go | 156 +++++++++++- pkg/client/client.go | 235 +++++++----------- 5 files changed, 236 insertions(+), 158 deletions(-) rename cmd/hugothemesitebuilder/build/cache/{githubrepos.json => 0001.githubrepos.json} (100%) create mode 100644 cmd/hugothemesitebuilder/build/cache/0002.githubrepos.json diff --git a/cmd/hugothemesitebuilder/build/cache/githubrepos.json b/cmd/hugothemesitebuilder/build/cache/0001.githubrepos.json similarity index 100% rename from cmd/hugothemesitebuilder/build/cache/githubrepos.json rename to cmd/hugothemesitebuilder/build/cache/0001.githubrepos.json diff --git a/cmd/hugothemesitebuilder/build/cache/0002.githubrepos.json b/cmd/hugothemesitebuilder/build/cache/0002.githubrepos.json new file mode 100644 index 0000000..999935d --- /dev/null +++ b/cmd/hugothemesitebuilder/build/cache/0002.githubrepos.json @@ -0,0 +1 @@ +{"github.com/2-REC/hugo-myportfolio-theme":{"id":148112554,"name":"hugo-myportfolio-theme","description":"Adaptation of the HUGO Creative Theme to support several portfolios.","html_url":"https://github.com/2-REC/hugo-myportfolio-theme","stargazers_count":8},"github.com/AlexFinn/simple-a":{"id":20995016,"name":"simple-a","description":"Minimalistic Hugo theme","html_url":"https://github.com/alxschwarz/simple-a","stargazers_count":53},"github.com/AmazingRise/hugo-theme-diary":{"id":220989613,"name":"hugo-theme-diary","description":"Moments piled up. A Hugo theme ported from SumiMakito/hexo-theme-Journal.","html_url":"https://github.com/AmazingRise/hugo-theme-diary","stargazers_count":195},"github.com/AngeloStavrow/indigo":{"id":144703412,"name":"indigo","description":"An IndieWeb-friendly custom theme for Hugo","html_url":"https://github.com/AngeloStavrow/indigo","stargazers_count":52},"github.com/Chen-Zhe/photo-grid":{"id":240859368,"name":"photo-grid","description":"A Hugo theme for manage photography display in a dynamic grid layout","html_url":"https://github.com/Chen-Zhe/photo-grid","stargazers_count":23},"github.com/EmielH/hallo-hugo":{"id":155071757,"name":"hallo-hugo","description":"Hallo is a single-page Hugo theme to introduce yourself.","html_url":"https://github.com/EmielH/hallo-hugo","stargazers_count":84},"github.com/EmielH/stip-hugo":{"id":178725944,"name":"stip-hugo","description":"Stip is a single-page Hugo theme to introduce yourself, based on Material Design's tap target design pattern.","html_url":"https://github.com/EmielH/stip-hugo","stargazers_count":18},"github.com/EmielH/tale-hugo":{"id":142682503,"name":"tale-hugo","description":"A port of the Tale theme for Hugo. Tale is a minimal theme curated for storytellers.","html_url":"https://github.com/EmielH/tale-hugo","stargazers_count":199},"github.com/ExchangeRate-API/strange-case":{"id":66580052,"name":"strange-case","description":"Strange Case is a Hugo theme for people who like the Hyde theme ported from Jekyll but prefer using Bootstrap.","html_url":"https://github.com/ExchangeRate-API/strange-case","stargazers_count":26},"github.com/Fastbyte01/KeepIt":{"id":168930851,"name":"KeepIt","description":"The most powerful minimal Hugo theme.","html_url":"https://github.com/Fastbyte01/KeepIt","stargazers_count":160},"github.com/GDGToulouse/devfest-theme-hugo":{"id":165132952,"name":"devfest-theme-hugo","description":"A theme for a conference website. Created for DevFest Toulouse 2019","html_url":"https://github.com/GDGToulouse/devfest-theme-hugo","stargazers_count":65},"github.com/IvanChou/hugo-theme-vec":{"id":67712359,"name":"hugo-theme-vec","description":"Vec is a minimal, clean and beautiful theme for Hugo.","html_url":"https://github.com/yiichou/hugo-theme-vec","stargazers_count":37},"github.com/JugglerX/hugo-hero-theme":{"id":160591048,"name":"hugo-hero-theme","description":"A multi-page Hugo theme with fullscreen hero images and fullwidth sections.","html_url":"https://github.com/zerostaticthemes/hugo-hero-theme","stargazers_count":134},"github.com/JugglerX/hugo-serif-theme":{"id":159459907,"name":"hugo-serif-theme","description":"Serif is a modern business theme for Hugo.","html_url":"https://github.com/zerostaticthemes/hugo-serif-theme","stargazers_count":176},"github.com/JugglerX/hugo-whisper-theme":{"id":171089926,"name":"hugo-whisper-theme","description":"Whisper is a minimal documentation theme for Hugo.","html_url":"https://github.com/zerostaticthemes/hugo-whisper-theme","stargazers_count":166},"github.com/Lednerb/bilberry-hugo-theme":{"id":108488686,"name":"bilberry-hugo-theme","description":"Premium theme for the hugo site builder. DEMO:","html_url":"https://github.com/Lednerb/bilberry-hugo-theme","stargazers_count":218},"github.com/LordMathis/hugo-theme-nix":{"id":69647603,"name":"hugo-theme-nix","description":"Nix is a simple, minimal theme for Hugo","html_url":"https://github.com/LordMathis/hugo-theme-nix","stargazers_count":108},"github.com/MarcusVirg/forty":{"id":111167907,"name":"forty","description":"Forty theme - Hugo theme ported from HTML5UP origrinal theme called Forty.","html_url":"https://github.com/MarcusVirg/forty","stargazers_count":107},"github.com/MeiK2333/github-style":{"id":216473473,"name":"github-style","description":"","html_url":"https://github.com/MeiK2333/github-style","stargazers_count":193},"github.com/Mitrichius/hugo-theme-anubis":{"id":233350753,"name":"hugo-theme-anubis","description":"Anubis is a simple minimalist theme for Hugo blog engine","html_url":"https://github.com/Mitrichius/hugo-theme-anubis","stargazers_count":170},"github.com/MunifTanjim/minimo":{"id":91743121,"name":"minimo","description":"Minimo - Minimalist theme for Hugo","html_url":"https://github.com/MunifTanjim/minimo","stargazers_count":463},"github.com/NormandErwan/Blogpaper":{"id":219223151,"name":"Blogpaper","description":"A graphical newspaper like blog theme for Hugo.","html_url":"https://github.com/NormandErwan/Blogpaper","stargazers_count":16},"github.com/PippoRJ/hugo-refresh":{"id":194754990,"name":"hugo-refresh","description":"","html_url":"https://github.com/PippoRJ/hugo-refresh","stargazers_count":92},"github.com/RCJacH/hugo-webslides":{"id":201426894,"name":"hugo-webslides","description":"This is a Hugo template to create WebSlides presentation using markdown.","html_url":"https://github.com/RCJacH/hugo-webslides","stargazers_count":81},"github.com/RealOrangeOne/hugo-theme-revealjs":{"id":116035639,"name":"hugo-theme-revealjs","description":"Use Hugo to build a presentation, powered by RevealJS","html_url":"https://github.com/RealOrangeOne/hugo-theme-revealjs","stargazers_count":39},"github.com/SAGGameDeveloper/hugo-minimalist-spa":{"id":148911671,"name":"hugo-minimalist-spa","description":"A minimalist single page application theme for Hugo","html_url":"https://github.com/sergioabreu-g/hugo-minimalist-spa","stargazers_count":1},"github.com/Somrat37/somrat":{"id":236543601,"name":"somrat","description":"A Hugo portfolio theme (archived)","html_url":"https://github.com/somratpro/somrat","stargazers_count":86},"github.com/SteveLane/hugo-icon":{"id":104065827,"name":"hugo-icon","description":"Icon theme for Hugo","html_url":"https://github.com/SteveLane/hugo-icon","stargazers_count":89},"github.com/Tazeg/hugo-blog-jeffprod":{"id":144332692,"name":"hugo-blog-jeffprod","description":"A free blog theme for HUGO (https://gohugo.io/), with tags, archives, last posts...","html_url":"https://github.com/Tazeg/hugo-blog-jeffprod","stargazers_count":49},"github.com/Track3/hermit":{"id":154265086,"name":"hermit","description":"A minimal \u0026 fast Hugo theme for bloggers","html_url":"https://github.com/Track3/hermit","stargazers_count":832},"github.com/VVelox/hugo-dusky-neon-potato":{"id":147290106,"name":"hugo-dusky-neon-potato","description":"a merging of the dusk and potato-dark themes for hugo","html_url":"https://github.com/VVelox/hugo-dusky-neon-potato","stargazers_count":12},"github.com/Vimux/Binario":{"id":131256286,"name":"Binario","description":"Responsive card-based \u0026 code-light Hugo theme","html_url":"https://github.com/Vimux/Binario","stargazers_count":59},"github.com/Vimux/mainroad":{"id":76561407,"name":"Mainroad","description":"Responsive, simple, clean and content-focused Hugo theme based on the MH Magazine lite WordPress theme","html_url":"https://github.com/Vimux/Mainroad","stargazers_count":543},"github.com/Xzya/hugo-material-blog":{"id":130488118,"name":"hugo-material-blog","description":"Clean Material Design blog theme for Hugo.","html_url":"https://github.com/Xzya/hugo-material-blog","stargazers_count":23},"github.com/Y4er/hugo-theme-easybook":{"id":212960032,"name":"hugo-theme-easybook","description":"🚀 A super concise theme for Hugo","html_url":"https://github.com/Y4er/hugo-theme-easybook","stargazers_count":11},"github.com/achary/engimo":{"id":142474405,"name":"engimo","description":"minimo-eng - Minimalist theme for Hugo tuned for engineering content, based on Minimo","html_url":"https://github.com/achary/engimo","stargazers_count":47},"github.com/aerohub/hugo-faq-theme":{"id":68856818,"name":"hugo-faq-theme","description":"Simple FAQ Theme for Hugo","html_url":"https://github.com/aerohub/hugo-faq-theme","stargazers_count":22},"github.com/aerohub/hugo-identity-theme":{"id":55162650,"name":"hugo-identity-theme","description":"Little profile/card-style template for Hugo. Based on Identity by HTML5 UP.","html_url":"https://github.com/aerohub/hugo-identity-theme","stargazers_count":86},"github.com/aerohub/hugo-orbit-theme":{"id":69219857,"name":"hugo-orbit-theme","description":"Great looking resume/CV theme designed for developers.","html_url":"https://github.com/aerohub/hugo-orbit-theme","stargazers_count":227},"github.com/aerohub/hugrid":{"id":65926114,"name":"hugrid","description":"Hugrid (Hugo+grid) is a simple grid theme for Hugo. It's a kind of boilerplate to perform anyone or anything quickly. Portfolio, collection, bookmarks, contacts and so on.","html_url":"https://github.com/aerohub/hugrid","stargazers_count":143},"github.com/alanorth/hugo-theme-bootstrap4-blog":{"id":66769421,"name":"hugo-theme-bootstrap4-blog","description":"A blogging-centric Bootstrap v4 theme for the Hugo static site generator.","html_url":"https://github.com/alanorth/hugo-theme-bootstrap4-blog","stargazers_count":196},"github.com/alex-shpak/hugo-book":{"id":147530276,"name":"hugo-book","description":"Hugo documentation theme as simple as plain book","html_url":"https://github.com/alex-shpak/hugo-book","stargazers_count":1252},"github.com/allnightgrocery/hugo-theme-blueberry-detox":{"id":34576989,"name":"hugo-theme-blueberry-detox","description":"","html_url":"https://github.com/allnightgrocery/hugo-theme-blueberry-detox","stargazers_count":54},"github.com/antonpolishko/hugo-stellar-theme":{"id":136688643,"name":"hugo-stellar-theme","description":"a port of html5up.net/stellar template for Hugo static site generator","html_url":"https://github.com/antonpolishko/hugo-stellar-theme","stargazers_count":24},"github.com/appernetic/hugo-nederburg-theme":{"id":125446118,"name":"hugo-nederburg-theme","description":"Nederburg is a fast and secure hugo theme and is a port of the Tracks WP theme","html_url":"https://github.com/appernetic/hugo-nederburg-theme","stargazers_count":107},"github.com/asurbernardo/amperage":{"id":213869590,"name":"amperage","description":"Blazing fast SEO optimized GoHugo theme with native AMP, structured data, search, service workers and i18n out of the box! :zap:","html_url":"https://github.com/asurbernardo/amperage","stargazers_count":94},"github.com/azmelanar/hugo-theme-pixyll":{"id":26679163,"name":"hugo-theme-pixyll","description":"A simple, beautiful Hugo theme that's mobile first.","html_url":"https://github.com/azmelanar/hugo-theme-pixyll","stargazers_count":135},"github.com/bake/solar-theme-hugo":{"id":98172335,"name":"solar-theme-hugo","description":"A port of solar-theme-ghost for Hugo","html_url":"https://github.com/bake/solar-theme-hugo","stargazers_count":40},"github.com/balaramadurai/hugo-travelify-theme":{"id":95666057,"name":"hugo-travelify-theme","description":"Port of Aigars Silkalns's Wordpress theme Travelify to Hugo. Demo -","html_url":"https://github.com/balaramadurai/hugo-travelify-theme","stargazers_count":33},"github.com/bep/docuapi":{"id":71171466,"name":"docuapi","description":"Beautiful multilingual API documentation theme for Hugo","html_url":"https://github.com/bep/docuapi","stargazers_count":501},"github.com/bjacquemet/personal-web":{"id":172538739,"name":"personal-web","description":"Hugo Template for Freelancer Portfolio and Blog","html_url":"https://github.com/bjacquemet/personal-web","stargazers_count":76},"github.com/blankoworld/hugo_theme_adam_eve":{"id":95039171,"name":"hugo_theme_adam_eve","description":"Adam \u0026 Eve theme for Hugo","html_url":"https://github.com/blankoworld/hugo_theme_adam_eve","stargazers_count":16},"github.com/brycematheson/allegiant":{"id":46627070,"name":"allegiant","description":"A kick-ass theme for Hugo, a static-site generator, similar to Jekyll, but programmed in Go. (It's fast).","html_url":"https://github.com/brycematheson/allegiant","stargazers_count":24},"github.com/budparr/gohugo-theme-ananke":{"id":87873787,"name":"gohugo-theme-ananke","description":"Ananke: A theme for Hugo Sites","html_url":"https://github.com/theNewDynamic/gohugo-theme-ananke","stargazers_count":612},"github.com/bul-ikana/hugo-cards":{"id":150910183,"name":"hugo-cards","description":"A bootstrap based minimal hugo theme based on webjeda-cards","html_url":"https://github.com/bul-ikana/hugo-cards","stargazers_count":51},"github.com/calintat/minimal":{"id":96643512,"name":"minimal","description":"Personal blog theme powered by Hugo","html_url":"https://github.com/calintat/minimal","stargazers_count":348},"github.com/capnfabs/paperesque":{"id":210030800,"name":"paperesque","description":"A lightweight theme for Hugo (gohugo.io)","html_url":"https://github.com/capnfabs/paperesque","stargazers_count":26},"github.com/carsonip/hugo-theme-minos":{"id":82418156,"name":"hugo-theme-minos","description":"A simple and retro styled Hugo theme ported from Hexo","html_url":"https://github.com/carsonip/hugo-theme-minos","stargazers_count":118},"github.com/cboettig/hugo-now-ui":{"id":111959141,"name":"hugo-now-ui","description":":globe_with_meridians: Hugo adaptation of Now-UI from Creative Tim","html_url":"https://github.com/cboettig/hugo-now-ui","stargazers_count":97},"github.com/cdeck3r/OneDly-Theme":{"id":200716078,"name":"OneDly-Theme","description":"Hugo theme for documenting One-Day-Only projects","html_url":"https://github.com/cdeck3r/OneDly-Theme","stargazers_count":11},"github.com/cfrome77/hugo-theme-sky":{"id":135247826,"name":"hugo-theme-sky","description":"This is a simple Hugo theme that uses bootstrap","html_url":"https://github.com/cfrome77/hugo-theme-sky","stargazers_count":2},"github.com/chipsenkbeil/grid-side":{"id":40447662,"name":"grid-side","description":"Personal portfolio and blog for use by the Hugo generator.","html_url":"https://github.com/chipsenkbeil/grid-side","stargazers_count":31},"github.com/cntrump/hugo-notepadium":{"id":223706845,"name":"hugo-notepadium","description":"a fast gohugo theme, 100% JavaScript-free.","html_url":"https://github.com/cntrump/hugo-notepadium","stargazers_count":261},"github.com/coderzh/hugo-pacman-theme":{"id":54326901,"name":"hugo-pacman-theme","description":"pacman theme support Hugo v0.37.1 now","html_url":"https://github.com/coderzh/hugo-pacman-theme","stargazers_count":94},"github.com/cowboysmall-tools/hugo-business-frontpage-theme":{"id":219859115,"name":"hugo-business-frontpage-theme","description":"A basic HTML starter template for creating a Bootstrap based website for a small business or other organization.","html_url":"https://github.com/cowboysmall-tools/hugo-business-frontpage-theme","stargazers_count":14},"github.com/cowboysmall-tools/hugo-devresume-theme":{"id":219337339,"name":"hugo-devresume-theme","description":"A free resume/CV template made for software developers.","html_url":"https://github.com/cowboysmall-tools/hugo-devresume-theme","stargazers_count":176},"github.com/cssandstuff/hugo-theme-winning":{"id":139923745,"name":"hugo-theme-winning","description":"","html_url":"https://github.com/cssandstuff/hugo-theme-winning","stargazers_count":49},"github.com/curttimson/hugo-theme-dopetrope":{"id":121020887,"name":"hugo-theme-dopetrope","description":"Dopetrope theme for Hugo static site generator","html_url":"https://github.com/curtistimson/hugo-theme-dopetrope","stargazers_count":20},"github.com/curttimson/hugo-theme-massively":{"id":122748426,"name":"hugo-theme-massively","description":"Massively theme for Hugo static site generator","html_url":"https://github.com/curtistimson/hugo-theme-massively","stargazers_count":88},"github.com/d-kusk/minimage":{"id":109487130,"name":"minimage","description":"Hugo's theme","html_url":"https://github.com/dsk52/minimage","stargazers_count":16},"github.com/damiencaselli/hugo-journal":{"id":98110142,"name":"hugo-journal","description":"Minimalist theme for gohugo","html_url":"https://github.com/dashdashzako/hugo-journal","stargazers_count":64},"github.com/damiencaselli/paperback":{"id":65299365,"name":"paperback","description":"Theme for Hugo static website engine","html_url":"https://github.com/dashdashzako/paperback","stargazers_count":39},"github.com/danielkvist/hugo-piercer-theme":{"id":177417851,"name":"hugo-piercer-theme","description":"Piercer is a very customizable, fast and simple Hugo theme designed under the mobile-first philosophy.","html_url":"https://github.com/danielkvist/hugo-piercer-theme","stargazers_count":25},"github.com/danielkvist/hugo-terrassa-theme":{"id":160407157,"name":"hugo-terrassa-theme","description":"Terrassa is a simple, fast and responsive theme for Hugo with a strong focus on accessibility.","html_url":"https://github.com/danielkvist/hugo-terrassa-theme","stargazers_count":63},"github.com/darshanbaral/aafu":{"id":174893518,"name":"aafu","description":"Portfolio theme with blog","html_url":"https://github.com/darshanbaral/aafu","stargazers_count":23},"github.com/darshanbaral/khata":{"id":194773666,"name":"khata","description":"Hugo theme for documentation.","html_url":"https://github.com/darshanbaral/khata","stargazers_count":2},"github.com/darshanbaral/kitab":{"id":187421524,"name":"kitab","description":"A hugo theme for publishing books","html_url":"https://github.com/darshanbaral/kitab","stargazers_count":12},"github.com/darshanbaral/mero":{"id":173528293,"name":"mero","description":"Hugo theme for personal blogs","html_url":"https://github.com/darshanbaral/mero","stargazers_count":10},"github.com/darshanbaral/sada":{"id":162049070,"name":"sada","description":"Simple hugo theme for resume created using Tailwind CSS","html_url":"https://github.com/darshanbaral/sada","stargazers_count":16},"github.com/dataCobra/hugo-vitae":{"id":228858366,"name":"hugo-vitae","description":"Vitae is a blog theme for Hugo that focuses on your content.","html_url":"https://github.com/dataCobra/hugo-vitae","stargazers_count":93},"github.com/davidhampgonsalves/hugo-black-and-light-theme":{"id":78483943,"name":"hugo-black-and-light-theme","description":"","html_url":"https://github.com/davidhampgonsalves/hugo-black-and-light-theme","stargazers_count":168},"github.com/de-souza/hugo-flex":{"id":171150963,"name":"hugo-flex","description":"A lightweight Hugo theme leveraging CSS Flexbox","html_url":"https://github.com/de-souza/hugo-flex","stargazers_count":58},"github.com/devcows/hugo-universal-theme":{"id":61122259,"name":"hugo-universal-theme","description":"Port of the Universal theme to Hugo","html_url":"https://github.com/devcows/hugo-universal-theme","stargazers_count":482},"github.com/digitalcraftsman/hugo-artists-theme":{"id":37544952,"name":"hugo-artists-theme","description":"Port of Travis Neilson's (DevTips) awesome Artists Theme to Hugo","html_url":"https://github.com/digitalcraftsman/hugo-artists-theme","stargazers_count":56},"github.com/digitalcraftsman/hugo-cactus-theme":{"id":37670989,"name":"hugo-cactus-theme","description":"Port of Nick Balestra's Cactus theme to Hugo.","html_url":"https://github.com/digitalcraftsman/hugo-cactus-theme","stargazers_count":200},"github.com/digitalcraftsman/hugo-creative-theme":{"id":37338443,"name":"hugo-creative-theme","description":"Port of Startbootstrap's Creative theme to Hugo","html_url":"https://github.com/digitalcraftsman/hugo-creative-theme","stargazers_count":141},"github.com/digitalcraftsman/hugo-freelancer-theme":{"id":37200491,"name":"hugo-freelancer-theme","description":"Port of Startbootstrap's Freelancer theme to Hugo","html_url":"https://github.com/digitalcraftsman/hugo-freelancer-theme","stargazers_count":71},"github.com/digitalcraftsman/hugo-hikari-theme":{"id":39734437,"name":"hugo-hikari-theme","description":"Port of Mathieu Mayer-Mazzoli's Hikari theme to Hugo","html_url":"https://github.com/digitalcraftsman/hugo-hikari-theme","stargazers_count":11},"github.com/digitalcraftsman/hugo-minimalist-theme":{"id":44478253,"name":"hugo-minimalist-theme","description":"Port of Raphael Riegger's Minimalistic Ghost theme to Hugo.","html_url":"https://github.com/digitalcraftsman/hugo-minimalist-theme","stargazers_count":26},"github.com/digitalcraftsman/hugo-type-theme":{"id":37485285,"name":"hugo-type-theme","description":"Port of Rohan Chandra's Type theme to Hugo.","html_url":"https://github.com/digitalcraftsman/hugo-type-theme","stargazers_count":54},"github.com/dillonzq/LoveIt":{"id":200158234,"name":"LoveIt","description":"❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题","html_url":"https://github.com/dillonzq/LoveIt","stargazers_count":1203},"github.com/diwao/hestia-pure":{"id":95651197,"name":"hestia-pure","description":"Hestia Pure is a Hugo theme based on Pure CSS.","html_url":"https://github.com/diwao/hestia-pure","stargazers_count":24},"github.com/dldx/hpstr-hugo-theme":{"id":68681823,"name":"hpstr-hugo-theme","description":":art: A Hugo theme based on the HPSTR Jekyll theme.","html_url":"https://github.com/dldx/hpstr-hugo-theme","stargazers_count":18},"github.com/dplesca/purehugo":{"id":20383015,"name":"purehugo","description":"Hugo theme based on purecss from Yahoo.","html_url":"https://github.com/dplesca/purehugo","stargazers_count":84},"github.com/dzello/reveal-hugo":{"id":131216648,"name":"reveal-hugo","description":"📽️ Create rich HTML-based presentations with Hugo and Reveal.js","html_url":"https://github.com/dzello/reveal-hugo","stargazers_count":407},"github.com/edavidaja/docter":{"id":190885811,"name":"docter","description":"Hugo port of cfpb/docter","html_url":"https://github.com/edavidaja/docter","stargazers_count":6},"github.com/eddiewebb/hugo-resume":{"id":121309948,"name":"hugo-resume","description":"A Hugo theme ported from startbootrap.com's resume template","html_url":"https://github.com/eddiewebb/hugo-resume","stargazers_count":146},"github.com/eliasson/liquorice":{"id":23052313,"name":"liquorice","description":"Liquorice is a small black and white theme for Hugo.","html_url":"https://github.com/eliasson/liquorice","stargazers_count":47},"github.com/ertuil/erblog":{"id":224989291,"name":"erblog","description":"A Hugo theme created by ertuil. ","html_url":"https://github.com/ertuil/erblog","stargazers_count":50},"github.com/escalate/hugo-split-theme":{"id":129046241,"name":"hugo-split-theme","description":"Port of Split template by One Page Love to Hugo","html_url":"https://github.com/escalate/hugo-split-theme","stargazers_count":38},"github.com/eshlox/simplicity":{"id":109606758,"name":"simplicity","description":"Hugo theme.","html_url":"https://github.com/eshlox/simplicity","stargazers_count":50},"github.com/felicianotech/hugo-theme-lean-launch-page":{"id":103211654,"name":"hugo-theme-lean-launch-page","description":"A theme for people creating pre-launch pages for a product or business. Allows you to have a landing page while collecting emails.","html_url":"https://github.com/felicianotech/hugo-theme-lean-launch-page","stargazers_count":24},"github.com/fiatjaf/classless-hugo":{"id":128872437,"name":"classless-hugo","description":"The Classless templates and themes implemented in Hugo","html_url":"https://github.com/fiatjaf/classless-hugo","stargazers_count":5},"github.com/fncnt/vncnt-hugo":{"id":163980744,"name":"vncnt-hugo","description":"a simple theme for hugo.","html_url":"https://github.com/fncnt/vncnt-hugo","stargazers_count":39},"github.com/forestryio/hugo-theme-novela":{"id":213727505,"name":"hugo-theme-novela","description":"Novela, the simplest way to start publishing with Hugo and Forestry.","html_url":"https://github.com/forestryio/hugo-theme-novela","stargazers_count":246},"github.com/frjo/hugo-theme-zen":{"id":84443022,"name":"hugo-theme-zen","description":"A fast and clean Hugo theme with css-grid and Hugo pipes support.","html_url":"https://github.com/frjo/hugo-theme-zen","stargazers_count":130},"github.com/funkydan2/alpha-church":{"id":131554115,"name":"alpha-church","description":"Hugo theme for churches based on a html5up theme","html_url":"https://github.com/funkydan2/alpha-church","stargazers_count":43},"github.com/funkydan2/hugo-kiera":{"id":130204294,"name":"hugo-kiera","description":"Kiera - A Hugo Theme for writing","html_url":"https://github.com/funkydan2/hugo-kiera","stargazers_count":53},"github.com/g1eny0ung/hugo-theme-dream":{"id":105977401,"name":"hugo-theme-dream","description":"🌱 Hugo theme named Dream.","html_url":"https://github.com/g1eny0ung/hugo-theme-dream","stargazers_count":211},"github.com/garvincasimir/hugo-h5bp-simple":{"id":39656460,"name":"hugo-h5bp-simple","description":"Simple responsive them for Go Hugo","html_url":"https://github.com/garvincasimir/hugo-h5bp-simple","stargazers_count":4},"github.com/gcushen/hugo-academic":{"id":57165232,"name":"wowchemy-hugo-modules","description":"🔥 The website builder for Hugo. No code, build with widgets! 创建在线课程,学术简历或初创网站。","html_url":"https://github.com/wowchemy/wowchemy-hugo-modules","stargazers_count":5689},"github.com/geschke/hugo-tikva":{"id":156383869,"name":"hugo-tikva","description":"Tikva is a minimalistic Hugo theme, based on Bootstrap v4 CSS framework.","html_url":"https://github.com/geschke/hugo-tikva","stargazers_count":7},"github.com/gesquive/slate":{"id":91744509,"name":"slate","description":"a single-page speed-dial theme for Hugo","html_url":"https://github.com/gesquive/slate","stargazers_count":106},"github.com/gizak/nofancy":{"id":28990816,"name":"nofancy","description":"A Hugo blog theme","html_url":"https://github.com/gizak/nofancy","stargazers_count":59},"github.com/gkmngrgn/hugo-alageek-theme":{"id":147963873,"name":"hugo-alageek-theme","description":"alaGeek is an enhanced version of the Cocoa theme featuring a customizable homepage with different sections including the latest posts, syntax highlighting and MathJax support and much more.","html_url":"https://github.com/gkmngrgn/hugo-alageek-theme","stargazers_count":41},"github.com/gonnux/hugo-apps-theme":{"id":155048745,"name":"hugo-apps-theme","description":"Hugo Apps Theme","html_url":"https://github.com/gonnux/hugo-apps-theme","stargazers_count":10},"github.com/goodroot/hugo-classic":{"id":97069201,"name":"hugo-classic","description":"A simple and text-centric theme for Hugo.io","html_url":"https://github.com/goodroot/hugo-classic","stargazers_count":84},"github.com/google/docsy":{"id":153180924,"name":"docsy","description":"A set of Hugo doc templates for launching open source content.","html_url":"https://github.com/google/docsy","stargazers_count":1206},"github.com/guangmean/Niello":{"id":163953752,"name":"Niello","description":"A Dark Theme for Hugo","html_url":"https://github.com/guangmean/Niello","stargazers_count":8},"github.com/gundamew/hugo-bingo":{"id":139309614,"name":"hugo-bingo","description":"Nothing but texts.","html_url":"https://github.com/gundamew/hugo-bingo","stargazers_count":10},"github.com/gyorb/hugo-dusk":{"id":89065581,"name":"hugo-dusk","description":"Simple, minimalistic dark theme for Hugo.","html_url":"https://github.com/gyorb/hugo-dusk","stargazers_count":46},"github.com/hadisinaee/avicenna":{"id":194403815,"name":"avicenna","description":"a minimal academic page for Hugo","html_url":"https://github.com/hadisinaee/avicenna","stargazers_count":81},"github.com/halogenica/beautifulhugo":{"id":53404533,"name":"beautifulhugo","description":"Theme for the Hugo static website generator","html_url":"https://github.com/halogenica/beautifulhugo","stargazers_count":836},"github.com/hauke96/hugo-theme-hamburg":{"id":146047737,"name":"hugo-theme-hamburg","description":"Simple and clean blog theme for hugo","html_url":"https://github.com/hauke96/hugo-theme-hamburg","stargazers_count":10},"github.com/hdcdstr8fwd/foundation-theme":{"id":76188333,"name":"foundation-theme","description":"Core theme files for Hugo Foundation.","html_url":"https://github.com/hdcdstr8fwd/foundation-theme","stargazers_count":12},"github.com/hivickylai/hugo-theme-sam":{"id":121534430,"name":"hugo-theme-sam","description":"A Simple and Minimalist theme for Hugo with a focus on typography and content.","html_url":"https://github.com/victoriadrake/hugo-theme-sam","stargazers_count":331},"github.com/htdvisser/hugo-base16-theme":{"id":47702083,"name":"hugo-base16-theme","description":"Hugo theme with base16 eighties colorscheme","html_url":"https://github.com/htdvisser/hugo-base16-theme","stargazers_count":101},"github.com/htr3n/hyde-hyde":{"id":118216527,"name":"hyde-hyde","description":"A cool theme inspired by spf13's Hyde theme","html_url":"https://github.com/htr3n/hyde-hyde","stargazers_count":222},"github.com/humrochagf/colordrop":{"id":198533025,"name":"colordrop","description":"Customizable, monochromatic and minimalist hugo theme for personal blogs","html_url":"https://github.com/humrochagf/colordrop","stargazers_count":12},"github.com/iCyris/hugo-theme-yuki":{"id":164000679,"name":"hugo-theme-yuki","description":"❄️ She is as pure as the snow","html_url":"https://github.com/iCyris/hugo-theme-yuki","stargazers_count":19},"github.com/ianrodrigues/hugo-tailwind-journal":{"id":221896765,"name":"hugo-tailwind-journal","description":"A minimalist journal template for Hugo.","html_url":"https://github.com/ianrodrigues/hugo-tailwind-journal","stargazers_count":36},"github.com/ijsucceed/onepress":{"id":162448756,"name":"onepress","description":"A simple, clean, and responsive \"Hugo - Static Site Generator\" theme for bloggers","html_url":"https://github.com/ijsucceed/onepress","stargazers_count":21},"github.com/it-gro/hugo-theme-w3css-basic":{"id":109979212,"name":"hugo-theme-w3css-basic","description":"","html_url":"https://github.com/it-gro/hugo-theme-w3css-basic","stargazers_count":42},"github.com/jacobsun/edidor":{"id":185605021,"name":"edidor","description":"A hugo theme that looks like an editor with a builtin style generator, INFINITE COLOR MODE from a market perspective. 😂","html_url":"https://github.com/sfengyuan/edidor","stargazers_count":32},"github.com/jacobsun/hugo-theme-cole":{"id":187965923,"name":"hugo-theme-cole","description":"Hugo simple theme","html_url":"https://github.com/sfengyuan/hugo-theme-cole","stargazers_count":0},"github.com/jaden/twentyfourteen":{"id":29022644,"name":"twentyfourteen","description":"A Hugo theme based on the Wordpress Twenty Fourteen theme.","html_url":"https://github.com/jaden/twentyfourteen","stargazers_count":22},"github.com/jbub/ghostwriter":{"id":34606336,"name":"ghostwriter","description":"A port of ghostwriter theme to Hugo.","html_url":"https://github.com/jbub/ghostwriter","stargazers_count":154},"github.com/jeblister/bulma":{"id":87108069,"name":"bulma","description":"Bulma is a simple and a responsive Hugo theme that offers a traditional blog mixed with a landing page designed to bootstrap your frontend!.","html_url":"https://github.com/jeblister/bulma","stargazers_count":36},"github.com/jeblister/kube":{"id":88148761,"name":"kube","description":"Kube is a professional and a responsive Hugo theme for developers and designers that offers a documentation section mixed with a landing page and a blog.","html_url":"https://github.com/jeblister/kube","stargazers_count":353},"github.com/jeremybise/twentynineteen-hugo":{"id":181497207,"name":"twentynineteen-hugo","description":"A Hugo theme based on the Wordpress Twenty Nineteen theme.","html_url":"https://github.com/jeremybise/twentynineteen-hugo","stargazers_count":9},"github.com/jesselau76/hugo-w3-simple":{"id":156296660,"name":"hugo-w3-simple","description":"Hugo Theme","html_url":"https://github.com/jesselau76/hugo-w3-simple","stargazers_count":20},"github.com/jimfrenette/hugo-starter":{"id":167275593,"name":"hugo-starter","description":"Hugo starter theme with webpack 4 ui build workflow","html_url":"https://github.com/jimfrenette/hugo-starter","stargazers_count":13},"github.com/jnjosh/internet-weblog":{"id":52138865,"name":"internet-weblog","description":"internet weblog theme for Hugo","html_url":"https://github.com/jnjosh/internet-weblog","stargazers_count":31},"github.com/jonathanjanssens/hugo-casper3":{"id":218465992,"name":"hugo-casper3","description":"Hugo port of the Casper 3 theme originally by Ghost.","html_url":"https://github.com/jonathanjanssens/hugo-casper3","stargazers_count":45},"github.com/josephhutch/aether":{"id":125391209,"name":"aether","description":"A responsive and clean Hugo theme for blogs","html_url":"https://github.com/josephhutch/aether","stargazers_count":138},"github.com/joway/hugo-theme-yinyang":{"id":156729664,"name":"hugo-theme-yinyang","description":"A black-white theme for Hugo.","html_url":"https://github.com/joway/hugo-theme-yinyang","stargazers_count":244},"github.com/jpescador/hugo-future-imperfect":{"id":54349132,"name":"hugo-future-imperfect","description":"A ported theme with some extras for the Hugo static website engine","html_url":"https://github.com/jpescador/hugo-future-imperfect","stargazers_count":308},"github.com/jrutheiser/hugo-lithium-theme":{"id":58174822,"name":"hugo-lithium-theme","description":"Lithium - A simple responsive Hugo theme","html_url":"https://github.com/jrutheiser/hugo-lithium-theme","stargazers_count":110},"github.com/jsnjack/hugo-changelog-theme":{"id":147115762,"name":"hugo-changelog-theme","description":"A Hugo changelog theme","html_url":"https://github.com/jsnjack/hugo-changelog-theme","stargazers_count":95},"github.com/jsnjack/kraiklyn":{"id":119292750,"name":"kraiklyn","description":"A Hugo theme for one page documentation","html_url":"https://github.com/jsnjack/kraiklyn","stargazers_count":48},"github.com/jweslley/hugo-conference":{"id":108731719,"name":"hugo-conference","description":"The easiest way to create websites for conference/events","html_url":"https://github.com/jweslley/hugo-conference","stargazers_count":30},"github.com/kakawait/hugo-tranquilpeak-theme":{"id":55093419,"name":"hugo-tranquilpeak-theme","description":"A gorgeous responsive theme for Hugo blog framework","html_url":"https://github.com/kakawait/hugo-tranquilpeak-theme","stargazers_count":709},"github.com/kaushalmodi/hugo-bare-min-theme":{"id":119444825,"name":"hugo-bare-min-theme","description":"A bare minimum theme for Hugo (https://gohugo.io) to help develop and debug Hugo sites -- https://hugo-bare-min.netlify.com/,","html_url":"https://github.com/kaushalmodi/hugo-bare-min-theme","stargazers_count":65},"github.com/kc0bfv/ticky_tacky_dark":{"id":227217816,"name":"ticky_tacky_dark","description":"A multi-page Hugo theme, in dark colors, where the list page displays a set of image buttons linking to your sub-pages.","html_url":"https://github.com/kc0bfv/ticky_tacky_dark","stargazers_count":3},"github.com/kdevo/osprey-delight":{"id":223589504,"name":"osprey-delight","description":"Osprey Delight is the free-minded artist's choice for a clutter-free and blazingly fast single-page portfolio.","html_url":"https://github.com/kdevo/osprey-delight","stargazers_count":18},"github.com/keichi/vienna":{"id":30228814,"name":"vienna","description":"Simple and clean blog theme for hugo","html_url":"https://github.com/keichi/vienna","stargazers_count":42},"github.com/kimcc/hugo-theme-noteworthy":{"id":237806089,"name":"hugo-theme-noteworthy","description":"A minimalist Hugo theme for writers and bloggers","html_url":"https://github.com/kimcc/hugo-theme-noteworthy","stargazers_count":136},"github.com/kishaningithub/hugo-creative-portfolio-theme":{"id":72625520,"name":"hugo-creative-portfolio-theme","description":"Port of the creative portfolio theme to Hugo","html_url":"https://github.com/kishaningithub/hugo-creative-portfolio-theme","stargazers_count":320},"github.com/kishaningithub/hugo-shopping-product-catalogue-simple":{"id":133121316,"name":"hugo-shopping-product-catalogue-simple","description":"Hugo theme for shopping product catalogue","html_url":"https://github.com/kishaningithub/hugo-shopping-product-catalogue-simple","stargazers_count":43},"github.com/knadh/hugo-ink":{"id":222624771,"name":"hugo-ink","description":"Crisp, minimal personal website and blog theme for Hugo","html_url":"https://github.com/knadh/hugo-ink","stargazers_count":236},"github.com/koirand/pulp":{"id":149974263,"name":"pulp","description":"Pulp is a Hugo theme for getting a simple, easy-to-read blog site.","html_url":"https://github.com/koirand/pulp","stargazers_count":96},"github.com/kongdivin/hugo-theme-okayish-blog":{"id":234817274,"name":"hugo-theme-okayish-blog","description":"An ok-ish blog theme for Hugo based on Vanilla","html_url":"https://github.com/kongdivin/hugo-theme-okayish-blog","stargazers_count":9},"github.com/kritoke/darksimplicity":{"id":32689807,"name":"darksimplicity","description":"A Dark Minimalist Theme for Hugo Built Using PostCSS and Lost Grid.","html_url":"https://github.com/kritoke/darksimplicity","stargazers_count":11},"github.com/lasseborly/anybodyhome":{"id":67042780,"name":"anybodyhome","description":"A simple theme for simple people","html_url":"https://github.com/lasseborly/anybodyhome","stargazers_count":17},"github.com/leonhe/hugo_eiio":{"id":75465089,"name":"hugo_eiio","description":"Hugo Blog Theme","html_url":"https://github.com/leonhe/hugo_eiio","stargazers_count":20},"github.com/lgaida/mediumish-gohugo-theme":{"id":151920601,"name":"mediumish-gohugo-theme","description":"A mediumish gohugo theme, ported from jekyll","html_url":"https://github.com/lgaida/mediumish-gohugo-theme","stargazers_count":97},"github.com/lingxz/er":{"id":131629350,"name":"er","description":":snail: a hugo theme","html_url":"https://github.com/lingxz/er","stargazers_count":54},"github.com/liuzc/LeaveIt":{"id":148449700,"name":"LeaveIt","description":"A simple, minimal, clean blog theme for hugo.","html_url":"https://github.com/liuzc/LeaveIt","stargazers_count":360},"github.com/lubang/hugo-hello-programmer-theme":{"id":74281084,"name":"hugo-hello-programmer-theme","description":"This is a hugo theme for a programmer. It's simple and simple.","html_url":"https://github.com/lubang/hugo-hello-programmer-theme","stargazers_count":37},"github.com/lucperkins/hugo-fresh":{"id":262846969,"name":"hugo-fresh","description":"Hugo Fresh Theme","html_url":"https://github.com/lucperkins/hugo-fresh","stargazers_count":16},"github.com/luizdepra/hugo-coder":{"id":121858752,"name":"hugo-coder","description":"A minimalist blog theme for hugo.","html_url":"https://github.com/luizdepra/hugo-coder","stargazers_count":1512},"github.com/marcanuy/simpleit-hugo-theme":{"id":143778607,"name":"simpleit-hugo-theme","description":"Responsive Hugo theme for hierarchical content websites","html_url":"https://github.com/marcanuy/simpleit-hugo-theme","stargazers_count":16},"github.com/matcornic/hugo-theme-learn":{"id":54111104,"name":"hugo-theme-learn","description":"Porting Grav Learn theme to Hugo","html_url":"https://github.com/matcornic/hugo-theme-learn","stargazers_count":1218},"github.com/matsuyoshi30/harbor":{"id":240560413,"name":"harbor","description":"Simple and minimal personal blog theme.","html_url":"https://github.com/matsuyoshi30/harbor","stargazers_count":144},"github.com/mattbutton/silhouette-hugo":{"id":161894056,"name":"silhouette-hugo","description":"","html_url":"https://github.com/mattbutton/silhouette-hugo","stargazers_count":20},"github.com/mattstratton/castanet":{"id":68838254,"name":"castanet","description":"A podcast-oriented theme for Hugo","html_url":"https://github.com/mattstratton/castanet","stargazers_count":81},"github.com/mazgi/hugo-theme-techlog-simple":{"id":151939789,"name":"hugo-theme-techlog-simple","description":"A simple Hugo theme for tech-blogs.","html_url":"https://github.com/mazgi/hugo-theme-techlog-simple","stargazers_count":8},"github.com/mcrwfrd/hugo-frances-theme":{"id":196294193,"name":"hugo-frances-theme","description":"An expanding grid theme built with Bootstrap for Hugo","html_url":"https://github.com/mcrwfrd/hugo-frances-theme","stargazers_count":13},"github.com/meibenny/elephants":{"id":115945790,"name":"elephants","description":"Minimal Hugo theme using the Ubuntu font","html_url":"https://github.com/meibenny/elephants","stargazers_count":17},"github.com/miguelsimoni/hugo-initio":{"id":92842216,"name":"hugo-initio","description":"Hugo Theme port of Initio bootstrap template by GetTemplate","html_url":"https://github.com/miguelsimoni/hugo-initio","stargazers_count":47},"github.com/mikeblum/hugo-now":{"id":96054125,"name":"hugo-now","description":"a Hugo port of Jekyll Now","html_url":"https://github.com/mikeblum/hugo-now","stargazers_count":15},"github.com/mismith0227/hugo_theme_pickles":{"id":49237064,"name":"hugo_theme_pickles","description":"Modern, Simple and beautiful Hugo theme","html_url":"https://github.com/mismith0227/hugo_theme_pickles","stargazers_count":168},"github.com/mmrath/hugo-bootstrap":{"id":45042153,"name":"hugo-bootstrap","description":"Bootstrap theme for Hugo","html_url":"https://github.com/mmrath/hugo-bootstrap","stargazers_count":58},"github.com/nanxiaobei/hugo-paper":{"id":116700454,"name":"hugo-paper","description":"🥛 A simple, clean, flexible Hugo theme","html_url":"https://github.com/nanxiaobei/hugo-paper","stargazers_count":590},"github.com/naro143/hugo-coder-portfolio":{"id":143425223,"name":"hugo-coder-portfolio","description":"It is a theme to have you know yourself than developed based on \"hugo-coder\".","html_url":"https://github.com/naro143/hugo-coder-portfolio","stargazers_count":133},"github.com/natarajmb/charaka-hugo-theme":{"id":145614778,"name":"charaka-hugo-theme","description":"Minimalistic and Responsive blog theme for hugo","html_url":"https://github.com/natarajmb/charaka-hugo-theme","stargazers_count":40},"github.com/nathancday/min_night":{"id":134084121,"name":"min_night","description":"An easy on the eyes Hugo blog theme with dark mode.","html_url":"https://github.com/nathancday/min_night","stargazers_count":20},"github.com/niklasbuschmann/contrast-hugo":{"id":196999964,"name":"contrast-hugo","description":"Minimalistic Hugo theme","html_url":"https://github.com/niklasbuschmann/contrast-hugo","stargazers_count":27},"github.com/nirocfz/arabica":{"id":148265392,"name":"arabica","description":"A port of the Ghost arabica theme for Hugo","html_url":"https://github.com/nirocfz/arabica","stargazers_count":16},"github.com/nodejh/hugo-theme-cactus-plus":{"id":79039278,"name":"hugo-theme-mini","description":"A fast, minimalist and responsive hugo theme for bloggers.","html_url":"https://github.com/nodejh/hugo-theme-mini","stargazers_count":394},"github.com/nurlansu/hugo-sustain":{"id":71623522,"name":"hugo-sustain","description":"🦁 Personal blog theme built with Bootstrap, powered by Hugo.","html_url":"https://github.com/nurlansu/hugo-sustain","stargazers_count":168},"github.com/okkur/syna":{"id":102731022,"name":"syna","description":"Highly customizable open source theme for Hugo based static websites","html_url":"https://github.com/okkur/syna","stargazers_count":210},"github.com/olOwOlo/hugo-theme-even":{"id":101626459,"name":"hugo-theme-even","description":"🚀 A super concise theme for Hugo https://hugo-theme-even.netlify.app","html_url":"https://github.com/olOwOlo/hugo-theme-even","stargazers_count":1460},"github.com/onweru/compose":{"id":236832189,"name":"compose","description":"A Hugo theme for documentation sites. It's inspired by https://forestry.io/docs/welcome/","html_url":"https://github.com/onweru/compose","stargazers_count":116},"github.com/onweru/hugo-swift-theme":{"id":170762804,"name":"hugo-swift-theme","description":"A simple open source theme for publishing with hugo","html_url":"https://github.com/onweru/hugo-swift-theme","stargazers_count":97},"github.com/onweru/newsroom":{"id":202606752,"name":"newsroom","description":"A simple, minimalistic Hugo theme. View Demo here","html_url":"https://github.com/onweru/newsroom","stargazers_count":137},"github.com/orf/bare-hugo-theme":{"id":210163892,"name":"bare-hugo-theme","description":"A Hugo theme based on Bulma.io","html_url":"https://github.com/orf/bare-hugo-theme","stargazers_count":39},"github.com/pacollins/hugo-future-imperfect-slim":{"id":179867200,"name":"hugo-future-imperfect-slim","description":"Multilingual Blogging Theme for Hugo | Check the Wiki for Documentation","html_url":"https://github.com/pacollins/hugo-future-imperfect-slim","stargazers_count":256},"github.com/panr/hugo-theme-hello-friend":{"id":141738551,"name":"hugo-theme-hello-friend","description":"Pretty basic theme for Hugo that covers all of the essentials. All you have to do is start typing!","html_url":"https://github.com/panr/hugo-theme-hello-friend","stargazers_count":642},"github.com/panr/hugo-theme-terminal":{"id":167872853,"name":"hugo-theme-terminal","description":"A simple, retro theme for Hugo","html_url":"https://github.com/panr/hugo-theme-terminal","stargazers_count":918},"github.com/parsiya/Hugo-Octopress":{"id":50900827,"name":"Hugo-Octopress","description":"Port of the classic Octopress theme to Hugo","html_url":"https://github.com/parsiya/Hugo-Octopress","stargazers_count":101},"github.com/pdevty/material-design":{"id":35676282,"name":"material-design","description":"Simple Material Design Theme for Hugo","html_url":"https://github.com/pdevty/material-design","stargazers_count":59},"github.com/pdevty/polymer":{"id":38299186,"name":"polymer","description":"Polymer Material Design Theme for Hugo","html_url":"https://github.com/pdevty/polymer","stargazers_count":22},"github.com/peaceiris/hugo-theme-iris":{"id":142685900,"name":"hugo-theme-iris","description":"Hugo IRIS Theme - Portfolio and Blog","html_url":"https://github.com/peaceiris/hugo-theme-iris","stargazers_count":32},"github.com/plopcas/papaya":{"id":236103215,"name":"papaya","description":"Minimalist Hugo theme with social buttons and analytics.","html_url":"https://github.com/plopcas/papaya","stargazers_count":11},"github.com/pravin/hugo-theme-prav":{"id":230786786,"name":"hugo-theme-prav","description":"Custom theme for gohugo static site generator","html_url":"https://github.com/pravin/hugo-theme-prav","stargazers_count":10},"github.com/progrhyme/hugo-theme-bootie-docs":{"id":34202318,"name":"hugo-theme-bootie-docs","description":"A simple Hugo theme for documentation","html_url":"https://github.com/progrhyme/hugo-theme-bootie-docs","stargazers_count":50},"github.com/qqhann/hugo-primer":{"id":134553022,"name":"hugo-primer","description":"Hugo theme based on GitHub's Primer CSS","html_url":"https://github.com/qqhann/hugo-primer","stargazers_count":106},"github.com/radity/raditian-free-hugo-theme":{"id":229935377,"name":"raditian-free-hugo-theme","description":"Raditian Hugo Theme for Personal Websites","html_url":"https://github.com/radity/raditian-free-hugo-theme","stargazers_count":148},"github.com/reuixiy/hugo-theme-meme":{"id":201855709,"name":"hugo-theme-meme","description":"You can’t spell aWEsoME without MEME! 😝","html_url":"https://github.com/reuixiy/hugo-theme-meme","stargazers_count":529},"github.com/rhazdon/hugo-theme-hello-friend-ng":{"id":167668309,"name":"hugo-theme-hello-friend-ng","description":"Pretty basic theme for Hugo that covers all of the essentials. All you have to do is start typing!","html_url":"https://github.com/rhazdon/hugo-theme-hello-friend-ng","stargazers_count":971},"github.com/ribice/kiss":{"id":108032467,"name":"kiss","description":"Stupidly simple Hugo blogging theme","html_url":"https://github.com/ribice/kiss","stargazers_count":274},"github.com/runningstream/hugograyscale":{"id":148952560,"name":"hugograyscale","description":"A multi-section single page theme intended as a landing page. This is derived from the startbootstrap-grayscale theme.","html_url":"https://github.com/runningstream/hugograyscale","stargazers_count":31},"github.com/saey55/hugo-elate-theme":{"id":74140600,"name":"hugo-elate-theme","description":"A one page parallax theme with animation for Hugo","html_url":"https://github.com/saey55/hugo-elate-theme","stargazers_count":172},"github.com/salcan/BeyondNothing":{"id":135865634,"name":"BeyondNothing","description":"Hugo Theme","html_url":"https://github.com/salcan/BeyondNothing","stargazers_count":14},"github.com/salsysd/hugo-assembly":{"id":139225614,"name":"hugo-assembly","description":"Assembly - a hugo theme","html_url":"https://github.com/salsysd/hugo-assembly","stargazers_count":5},"github.com/schmanat/hugo-highlights-theme":{"id":60331934,"name":"hugo-highlights-theme","description":"a one page layout for gohugo.io","html_url":"https://github.com/schmanat/hugo-highlights-theme","stargazers_count":25},"github.com/schollz/onetwothree":{"id":109300927,"name":"onetwothree","description":"A responsive minimalist theme for Hugo that is simple as 1, 2, 3","html_url":"https://github.com/schollz/onetwothree","stargazers_count":40},"github.com/seanlane/gochowdown":{"id":166714507,"name":"gochowdown","description":"Hugo theme based on the Jekyll chowdown theme","html_url":"https://github.com/seanlane/gochowdown","stargazers_count":49},"github.com/serg/yourfolio":{"id":135719431,"name":"yourfolio","description":":star: Super simple and responsive theme for your personal website on Hugo","html_url":"https://github.com/serg/yourfolio","stargazers_count":24},"github.com/shaform/hugo-theme-den":{"id":141029583,"name":"hugo-theme-den","description":"A Simple Theme for Hugo","html_url":"https://github.com/shaform/hugo-theme-den","stargazers_count":21},"github.com/shankar/hugo-grapes":{"id":154260863,"name":"hugo-grapes","description":"A minimalistic text based theme for Hugo with grapes color theme","html_url":"https://github.com/shankar/hugo-grapes","stargazers_count":8},"github.com/shenoybr/hugo-goa":{"id":70299290,"name":"hugo-goa","description":"Simple Minimalistic Theme for Hugo","html_url":"https://github.com/shenoybr/hugo-goa","stargazers_count":212},"github.com/siegerts/hugo-theme-basic":{"id":168743880,"name":"hugo-theme-basic","description":"Basic site theme styled with minimal tachyons, syntax highlighting, and blog series configuration. 📦","html_url":"https://github.com/siegerts/hugo-theme-basic","stargazers_count":94},"github.com/softwareyoga/ronu-hugo-theme":{"id":244429027,"name":"ronu-hugo-theme","description":"Clean and simple responsive theme for Hugo with complete separation of html content and css classes.","html_url":"https://github.com/softwareyoga/ronu-hugo-theme","stargazers_count":2},"github.com/spaghettiwews/hugonews":{"id":213632806,"name":"hugonews","description":"hugo theme (based on https://news.ycombinator.com) for https://bookmarks.wews.co.zw","html_url":"https://github.com/spaghettiwews/hugonews","stargazers_count":43},"github.com/spech66/bootstrap-bp-hugo-startpage":{"id":198188726,"name":"bootstrap-bp-hugo-startpage","description":"Bootstrap based Hugo startpage theme which provides out of the box best practices.","html_url":"https://github.com/spech66/bootstrap-bp-hugo-startpage","stargazers_count":39},"github.com/spech66/bootstrap-bp-hugo-theme":{"id":155002736,"name":"bootstrap-bp-hugo-theme","description":"Bootstrap based Hugo theme which provides out of the box best practices.","html_url":"https://github.com/spech66/bootstrap-bp-hugo-theme","stargazers_count":36},"github.com/spech66/materialize-bp-hugo-theme":{"id":210044768,"name":"materialize-bp-hugo-theme","description":"MaterializeCSS based Hugo theme which provides out of the box best practices.","html_url":"https://github.com/spech66/materialize-bp-hugo-theme","stargazers_count":15},"github.com/spf13/hyde":{"id":20112077,"name":"hyde","description":"Port of Mdo's excellent theme to Hugo","html_url":"https://github.com/spf13/hyde","stargazers_count":449},"github.com/spookey/slick":{"id":161045594,"name":"slick","description":"A fast, minimal, responsive theme for Hugo which honours your privacy","html_url":"https://github.com/spookey/slick","stargazers_count":41},"github.com/st-wong/hugo-spectre-pixel-theme":{"id":208091530,"name":"hugo-spectre-pixel-theme","description":"","html_url":"https://github.com/st-wong/hugo-spectre-pixel-theme","stargazers_count":16},"github.com/sudorook/capsule":{"id":105379544,"name":"capsule","description":"A Hugo theme based on the CSS-only Bulma framework.","html_url":"https://github.com/sudorook/capsule","stargazers_count":19},"github.com/surajmandalcell/potato-dark":{"id":126984930,"name":"potato-dark","description":"Dark and elegant blog theme for goHugo static site generator.","html_url":"https://github.com/surajmandalcell/potato-dark","stargazers_count":20},"github.com/syui/hugo-theme-air":{"id":39655060,"name":"hugo-theme-air","description":"cname : syui.cf","html_url":"https://github.com/syui/hugo-theme-air","stargazers_count":112},"github.com/syui/hugo-theme-wave":{"id":60361500,"name":"hugo-theme-wave","description":"","html_url":"https://github.com/syui/hugo-theme-wave","stargazers_count":13},"github.com/taikii/whiteplain":{"id":115015872,"name":"whiteplain","description":"Simple and Functional Hugo theme.","html_url":"https://github.com/taikii/whiteplain","stargazers_count":79},"github.com/tastaturtier/someparts-hugo":{"id":239798818,"name":"someparts-hugo","description":"easy to use Hugo theme to present some (up to 10) parts of a collection","html_url":"https://github.com/tastaturtier/someparts-hugo","stargazers_count":1},"github.com/tblyler/light-hugo":{"id":72703646,"name":"light-hugo","description":"","html_url":"https://github.com/tblyler/light-hugo","stargazers_count":8},"github.com/tcgriffith/hugo-owaraiclub":{"id":217840277,"name":"hugo-owaraiclub","description":"A hugo theme inspired by yihui's hugo-xmag","html_url":"https://github.com/tcgriffith/hugo-owaraiclub","stargazers_count":0},"github.com/the2ne/hugo-frais":{"id":70173187,"name":"hugo-frais","description":"A fresh and french theme for Hugo","html_url":"https://github.com/the2ne/hugo-frais","stargazers_count":9},"github.com/themefisher/Academia-hugo":{"id":194812951,"name":"academia-hugo","description":"Academia Hugo theme is fork from Hugo Academic Template. ","html_url":"https://github.com/themefisher/academia-hugo","stargazers_count":100},"github.com/themefisher/Hargo-hugo-ecommerce-theme":{"id":216307747,"name":"hargo-hugo-ecommerce-theme","description":"Hugo E-commerce theme","html_url":"https://github.com/themefisher/hargo-hugo-ecommerce-theme","stargazers_count":65},"github.com/themefisher/Influencer-hugo":{"id":223705845,"name":"influencer-hugo","description":"","html_url":"https://github.com/gethugothemes/influencer-hugo","stargazers_count":50},"github.com/themefisher/airspace-hugo":{"id":116877994,"name":"airspace-hugo","description":"Airspace theme (Hugo version)","html_url":"https://github.com/themefisher/airspace-hugo","stargazers_count":217},"github.com/themefisher/educenter-hugo":{"id":234871946,"name":"educenter-hugo","description":"Educenter is an educational website template. It can be used as an online teaching platform, school and university websites","html_url":"https://github.com/themefisher/educenter-hugo","stargazers_count":109},"github.com/themefisher/infinity-hugo":{"id":139710343,"name":"infinity-hugo","description":"Infinity Coming Soon Template Hugo Version by themefisher","html_url":"https://github.com/gethugothemes/infinity-hugo","stargazers_count":33},"github.com/themefisher/kross-hugo-portfolio-template":{"id":186375954,"name":"kross-hugo","description":"Kross Creative Portfolio Template","html_url":"https://github.com/themefisher/kross-hugo","stargazers_count":187},"github.com/themefisher/liva-hugo":{"id":218447108,"name":"liva-hugo","description":"Hugo personal blog template","html_url":"https://github.com/gethugothemes/liva-hugo","stargazers_count":126},"github.com/themefisher/meghna-hugo":{"id":148452767,"name":"meghna-hugo","description":"Meghna Hugo is a responsive one-page business template built with HTML5/CSS3, Hugo, JavaScript, and JQuery. The template is minimalist, lightweight, and fast loading.","html_url":"https://github.com/themefisher/meghna-hugo","stargazers_count":275},"github.com/themefisher/navigator-hugo":{"id":140158023,"name":"navigator-hugo","description":"Navigator Template Hugo Version by themefisher . ","html_url":"https://github.com/gethugothemes/navigator-hugo","stargazers_count":100},"github.com/themefisher/northendlab-hugo":{"id":221671211,"name":"northendlab-hugo","description":"Hugo blog template.","html_url":"https://github.com/gethugothemes/northendlab-hugo","stargazers_count":79},"github.com/themefisher/parsa-hugo-personal-blog-theme":{"id":186784209,"name":"parsa-hugo","description":"Parsa hugo","html_url":"https://github.com/themefisher/parsa-hugo","stargazers_count":98},"github.com/themefisher/restaurant-hugo":{"id":176082710,"name":"restaurant-hugo","description":"","html_url":"https://github.com/gethugothemes/restaurant-hugo","stargazers_count":35},"github.com/themefisher/timer-hugo":{"id":141016867,"name":"timer-hugo","description":"Timer Template Hugo Version by themefisher","html_url":"https://github.com/themefisher/timer-hugo","stargazers_count":108},"github.com/themefisher/vex-hugo":{"id":116875532,"name":"vex-hugo","description":"Vex is a product landing page theme/template created by Themefisher based on the latest Bootstrap 4 framework. It is fully responsive and beautifully crafted with Product Showcase, Testimonials, and Email Subscription sections","html_url":"https://github.com/themefisher/vex-hugo","stargazers_count":105},"github.com/thingsym/hugo-theme-techdoc":{"id":123775108,"name":"hugo-theme-techdoc","description":"The Techdoc is a Hugo Theme for technical documentation.","html_url":"https://github.com/thingsym/hugo-theme-techdoc","stargazers_count":125},"github.com/thomasheller/crab":{"id":85394186,"name":"crab","description":"Crab theme for Hugo","html_url":"https://github.com/thomasheller/crab","stargazers_count":28},"github.com/tnwhitwell/hugo-startpage-theme":{"id":130674383,"name":"hugo-startpage-theme","description":"Hugo start page theme, link listing built from yaml","html_url":"https://github.com/whi-tw/hugo-startpage-theme","stargazers_count":19},"github.com/tosi29/inkblotty":{"id":176526148,"name":"inkblotty","description":"Responsive Hugo theme based on Inkblot of WordPress theme","html_url":"https://github.com/tosi29/inkblotty","stargazers_count":29},"github.com/tummychow/lanyon-hugo":{"id":17736776,"name":"lanyon-hugo","description":"Port of poole/lanyon, to spf13/hugo","html_url":"https://github.com/tummychow/lanyon-hugo","stargazers_count":148},"github.com/uicardiodev/hugo-lime":{"id":146114676,"name":"hugo-lime","description":"Hugo Lime is a business theme for GoHugo by https://uicard.io","html_url":"https://github.com/uicardioHQ/hugo-lime","stargazers_count":31},"github.com/uicardiodev/hugo-sodium-theme":{"id":138964395,"name":"hugo-sodium-theme","description":"","html_url":"https://github.com/uicardioHQ/hugo-sodium-theme","stargazers_count":38},"github.com/uicardiodev/hugo-uilite":{"id":149754509,"name":"hugo-uilite","description":"","html_url":"https://github.com/uicardioHQ/hugo-uilite","stargazers_count":81},"github.com/vaga/hugo-theme-m10c":{"id":166530704,"name":"hugo-theme-m10c","description":"A minimalistic (m10c) blog theme for Hugo","html_url":"https://github.com/vaga/hugo-theme-m10c","stargazers_count":251},"github.com/vickylaixy/hugo-theme-introduction":{"id":84793453,"name":"hugo-theme-introduction","description":"Minimal, single page, smooth-scrolling theme for Hugo static site generator.","html_url":"https://github.com/victoriadrake/hugo-theme-introduction","stargazers_count":478},"github.com/vimux/blank":{"id":70945463,"name":"blank","description":"Starter Hugo theme for use as a template for building custom themes","html_url":"https://github.com/Vimux/blank","stargazers_count":133},"github.com/vividvilla/ezhil":{"id":180448275,"name":"ezhil","description":"Clean and minimal personal blog theme for Hugo","html_url":"https://github.com/vividvilla/ezhil","stargazers_count":295},"github.com/wd/hugo-fabric":{"id":84308055,"name":"hugo-fabric","description":"Hugo Fabric Theme","html_url":"https://github.com/wd/hugo-fabric","stargazers_count":10},"github.com/wileybaba/hugo-theme-robotico":{"id":155506907,"name":"hugo-theme-robotico","description":"A minimal hugo theme based on Ala Geek","html_url":"https://github.com/wileybaba/hugo-theme-robotico","stargazers_count":4},"github.com/xaprb/story":{"id":129561419,"name":"story","description":"Beautiful responsive Hugo blog theme focused on simplicity and elegance, with many extra features including presentations, math typesetting, music notation, and search.","html_url":"https://github.com/xaprb/story","stargazers_count":142},"github.com/xaviablaza/hugo-lodi-theme":{"id":107000399,"name":"hugo-lodi-theme","description":"Lodi theme for Hugo","html_url":"https://github.com/xaviablaza/hugo-lodi-theme","stargazers_count":42},"github.com/xianmin/hugo-theme-jane":{"id":124070868,"name":"hugo-theme-jane","description":"A readable \u0026 concise theme for Hugo","html_url":"https://github.com/xianmin/hugo-theme-jane","stargazers_count":685},"github.com/xiaoheiAh/hugo-theme-pure":{"id":211669990,"name":"hugo-theme-pure","description":"A pure theme for Hugo","html_url":"https://github.com/xiaoheiAh/hugo-theme-pure","stargazers_count":218},"github.com/yanlinlin82/simple-style":{"id":226006502,"name":"simple-style","description":"My simple style hugo theme, based on \u003chttps://yanlinlin82.github.io/webpage-templates/simple-style/index.html\u003e","html_url":"https://github.com/yanlinlin82/simple-style","stargazers_count":18},"github.com/yihui/hugo-xmag":{"id":96737943,"name":"hugo-xmag","description":"A minimal magazine theme for Hugo","html_url":"https://github.com/yihui/hugo-xmag","stargazers_count":52},"github.com/yihui/hugo-xmin":{"id":94504324,"name":"hugo-xmin","description":"eXtremely Minimal Hugo theme: about 150 lines of code in total, including HTML and CSS (with no dependencies)","html_url":"https://github.com/yihui/hugo-xmin","stargazers_count":363},"github.com/yursan9/manis-hugo-theme":{"id":95275397,"name":"manis-hugo-theme","description":"Sweet little Hugo's theme for personal website","html_url":"https://github.com/yursan9/manis-hugo-theme","stargazers_count":70},"github.com/zhaohuabing/hugo-theme-cleanwhite":{"id":137584400,"name":"hugo-theme-cleanwhite","description":"A clean, elegant blog theme for hugo","html_url":"https://github.com/zhaohuabing/hugo-theme-cleanwhite","stargazers_count":304},"github.com/zhe/hugo-theme-slim":{"id":34523524,"name":"hugo-theme-slim","description":"Hugo theme—Slim","html_url":"https://github.com/zhe/hugo-theme-slim","stargazers_count":103},"github.com/zwbetz-gh/cayman-hugo-theme":{"id":177856819,"name":"cayman-hugo-theme","description":"Cayman is a clean, responsive theme for Hugo, ported from the original Jekyll Cayman Theme.","html_url":"https://github.com/zwbetz-gh/cayman-hugo-theme","stargazers_count":27},"github.com/zwbetz-gh/cupper-hugo-theme":{"id":168213023,"name":"cupper-hugo-theme","description":"An accessibility-friendly Hugo theme, ported from the original Cupper project.","html_url":"https://github.com/zwbetz-gh/cupper-hugo-theme","stargazers_count":188},"github.com/zwbetz-gh/minimal-bootstrap-hugo-theme":{"id":152019350,"name":"minimal-bootstrap-hugo-theme","description":"A minimal hugo theme made with bootstrap","html_url":"https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme","stargazers_count":70},"github.com/zwbetz-gh/papercss-hugo-theme":{"id":171948828,"name":"papercss-hugo-theme","description":"A Hugo theme made with PaperCSS, the less formal CSS framework.","html_url":"https://github.com/zwbetz-gh/papercss-hugo-theme","stargazers_count":61},"github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme":{"id":161877248,"name":"vanilla-bootstrap-hugo-theme","description":"A vanilla Bootstrap theme for Hugo","html_url":"https://github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme","stargazers_count":57},"github.com/zzossig/hugo-theme-zdoc":{"id":236982100,"name":"hugo-theme-zdoc","description":"Make a documentation with hugo zdoc theme!","html_url":"https://github.com/zzossig/hugo-theme-zdoc","stargazers_count":126},"github.com/zzossig/hugo-theme-zzo":{"id":219504135,"name":"hugo-theme-zzo","description":"Make a blog with hugo zzo theme!","html_url":"https://github.com/zzossig/hugo-theme-zzo","stargazers_count":513},"github.com/zzzmisa/hugo-theme-doors":{"id":200673663,"name":"hugo-theme-doors","description":"🚪Single page theme for links to your works","html_url":"https://github.com/zzzmisa/hugo-theme-doors","stargazers_count":10},"gitlab.com/VincentTam/huginn":{"id":0,"name":"","description":"","html_url":"","stargazers_count":0},"gitlab.com/kskarthik/monopriv":{"id":0,"name":"","description":"","html_url":"","stargazers_count":0},"gitlab.com/kskarthik/resto-hugo":{"id":0,"name":"","description":"","html_url":"","stargazers_count":0}} \ No newline at end of file diff --git a/cmd/hugothemesitebuilder/build/go.mod b/cmd/hugothemesitebuilder/build/go.mod index 9ce62d4..386a562 100644 --- a/cmd/hugothemesitebuilder/build/go.mod +++ b/cmd/hugothemesitebuilder/build/go.mod @@ -1,4 +1,4 @@ -module github.com/gohugoio/hugoThemeSiteBuilder/cmd/hugothemesitebuilder/build +module github.com/gohugoio/hugoThemesSiteBuilder/cmd/hugothemesitebuilder/build go 1.16 diff --git a/pkg/buildcmd/build.go b/pkg/buildcmd/build.go index 7b3e235..d20da73 100644 --- a/pkg/buildcmd/build.go +++ b/pkg/buildcmd/build.go @@ -3,8 +3,19 @@ package buildcmd import ( "context" "flag" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "path/filepath" + "regexp" + "strings" + "time" + "github.com/gohugoio/hugoThemesSiteBuilder/pkg/client" "github.com/peterbourgon/ff/v3/ffcli" + "gopkg.in/yaml.v3" "github.com/gohugoio/hugoThemesSiteBuilder/pkg/rootcmd" ) @@ -36,15 +47,12 @@ func New(rootConfig *rootcmd.Config) *ffcli.Command { // Exec function for this command. func (c *Config) Exec(ctx context.Context, args []string) error { const configAll = "config.json" - client := c.rootConfig.Client + client := &buildClient{Client: c.rootConfig.Client} if err := client.CreateThemesConfig(); err != nil { return err } - if true { - return nil - } if !client.OutFileExists("go.mod") { // Initialize the Hugo Module if err := client.InitModule(configAll); err != nil { @@ -57,10 +65,148 @@ func (c *Config) Exec(ctx context.Context, args []string) error { return err } - if err := client.WriteThemesContent(mmap); err != nil { + if err := client.writeThemesContent(mmap); err != nil { return err } return nil } + +type buildClient struct { + *client.Client + + mmap client.ModulesMap +} + +func (c *buildClient) writeThemesContent(mm client.ModulesMap) error { + githubrepos, err := c.GetGitHubRepos(mm) + if err != nil { + return err + } + maxStars := 0 + for _, ghRepo := range githubrepos { + if ghRepo.Stars > maxStars { + maxStars = ghRepo.Stars + } + } + + contentDir := c.JoinOutPath("site", "content") + client.CheckErr(os.RemoveAll(contentDir)) + client.CheckErr(os.MkdirAll(contentDir, 0777)) + + for k, m := range mm { + + themeName := strings.ToLower(path.Base(k)) + + themeDir := filepath.Join(contentDir, "themes", themeName) + client.CheckErr(os.MkdirAll(themeDir, 0777)) + + copyIfExists := func(sourcePath, targetPath string) { + fs, err := os.Open(filepath.Join(m.Dir, sourcePath)) + if err != nil { + return + } + defer fs.Close() + targetFilename := filepath.Join(themeDir, targetPath) + client.CheckErr(os.MkdirAll(filepath.Dir(targetFilename), 0777)) + ft, err := os.Create(targetFilename) + client.CheckErr(err) + defer ft.Close() + + _, err = io.Copy(ft, fs) + client.CheckErr(err) + } + + fixReadMeContent := func(s string) string { + // Tell Hugo not to process shortcode samples + s = regexp.MustCompile(`(?s){\{%([^\/].*?)%\}\}`).ReplaceAllString(s, `{{%/*$1*/%}}`) + s = regexp.MustCompile(`(?s){\{<([^\/].*?)>\}\}`).ReplaceAllString(s, `{{}}`) + + return s + } + + getReadMeContent := func() string { + files, err := os.ReadDir(m.Dir) + client.CheckErr(err) + for _, fi := range files { + if fi.IsDir() { + continue + } + if strings.EqualFold(fi.Name(), "readme.md") { + b, err := ioutil.ReadFile(filepath.Join(m.Dir, fi.Name())) + client.CheckErr(err) + return fixReadMeContent(string(b)) + } + } + return "" + } + + title := strings.Title(themeName) + readMeContent := getReadMeContent() + ghRepo := githubrepos[m.Path] + + // 30 days. + d30 := 30 * 24 * time.Hour + const boost = 50 + + // Higher is better. + weight := maxStars + 500 + weight -= ghRepo.Stars + // Boost themes updated recently. + if !m.Time.IsZero() { + // Add some weight to recently updated themes. + age := time.Since(m.Time) + if age < (3 * d30) { + weight -= (boost * 2) + } else if age < (6 * d30) { + weight -= boost + } + } + + // Boost themes with a Hugo version indicator set that covers. + // the current Hugo version. + if m.HugoVersion.IsValid() { + weight -= boost + } + + // TODO(bep) we don't build any demo site anymore, but + // we could and should probably build a simple site and + // count warnings and error and use that to + // either pull it down the list with weight or skip it. + + //c.Logf("Processing theme %q with weight %d", themeName, weight) + + // TODO1 tags, normalized. + + frontmatter := map[string]interface{}{ + "title": title, + "slug": themeName, + "aliases": []string{"/" + themeName}, + "weight": weight, + "lastMod": m.Time, + "hugoVersion": m.HugoVersion, + "meta": m.Meta, + "githubInfo": ghRepo, + } + + b, err := yaml.Marshal(frontmatter) + client.CheckErr(err) + + content := fmt.Sprintf(`--- +%s +--- +%s +`, string(b), readMeContent) + + if err := ioutil.WriteFile(filepath.Join(themeDir, "index.md"), []byte(content), 0666); err != nil { + return err + } + + copyIfExists("images/tn.png", "tn-featured.png") + copyIfExists("images/screenshot.png", "screenshot.png") + + } + + return nil +} diff --git a/pkg/client/client.go b/pkg/client/client.go index 40c28b6..af6599c 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -10,15 +10,13 @@ import ( "net/http" "os" "os/exec" - "path" "path/filepath" - "regexp" "runtime" + "sort" + "strconv" "strings" "time" - "gopkg.in/yaml.v3" - "github.com/gohugoio/hugo/modules" ) @@ -122,168 +120,101 @@ func (c *Client) CreateThemesConfig() error { } +func (c *Client) JoinOutPath(elem ...string) string { + return filepath.Join(append([]string{c.outDir}, elem...)...) +} + func (c *Client) TimeTrack(start time.Time, name string) { elapsed := time.Since(start) fmt.Fprintf(c.logWriter, "%s in %v ms\n", name, int(1000*elapsed.Seconds())) } -func (c *Client) WriteThemesContent(mm ModulesMap) error { - githubrepos, err := c.GetGitHubRepos(mm) - if err != nil { - return err - } - maxStars := 0 - for _, ghRepo := range githubrepos { - if ghRepo.Stars > maxStars { - maxStars = ghRepo.Stars +const cacheFileSuffix = "githubrepos.json" + +// GetGitHubRepos will first look in the chache folder for GitHub repo +// information for mods. If not found, it will ask GitHub and then store +// it in the cache. +// +// If you start with an empty cache, you will need to set a GITHUB_TOKEN environment variable. +func (c *Client) GetGitHubRepos(mods ModulesMap) (map[string]GitHubRepo, error) { + cacheFiles := c.getGithubReposCacheFilesSorted() + m := make(map[string]GitHubRepo) + for _, cacheFile := range cacheFiles { + cacheFilename := filepath.Join(c.outDir, cacheDir, cacheFile) + b, err := ioutil.ReadFile(cacheFilename) + if err != nil { + return nil, err + } + + m2 := make(map[string]GitHubRepo) + if err = json.Unmarshal(b, &m2); err != nil { + return nil, err + } + + for k, v := range m2 { + m[k] = v + } } - contentDir := filepath.Join(c.outDir, "site", "content") - checkErr(os.RemoveAll(contentDir)) - checkErr(os.MkdirAll(contentDir, 0777)) - - for k, m := range mm { - - themeName := strings.ToLower(path.Base(k)) - - themeDir := filepath.Join(contentDir, "themes", themeName) - checkErr(os.MkdirAll(themeDir, 0777)) - - copyIfExists := func(sourcePath, targetPath string) { - fs, err := os.Open(filepath.Join(m.Dir, sourcePath)) - if err != nil { - return - } - defer fs.Close() - targetFilename := filepath.Join(themeDir, targetPath) - checkErr(os.MkdirAll(filepath.Dir(targetFilename), 0777)) - ft, err := os.Create(targetFilename) - checkErr(err) - defer ft.Close() - - _, err = io.Copy(ft, fs) - checkErr(err) + missing := ModulesMap{} + for k, v := range mods { + if _, found := m[k]; !found { + missing[k] = v } - - fixReadMeContent := func(s string) string { - // Tell Hugo not to process shortcode samples - s = regexp.MustCompile(`(?s){\{%([^\/].*?)%\}\}`).ReplaceAllString(s, `{{%/*$1*/%}}`) - s = regexp.MustCompile(`(?s){\{<([^\/].*?)>\}\}`).ReplaceAllString(s, `{{}}`) - - return s - } - - getReadMeContent := func() string { - files, err := os.ReadDir(m.Dir) - checkErr(err) - for _, fi := range files { - if fi.IsDir() { - continue - } - if strings.EqualFold(fi.Name(), "readme.md") { - b, err := ioutil.ReadFile(filepath.Join(m.Dir, fi.Name())) - checkErr(err) - return fixReadMeContent(string(b)) - } - } - return "" - } - - title := strings.Title(themeName) - readMeContent := getReadMeContent() - ghRepo := githubrepos[m.Path] - - // 30 days. - d30 := 30 * 24 * time.Hour - const boost = 50 - - // Higher is better. - weight := maxStars + 500 - weight -= ghRepo.Stars - // Boost themes updated recently. - if !m.Time.IsZero() { - // Add some weight to recently updated themes. - age := time.Since(m.Time) - if age < (3 * d30) { - weight -= (boost * 2) - } else if age < (6 * d30) { - weight -= boost - } - } - - // Boost themes with a Hugo version indicator set that covers. - // the current Hugo version. - if m.HugoVersion.IsValid() { - weight -= boost - } - - // TODO(bep) we don't build any demo site anymore, but - // we could and should probably build a simple site and - // count warnings and error and use that to - // either pull it down the list with weight or skip it. - - c.Logf("Processing theme %q with weight %d", themeName, weight) - - // TODO1 tags, normalized. - - frontmatter := map[string]interface{}{ - "title": title, - "slug": themeName, - "aliases": []string{"/" + themeName}, - "weight": weight, - "lastMod": m.Time, - "hugoVersion": m.HugoVersion, - "meta": m.Meta, - "githubInfo": ghRepo, - } - - b, err := yaml.Marshal(frontmatter) - checkErr(err) - - content := fmt.Sprintf(`--- -%s ---- -%s -`, string(b), readMeContent) - - if err := ioutil.WriteFile(filepath.Join(themeDir, "index.md"), []byte(content), 0666); err != nil { - return err - } - - copyIfExists("images/tn.png", "tn-featured.png") - copyIfExists("images/screenshot.png", "screenshot.png") - - return nil - } - return nil + if len(missing) > 0 { + cacheNum := 0 + if len(cacheFiles) > 0 { + last := cacheFiles[len(cacheFiles)-1] + cacheNum, _ = strconv.Atoi(last[:strings.Index(last, ".")]) + cacheNum++ + } + nextCacheFilename := filepath.Join(c.outDir, cacheDir, fmt.Sprintf("%0*d.%s", 4, cacheNum, cacheFileSuffix)) + m2, err := c.fetchGitHubRepos(mods) + if err != nil { + return nil, err + } + + b, err := json.Marshal(m2) + if err != nil { + return nil, err + } + + for k, v := range m2 { + m[k] = v + + } + + CheckErr(os.MkdirAll(filepath.Dir(nextCacheFilename), 0777)) + CheckErr(ioutil.WriteFile(nextCacheFilename, b, 0666)) + } + + return m, nil + } -func (c *Client) GetGitHubRepos(mods ModulesMap) (map[string]GitHubRepo, error) { - const cacheFile = "githubrepos.json" - cacheFilename := filepath.Join(c.outDir, cacheDir, cacheFile) - b, err := ioutil.ReadFile(cacheFilename) - if err == nil { - m := make(map[string]GitHubRepo) - err := json.Unmarshal(b, &m) - return m, err +func (c *Client) getGithubReposCacheFilesSorted() []string { + + fis, err := os.ReadDir(filepath.Join(c.outDir, cacheDir)) + CheckErr(err) + + var entries []string + + for _, fi := range fis { + if fi.IsDir() { + continue + } + + if strings.HasSuffix(fi.Name(), cacheFileSuffix) { + entries = append(entries, fi.Name()) + } } - m, err := c.fetchGitHubRepos(mods) - if err != nil { - return nil, err - } + sort.Strings(entries) - b, err = json.Marshal(m) - if err != nil { - return nil, err - } - - checkErr(os.MkdirAll(filepath.Dir(cacheFilename), 0777)) - - return m, ioutil.WriteFile(cacheFilename, b, 0666) + return entries } @@ -305,7 +236,7 @@ func (c *Client) fetchGitHubRepo(m Module) (GitHubRepo, error) { err = doGitHubRequest(req, &repo) if err != nil { - return repo, fmt.Errorf("failed to get GitHub repo for %q: %s", apiURL, err) + return repo, fmt.Errorf("failed to get GitHub repo for %q: %s. Set GITHUB_TOKEN if you get rate limiting errors.", apiURL, err) } return repo, nil } @@ -384,7 +315,7 @@ func addGitHubToken(req *http.Request) { } } -func checkErr(err error) { +func CheckErr(err error) { if err != nil { panic(err) }