diff --git a/blog/themes/tailwind/.gitignore b/blog/themes/tailwind/.gitignore new file mode 100644 index 000000000..eb1a2c123 --- /dev/null +++ b/blog/themes/tailwind/.gitignore @@ -0,0 +1,5 @@ +.vscode/ + +node_modules +public/build +yarn.lock diff --git a/blog/themes/tailwind/archetypes/default.md b/blog/themes/tailwind/archetypes/default.md new file mode 100644 index 000000000..f7e5e03d9 --- /dev/null +++ b/blog/themes/tailwind/archetypes/default.md @@ -0,0 +1,7 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +description: "" +date: {{ .Date }} +draft: true +tags: [] +--- diff --git a/blog/themes/tailwind/i18n/en.yaml b/blog/themes/tailwind/i18n/en.yaml new file mode 100644 index 000000000..8326be14a --- /dev/null +++ b/blog/themes/tailwind/i18n/en.yaml @@ -0,0 +1,5 @@ +- id: back_home + translation: "Back Home" + +- id: not_found_page_title + translation: "Whoops! The page you're looking for doesn't exist :(" diff --git a/blog/themes/tailwind/images/screenshot.png b/blog/themes/tailwind/images/screenshot.png new file mode 100644 index 000000000..3ca0b46b2 Binary files /dev/null and b/blog/themes/tailwind/images/screenshot.png differ diff --git a/blog/themes/tailwind/images/tn.png b/blog/themes/tailwind/images/tn.png new file mode 100644 index 000000000..785504cd0 Binary files /dev/null and b/blog/themes/tailwind/images/tn.png differ diff --git a/blog/themes/tailwind/layouts/404.html b/blog/themes/tailwind/layouts/404.html new file mode 100644 index 000000000..afa69fec7 --- /dev/null +++ b/blog/themes/tailwind/layouts/404.html @@ -0,0 +1,12 @@ +{{ define "heading"}} +
+ ← {{ i18n "back_home" }} +

{{ i18n "not_found_page_title" }}

+
+{{ end }} + +{{ define "content" }} +
+ Page Not Found +
+{{ end }} diff --git a/blog/themes/tailwind/layouts/_default/baseof.html b/blog/themes/tailwind/layouts/_default/baseof.html new file mode 100644 index 000000000..2e32b7537 --- /dev/null +++ b/blog/themes/tailwind/layouts/_default/baseof.html @@ -0,0 +1,86 @@ + + + + + + {{ hugo.Generator }} + + + + + + + + + + + + + + + + + + + + + + {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }} + + + + + + {{ with .OutputFormats.Get "RSS" }} + + {{ end }} + + + {{ if .IsTranslated }} + {{ range .Translations }} + + {{ end }} + {{ end }} + + + + + + + +
+
+ +
+ {{ block "heading" . }} +
+ {{ partial "back-home.html" . }} +

{{ .Title }}

+
+ {{ end }} +
+ + + {{ if .IsTranslated }} + + {{ end }} +
+ + + {{ block "content" . }}{{ end }} + + +
+ + {{ template "_internal/google_analytics.html" . }} + + diff --git a/blog/themes/tailwind/layouts/_default/list.html b/blog/themes/tailwind/layouts/_default/list.html new file mode 100644 index 000000000..d781ce752 --- /dev/null +++ b/blog/themes/tailwind/layouts/_default/list.html @@ -0,0 +1,7 @@ +{{ define "content" }} +
+ {{ range site.RegularPages.GroupByDate "2006" -}} + {{ partial "posts.html" . }} + {{ end }} +
+{{ end }} diff --git a/blog/themes/tailwind/layouts/_default/single.html b/blog/themes/tailwind/layouts/_default/single.html new file mode 100644 index 000000000..e4485f324 --- /dev/null +++ b/blog/themes/tailwind/layouts/_default/single.html @@ -0,0 +1,28 @@ +{{ define "heading" }} +
+ {{ partial "back-home.html" . }} + + +

{{ .Title }}

+ + + + {{ with .Params.tags }} +
    + {{ range . }} +
  1. + {{ . }} +
  2. + {{ end }} +
+ {{ end }} +
+{{ end }} + +{{ define "content" }} +
+ {{ .Content }} + + {{ template "_internal/disqus.html" . }} +
+{{ end }} diff --git a/blog/themes/tailwind/layouts/index.html b/blog/themes/tailwind/layouts/index.html new file mode 100644 index 000000000..4869c466b --- /dev/null +++ b/blog/themes/tailwind/layouts/index.html @@ -0,0 +1,18 @@ +{{ define "heading" }} +{{ if .Site.Params.Avatar }} + +{{ end }} + +
+

{{ .Site.Title }}

+

{{ .Site.Params.tagline }}

+
+{{ end }} + +{{ define "content" }} +
+ {{ range site.RegularPages.GroupByDate "2006" -}} + {{ partial "posts.html" . }} + {{ end }} +
+{{ end }} diff --git a/blog/themes/tailwind/layouts/partials/back-home.html b/blog/themes/tailwind/layouts/partials/back-home.html new file mode 100644 index 000000000..4064d5256 --- /dev/null +++ b/blog/themes/tailwind/layouts/partials/back-home.html @@ -0,0 +1 @@ +← {{ i18n "back_home" }} diff --git a/blog/themes/tailwind/layouts/partials/posts.html b/blog/themes/tailwind/layouts/partials/posts.html new file mode 100644 index 000000000..0ebd4ca7e --- /dev/null +++ b/blog/themes/tailwind/layouts/partials/posts.html @@ -0,0 +1,12 @@ +
+

{{ .Key }}

+ +
    + {{ range .Pages -}} +
  1. + + {{ .Title }} +
  2. + {{- end }} +
+
diff --git a/blog/themes/tailwind/layouts/taxonomy/terms.html b/blog/themes/tailwind/layouts/taxonomy/terms.html new file mode 100644 index 000000000..76da49ed0 --- /dev/null +++ b/blog/themes/tailwind/layouts/taxonomy/terms.html @@ -0,0 +1,13 @@ +{{ define "content" }} +
+
    + {{ range .Pages -}} +
  1. + + {{ .Title }} + +
  2. + {{- end }} +
+
+{{ end }} diff --git a/blog/themes/tailwind/license.md b/blog/themes/tailwind/license.md new file mode 100644 index 000000000..196326bb0 --- /dev/null +++ b/blog/themes/tailwind/license.md @@ -0,0 +1,7 @@ +Copyright 2019 Ian Rodrigues. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/blog/themes/tailwind/package.json b/blog/themes/tailwind/package.json new file mode 100644 index 000000000..86bb50f94 --- /dev/null +++ b/blog/themes/tailwind/package.json @@ -0,0 +1,17 @@ +{ + "scripts": { + "watch": "cross-env NODE_ENV=development postcss scss/theme.scss -o static/css/theme.css --watch", + "build": "cross-env NODE_ENV=production postcss scss/theme.scss -o static/css/theme.css" + }, + "dependencies": { + "autoprefixer": "^9.5.1", + "tailwindcss": "^1.0" + }, + "devDependencies": { + "@fullhuman/postcss-purgecss": "^1.2.0", + "concurrently": "^4.1.0", + "cross-env": "^5.2.0", + "cssnano": "^4.1.10", + "postcss-cli": "^6.1.2" + } +} diff --git a/blog/themes/tailwind/postcss.config.js b/blog/themes/tailwind/postcss.config.js new file mode 100644 index 000000000..6efcb774f --- /dev/null +++ b/blog/themes/tailwind/postcss.config.js @@ -0,0 +1,14 @@ +const purgecss = require('@fullhuman/postcss-purgecss')({ + content: ['./layouts/**/*.html'], + defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [] +}) + +module.exports = { + plugins: [ + require('tailwindcss'), + require('autoprefixer'), + ...process.env.NODE_ENV === 'production' + ? [purgecss, require('cssnano')] + : [] + ] +} diff --git a/blog/themes/tailwind/readme.md b/blog/themes/tailwind/readme.md new file mode 100644 index 000000000..cdb69a619 --- /dev/null +++ b/blog/themes/tailwind/readme.md @@ -0,0 +1,62 @@ +# TailwindCSS Journal + +_TailwindCSS Journal_ is a minimalist theme for [Hugo](https://gohugo.io) using [TailwindCSS](https://tailwindcss.com). + +Based on [Journal](https://dashdashzako.github.io/hugo-journal-demo/), it also focuses on improving reading experience with no fancy effect. + +It uses [Chroma](https://gohugo.io/content-management/syntax-highlighting/) for the syntaxic coloration of code snippets. + +Demo is available [here](https://ianrodrigues.github.io/hugo-tailwind-journal-demo/). + +## Installation + +Please refer to the [Hugo documentation](https://gohugo.io/themes/installing/). + +## Configuration + +A few parameters should be adjusted in the site config: + +```toml +baseURL = "https://username.github.io/" +disqusShortname = "username" +googleAnalytics = "UA-XXXXXXXXX-X" +title = "Tailwind Journal" +theme = "hugo-tailwind-journal" +pygmentsCodeFences = true +pygmentsUseClasses = true + +[taxonomies] + tag = "tags" + +[permalinks] + posts = "/posts/:year/:month/:title/" + +[params] + author = "John Doe" + avatar = "images/avatar.jpg" + description = "A minimalist journal template for Hugo using TailwindCSS." + tagline = "A minimalist journal template for Hugo using TailwindCSS." + +[languages] + [languages.en] + contentDir = "content/english" + languageCode = "en-us" + languageName = "🇺🇸 English" + weight = 1 + + [languages.pt-br] + contentDir = "content/portuguese" + description = "Um template minimalista para Hugo usando TailwindCSS." + languageCode = "pt-br" + languageName = "🇧🇷 Português" + tagline = "Um template minimalista para Hugo usando TailwindCSS." + weight = 2 + + [languages.de] + contentDir = "content/german" + description = "Eine minimalistische Journalvorlage für Hugo mit TailwindCSS." + languageCode = "de" + languageName = "🇩🇪 Deutsch" + tagline = "Eine minimalistische Journalvorlage für Hugo mit TailwindCSS." + weight = 3 +``` diff --git a/blog/themes/tailwind/scss/theme.scss b/blog/themes/tailwind/scss/theme.scss new file mode 100644 index 000000000..9da9261b6 --- /dev/null +++ b/blog/themes/tailwind/scss/theme.scss @@ -0,0 +1,51 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + @apply text-gray-800; +} + +h1, h2, h3, h4, h5, h6, strong { + @apply text-gray-900; +} + +article > p, ul, ol { + @apply text-lg tracking-wide; +} + +article > div, p, ul, ol, pre:not(:last-child) { + @apply mb-6; +} + +article > ol, ul { + @apply list-disc ml-8; +} + +article > li:not(:last-of-type) { + @apply mb-2; +} + +article p > code { + @apply p-1/2 bg-gray-400; +} + +article > h2 { + @apply text-2xl my-8 font-bold text-black; +} + +a { + @apply border-b border-black text-black; +} + +/* purgecss ignore */ +pre.chroma { + @apply p-4 overflow-x-auto font-mono text-lg; +} + +@screen md { + /* purgecss ignore */ + div.highlight { + @apply -mx-12; + } +} diff --git a/blog/themes/tailwind/static/css/chroma.dracula.css b/blog/themes/tailwind/static/css/chroma.dracula.css new file mode 100644 index 000000000..5e903f4fd --- /dev/null +++ b/blog/themes/tailwind/static/css/chroma.dracula.css @@ -0,0 +1 @@ +.chroma{color:#f8f8f2;background-color:#282a36}.chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}.chroma .lntable{border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block}.chroma .hl{display:block;width:100%;background-color:#ffc}.chroma .lnt{margin-right:.4em;padding:0 .4em 0 .4em;color:#7f7f7f}.chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em;color:#7f7f7f}.chroma .k{color:#ff79c6}.chroma .kc{color:#ff79c6}.chroma .kd{color:#8be9fd;font-style:italic}.chroma .kn{color:#ff79c6}.chroma .kp{color:#ff79c6}.chroma .kr{color:#ff79c6}.chroma .kt{color:#8be9fd}.chroma .na{color:#50fa7b}.chroma .nb{color:#8be9fd;font-style:italic}.chroma .nc{color:#50fa7b}.chroma .nf{color:#50fa7b}.chroma .nl{color:#8be9fd;font-style:italic}.chroma .nt{color:#ff79c6}.chroma .nv{color:#8be9fd;font-style:italic}.chroma .vc{color:#8be9fd;font-style:italic}.chroma .vg{color:#8be9fd;font-style:italic}.chroma .vi{color:#8be9fd;font-style:italic}.chroma .s{color:#f1fa8c}.chroma .sa{color:#f1fa8c}.chroma .sb{color:#f1fa8c}.chroma .sc{color:#f1fa8c}.chroma .dl{color:#f1fa8c}.chroma .sd{color:#f1fa8c}.chroma .s2{color:#f1fa8c}.chroma .se{color:#f1fa8c}.chroma .sh{color:#f1fa8c}.chroma .si{color:#f1fa8c}.chroma .sx{color:#f1fa8c}.chroma .sr{color:#f1fa8c}.chroma .s1{color:#f1fa8c}.chroma .ss{color:#f1fa8c}.chroma .m{color:#bd93f9}.chroma .mb{color:#bd93f9}.chroma .mf{color:#bd93f9}.chroma .mh{color:#bd93f9}.chroma .mi{color:#bd93f9}.chroma .il{color:#bd93f9}.chroma .mo{color:#bd93f9}.chroma .o{color:#ff79c6}.chroma .ow{color:#ff79c6}.chroma .c{color:#6272a4}.chroma .ch{color:#6272a4}.chroma .cm{color:#6272a4}.chroma .c1{color:#6272a4}.chroma .cs{color:#6272a4}.chroma .cp{color:#ff79c6}.chroma .cpf{color:#ff79c6}.chroma .gd{color:#8b080b}.chroma .ge{text-decoration:underline}.chroma .gh{font-weight:700}.chroma .gi{font-weight:700}.chroma .go{color:#44475a}.chroma .gu{font-weight:700}.chroma .gl{text-decoration:underline} diff --git a/blog/themes/tailwind/static/css/theme.css b/blog/themes/tailwind/static/css/theme.css new file mode 100644 index 000000000..4d9cc992f --- /dev/null +++ b/blog/themes/tailwind/static/css/theme.css @@ -0,0 +1 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}a{background-color:transparent}strong{font-weight:bolder}img{border-style:none}button,input{font-family:inherit;font-size:100%;line-height:1.15;margin:0;overflow:visible}button{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}legend{color:inherit;display:table;max-width:100%;white-space:normal}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}[hidden],template{display:none}html{box-sizing:border-box;font-family:sans-serif}*,:after,:before{box-sizing:inherit}h1,h2,p{margin:0}button{background:transparent;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}ol{list-style:none;margin:0;padding:0}html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{border:0 solid #e2e8f0}img{border-style:solid}input::-webkit-input-placeholder{color:#a0aec0}input::-moz-placeholder{color:#a0aec0}input:-ms-input-placeholder{color:#a0aec0}input::-ms-input-placeholder{color:#a0aec0}input::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input{padding:0;line-height:inherit;color:inherit}canvas,img{display:block;vertical-align:middle}img{max-width:100%;height:auto}.bg-gray-200{background-color:#edf2f7}.bg-gray-400{background-color:#cbd5e0}.hover\:bg-gray-600:hover{background-color:#718096}.border-blue-500{border-color:#4299e1}.rounded-sm{border-radius:.125rem}.rounded-full{border-radius:9999px}.border-none{border-style:none}.border-t-4{border-top-width:4px}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.font-serif{font-family:Arvo}.font-bold{font-weight:700}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mb-2{margin-bottom:.5rem}.mt-4{margin-top:1rem}.mr-6{margin-right:1.5rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-12{margin-bottom:3rem}.mb-24{margin-bottom:6rem}.p-6{padding:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.text-gray-800{color:#2d3748}.hover\:text-white:hover{color:#fff}.text-xs{font-size:.75rem}.text-lg{font-size:1.125rem}.text-3xl{font-size:1.875rem}.text-4xl{font-size:2.25rem}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.w-20{width:5rem}.w-full{width:100%}body{color:#2d3748}h1,h2,strong{color:#1a202c}article>p,ol{font-size:1.125rem;letter-spacing:.025em}article>div,ol,p{margin-bottom:1.5rem}article>ol{list-style-type:disc;margin-left:2rem}article>li:not(:last-of-type){margin-bottom:.5rem}article>h2{font-size:1.5rem;margin-top:2rem;margin-bottom:2rem;font-weight:700;color:#000}a{border-bottom-width:1px;border-color:#000;color:#000}pre.chroma{padding:1rem;overflow-x:auto;font-family:Source Code Pro;font-size:1.125rem}@media (min-width:768px){div.highlight{margin-left:-3rem;margin-right:-3rem}}@media (min-width:768px){.md\:block{display:block}.md\:flex{display:-webkit-box;display:flex}.md\:flex-row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.md\:items-center{-webkit-box-align:center;align-items:center}.md\:flex-l-24{-webkit-box-flex:0;flex:0 0 6rem}.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:ml-12{margin-left:3rem}.md\:px-0{padding-left:0;padding-right:0}.md\:w-2\/3{width:66.666667%}}@media (min-width:1280px){.xl\:w-2\/5{width:40%}} \ No newline at end of file diff --git a/blog/themes/tailwind/static/images/404-background.png b/blog/themes/tailwind/static/images/404-background.png new file mode 100644 index 000000000..4b945386a Binary files /dev/null and b/blog/themes/tailwind/static/images/404-background.png differ diff --git a/blog/themes/tailwind/tailwind.config.js b/blog/themes/tailwind/tailwind.config.js new file mode 100644 index 000000000..f3714704d --- /dev/null +++ b/blog/themes/tailwind/tailwind.config.js @@ -0,0 +1,18 @@ +module.exports = { + theme: { + extend: { + flex: { + 'l-24': '0 0 6rem' + }, + fontFamily: { + serif: ['Arvo'], + mono: ['Source Code Pro'] + }, + padding: { + '1/2': '0.125rem' + } + } + }, + variants: {}, + plugins: [], +} diff --git a/blog/themes/tailwind/theme.toml b/blog/themes/tailwind/theme.toml new file mode 100644 index 000000000..bfdefa716 --- /dev/null +++ b/blog/themes/tailwind/theme.toml @@ -0,0 +1,12 @@ +name = "Tailwind Journal" +license = "MIT" +licenselink = "https://github.com/ianrodrigues/hugo-tailwind-journal/blob/master/license.md" +description = "A minimalist journal template for Hugo using TailwindCSS." +homepage = "https://github.com/ianrodrigues/hugo-tailwind-journal" +tags = ["minimalist", "reading", "blog", "tailwindcss"] +features = ["blog"] +min_version = "0.54.0" + +[author] + name = "Ian Rodrigues" + homepage = "https://ianrodrigues.dev"