diff --git a/modules/blox-tailwind/assets/css/blocks/about.avatar.css b/modules/blox-tailwind/assets/css/blox/about.avatar.css similarity index 89% rename from modules/blox-tailwind/assets/css/blocks/about.avatar.css rename to modules/blox-tailwind/assets/css/blox/about.avatar.css index c8345c9f..daec0286 100644 --- a/modules/blox-tailwind/assets/css/blocks/about.avatar.css +++ b/modules/blox-tailwind/assets/css/blox/about.avatar.css @@ -15,23 +15,6 @@ object-fit: cover; } - - .portrait-title h2 { - font-size: 1.75em; - font-weight: 300; - - /* color: #000; */ - margin: 20px 0 10px; - } - - .portrait-title h3 { - font-size: 1rem; - font-weight: 300; - - /* color: rgba(0, 0, 0, 0.54); */ - margin: 0 0 10px; - } - .network-icon { display: inline-flex; flex-direction: row; diff --git a/modules/blox-tailwind/assets/css/blocks/all.css b/modules/blox-tailwind/assets/css/blox/all.css similarity index 56% rename from modules/blox-tailwind/assets/css/blocks/all.css rename to modules/blox-tailwind/assets/css/blox/all.css index f3b50c40..7e811773 100644 --- a/modules/blox-tailwind/assets/css/blocks/all.css +++ b/modules/blox-tailwind/assets/css/blox/all.css @@ -1 +1,2 @@ @import "about.avatar.css"; +@import "skills.css"; diff --git a/modules/blox-tailwind/assets/css/blox/skills.css b/modules/blox-tailwind/assets/css/blox/skills.css new file mode 100644 index 00000000..b038e428 --- /dev/null +++ b/modules/blox-tailwind/assets/css/blox/skills.css @@ -0,0 +1,58 @@ +/************************************************* + * Hugo Blox: Skills + **************************************************/ + +/* MOVED TO HTML */ +/*.skill-group-title {*/ +/* display: inline-block;*/ +/* margin-bottom: 15px;*/ +/* padding-bottom: 5px;*/ +/* border-bottom: 2px solid #c7c7c7;*/ +/* font-size: 1rem;*/ +/* line-height: 30px;*/ +/* font-weight: 600;*/ +/* text-transform: uppercase;*/ +/* letter-spacing: 1px;*/ +/*}*/ + +.skills-content { + margin-bottom: 15px; +} + +.skills-name { + margin-bottom: 6px; + color: #888; + font-size: 0.8rem; + letter-spacing: 1px; + text-transform: uppercase; +} + +.skills-description { + margin-bottom: 6px; + font-size: 0.7rem; + text-transform: none; +} + +.dark .skills-name { + color: #eee; +} + +.skills-icon { + margin-right: 0.5em; +} + +.skills-wrapper { + position: relative; + overflow: hidden; + width: 100%; + height: 10px; + border: 1px solid #a8e9e9; + border-radius: 10px; +} + +.skills-percent { + position: absolute; + width: 60%; + height: 10px; + background-color: #3cb5b5; +} diff --git a/modules/blox-tailwind/assets/css/main.css b/modules/blox-tailwind/assets/css/main.css new file mode 100644 index 00000000..d01845a7 --- /dev/null +++ b/modules/blox-tailwind/assets/css/main.css @@ -0,0 +1,3 @@ +.hbb-section { + @apply mb-10 last:mb-0; +} diff --git a/modules/blox-tailwind/assets/css/styles.css b/modules/blox-tailwind/assets/css/styles.css index d218acb0..30f81033 100644 --- a/modules/blox-tailwind/assets/css/styles.css +++ b/modules/blox-tailwind/assets/css/styles.css @@ -2,6 +2,7 @@ @import "./tailwind.css"; /*! Hugo Blox Components | https://hugoblox.com */ +@import "main.css"; @import "./components/all.css"; -@import "./blocks/all.css"; +@import "./blox/all.css"; @import "themes/default.css"; diff --git a/modules/blox-tailwind/assets/js/katex-config.js b/modules/blox-tailwind/assets/js/katex-config.js new file mode 100644 index 00000000..3c646d31 --- /dev/null +++ b/modules/blox-tailwind/assets/js/katex-config.js @@ -0,0 +1,11 @@ +document.addEventListener("DOMContentLoaded", function () { + renderMathInElement(document.body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + { left: "\\[", right: "\\]", display: true }, + ], + throwOnError: false, + }); +}); diff --git a/modules/blox-tailwind/data/icons.yaml b/modules/blox-tailwind/data/icons.yaml index b507426b..359d87b2 100644 --- a/modules/blox-tailwind/data/icons.yaml +++ b/modules/blox-tailwind/data/icons.yaml @@ -1,6 +1,9 @@ # Hugo Blox Builder Icon Library # Socials +at-symbol: + + github: instagram: facebook: @@ -39,3 +42,59 @@ python: + +# Chevrons +chevron-double-down: +chevron-double-left: +chevron-double-right: +chevron-double-up: +chevron-down: +chevron-left: +chevron-right: +chevron-up: +arrow-circle-left: +arrow-circle-right: + + +document-text: +document-duplicate: +folder: +folder-open: + +markdown: + +sparkles: +adjustments: + +translate: +pencil: +chat-alt: +warning: + +card: +folder-tree: +badge-check: +one: +collection: +variable: +chart-square-bar: +template: +server: + +camera: + + + +code-bracket: + + +chart-bar: + + +circle-stack: + + + +# Phosphor +cat: +person-simple-walk: diff --git a/modules/blox-tailwind/i18n/en.yaml b/modules/blox-tailwind/i18n/en.yaml index adb4a459..4d6637aa 100644 --- a/modules/blox-tailwind/i18n/en.yaml +++ b/modules/blox-tailwind/i18n/en.yaml @@ -114,6 +114,9 @@ # Experience widget +- id: experience + translation: Experience + - id: present translation: Present diff --git a/modules/blox-tailwind/i18n/zh.yaml b/modules/blox-tailwind/i18n/zh.yaml index 7d0b111e..9c8f7556 100644 --- a/modules/blox-tailwind/i18n/zh.yaml +++ b/modules/blox-tailwind/i18n/zh.yaml @@ -114,6 +114,9 @@ # Experience widget +- id: work_experience + translation: 工作经历 + - id: present translation: 现在 diff --git a/modules/blox-tailwind/layouts/_default/baseof.html b/modules/blox-tailwind/layouts/_default/baseof.html index fa3c1521..f4956fc8 100644 --- a/modules/blox-tailwind/layouts/_default/baseof.html +++ b/modules/blox-tailwind/layouts/_default/baseof.html @@ -2,17 +2,22 @@ {{ "" | safeHTML }} {{ printf "" (now | time.Format ":date_long") | safeHTML }} {{- $language_code := site.LanguageCode | default "en-us" -}} - {{ partial "site_head" . }}
-
+
{{ block "main" . }}{{ end }}
diff --git a/modules/blox-tailwind/layouts/partials/blocks/buttons.html b/modules/blox-tailwind/layouts/partials/blox/buttons.html similarity index 100% rename from modules/blox-tailwind/layouts/partials/blocks/buttons.html rename to modules/blox-tailwind/layouts/partials/blox/buttons.html diff --git a/modules/blox-tailwind/layouts/partials/blocks/collection.html b/modules/blox-tailwind/layouts/partials/blox/collection.html similarity index 100% rename from modules/blox-tailwind/layouts/partials/blocks/collection.html rename to modules/blox-tailwind/layouts/partials/blox/collection.html diff --git a/modules/blox-tailwind/layouts/partials/blox/experience.html b/modules/blox-tailwind/layouts/partials/blox/experience.html new file mode 100644 index 00000000..423e832d --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/blox/experience.html @@ -0,0 +1,108 @@ +{{/* Hugo Blox: Experience */}} +{{/* Documentation: https://hugoblox.com/blocks/ */}} +{{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $text := $block.content.text | emojify | $page.RenderString }} + +{{ $author := $block.content.username | default "admin" }} +{{ $person_page_path := (printf "/authors/%s" $author) }} +{{ $person_page := site.GetPage $person_page_path }} +{{ if not $person_page }} +{{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://docs.hugoblox.com/page-builder/#about " $person_page_path }} +{{end}} +{{ $person := $person_page.Params }} + + +
+ + + + + + + +
+ +{{ if $person.work }} +
+

{{ i18n "work_experience" | default "Experience" }}

+
    + {{ range $idx, $key := $person.work }} +
  1. + + + +

    {{.position}} + +

    + {{.company_name}} + +
    {{.summary | $page.RenderString}}
    + + {{ with $block.content.button }} + Download ZIP + {{ end }} + +
  2. + {{ end }} +
+
+{{ end }} + +{{ if $person.education }} +
+

{{ i18n "education" }}

+
    + {{ range $idx, $key := $person.education }} +
  1. + + + + +

    {{.area}} + +

    + {{.institution}} + +
    {{.summary | $page.RenderString}}
    + + {{ with .button }} + {{.label}} + {{ end }} + +
  2. + {{ end }} +
+
+{{ end }} + +
+ +
diff --git a/modules/blox-tailwind/layouts/partials/blox/languages.html b/modules/blox-tailwind/layouts/partials/blox/languages.html new file mode 100644 index 00000000..4cc455a8 --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/blox/languages.html @@ -0,0 +1,43 @@ +{{/* Hugo Blox: Languages */}} +{{/* Documentation: https://hugoblox.com/blocks/ */}} +{{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $author := $block.content.username | default "admin" }} + +{{ $person_page_path := (printf "/authors/%s" $author) }} +{{ $person_page := site.GetPage $person_page_path }} +{{ if not $person_page }} + {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your Skill block and create an associated author page if one does not already exist. See https://docs.hugoblox.com/page-builder/#about " $person_page_path }} +{{end}} +{{ $langs := $person_page.Params.languages }} + +
+ +
+ {{ $block.content.title | markdownify | emojify }} +
+ + {{ with $block.content.text }}

{{ . | markdownify | emojify }}

{{ end }} + +
+ {{ range $langs }} +
+
+ + + + + {{.percent}}% +
+ {{.name}} +
+ {{ end }} +
+ +
diff --git a/modules/blox-tailwind/layouts/partials/blocks/markdown.html b/modules/blox-tailwind/layouts/partials/blox/markdown.html similarity index 100% rename from modules/blox-tailwind/layouts/partials/blocks/markdown.html rename to modules/blox-tailwind/layouts/partials/blox/markdown.html diff --git a/modules/blox-tailwind/layouts/partials/blox/skills.html b/modules/blox-tailwind/layouts/partials/blox/skills.html new file mode 100644 index 00000000..d9171a5e --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/blox/skills.html @@ -0,0 +1,54 @@ +{{/* Hugo Blox: Skills */}} +{{/* Documentation: https://hugoblox.com/blocks/ */}} +{{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} + +{{/* Initialise */}} +{{ $page := .wcPage }} +{{ $block := .wcBlock }} +{{ $author := $block.content.username | default "admin" }} + +{{ $person_page_path := (printf "/authors/%s" $author) }} +{{ $person_page := site.GetPage $person_page_path }} +{{ if not $person_page }} +{{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your Skill block and create an associated author page if one does not already exist. See https://docs.hugoblox.com/page-builder/#about " $person_page_path }} +{{end}} +{{ $skills := $person_page.Params.skills }} + +
+ + {{ range $skills }} + {{ $color := .color | default "" }} + {{ $color_border := .color_border | default "" }} +
+
+ {{ .name | markdownify | emojify }} + {{ with .description }}

{{ . | markdownify | emojify }}

{{ end }} +
+ {{ range .items }} + {{ $pack := or .icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} + +
+ + {{ with .icon }} + + {{ partial "functions/get_icon" (dict "name" . "attributes" "style=\"height: 1em;\"") }} + + {{ end }} + + + {{ .name | markdownify | emojify }} + {{ with .description }}

{{ . | markdownify | emojify }}

{{ end }} +
+
+
+
+
+ {{ end }} +
+{{ end }} +
+ diff --git a/modules/blox-tailwind/layouts/partials/components/breadcrumb.html b/modules/blox-tailwind/layouts/partials/components/breadcrumb.html new file mode 100644 index 00000000..a80fda8a --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/components/breadcrumb.html @@ -0,0 +1,13 @@ +
+ {{- range .Ancestors.Reverse }} + {{- if not .IsHome }} + + {{- partial "functions/get_icon.html" (dict "name" "chevron-right" "attributes" "class=\"w-3.5 shrink-0\"") -}} + {{ end -}} + {{ end -}} +
+ {{- .LinkTitle -}} +
+
diff --git a/modules/blox-tailwind/layouts/partials/components/headers/floating-theme-toggler.html b/modules/blox-tailwind/layouts/partials/components/headers/floating-theme-toggler.html new file mode 100644 index 00000000..9d5e7797 --- /dev/null +++ b/modules/blox-tailwind/layouts/partials/components/headers/floating-theme-toggler.html @@ -0,0 +1,24 @@ +
+
+ +
+
diff --git a/modules/blox-tailwind/layouts/partials/navbar.html b/modules/blox-tailwind/layouts/partials/components/headers/navbar.html similarity index 100% rename from modules/blox-tailwind/layouts/partials/navbar.html rename to modules/blox-tailwind/layouts/partials/components/headers/navbar.html diff --git a/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html b/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html index 70f4d2dc..02bd6f7b 100644 --- a/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html +++ b/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html @@ -6,7 +6,7 @@ {{ $block := .block }} {{ $block_type := lower $block.block | default "markdown" }} -{{ $block_path := printf "blocks/%s.html" $block_type }} +{{ $block_path := printf "blox/%s.html" $block_type }} {{ if not (templates.Exists (printf "partials/%s" $block_path)) }} {{ errorf "%s uses a `%s` block but the `%s` block was not found at `layouts/partials/%s`" $block.File.Path $block_type $block_type $block_path }} {{ end }} @@ -93,7 +93,7 @@ {{ $widget_args := dict "wcPage" $page "wcBlock" $block "wcIdentifier" $hash_id }} {{ $css_classes := $block.design.css_class | default "" }} {{ $extra_attributes := "" }} -{{ $use_container := true }} +{{ $use_container := false }} {{ $columns := $block.design.columns | default "1" }} {{/* $use_cols := in (slice "collection" "experience" "accomplishments" "contact" "markdown" "tag_cloud" "portfolio" "skills") $block_type */}} {{ $use_cols := false }} @@ -115,7 +115,7 @@ {{end}} {{/* Dedicated child div for bg prevents parallax 100% height issue within new CSS grid page wrapper. */}} -
+
{{with $bg_video}}{{end}}
diff --git a/modules/blox-tailwind/layouts/partials/libraries.html b/modules/blox-tailwind/layouts/partials/libraries.html index f1ef97b2..5ac5ea94 100644 --- a/modules/blox-tailwind/layouts/partials/libraries.html +++ b/modules/blox-tailwind/layouts/partials/libraries.html @@ -41,8 +41,10 @@ {{ $katex_js = $katex_js | resources.Fingerprint "sha256" }} {{ $katex_render_js := resources.Get "dist/lib/katex/auto-render.min.js" }} - {{ $katex_render_js = $katex_render_js | resources.Fingerprint "sha256" }} - + {{ $katex_config_js := resources.Get "js/katex-config.js" }} + {{ $katex_config_js = $katex_config_js | resources.Minify }} + {{ $katex_bundle := slice $katex_render_js $katex_config_js | resources.Concat "js/katex-renderer.js" | resources.Fingerprint "sha256" }} + {{ $katex_fonts := resources.Match "dist/lib/katex/fonts/*" }} {{ range $katex_fonts }} {{ .Publish }} diff --git a/modules/blox-tailwind/package.json b/modules/blox-tailwind/package.json index 699758e3..21adae4f 100644 --- a/modules/blox-tailwind/package.json +++ b/modules/blox-tailwind/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@tailwindcss/nesting": "0.0.0-insiders.565cd3e", "katex": "^0.16.9", "markmap-autoloader": "^0.15.4", "mermaid": "^10.6.0", @@ -24,7 +25,7 @@ "url": "https://github.com/HugoBlox/hugo-blox-builder.git" }, "scripts": { - "build:blog": "npx tailwindcss -i ./assets/css/styles.css -o ../../starters/blog/assets/dist/wc.css --minify", + "build:styles": "npx tailwindcss -i ./assets/css/styles.css -o ../../starters/${HB_TPL}/assets/dist/wc.css --minify", "assets:dist": "vite build" }, "browserslist": "last 2 versions", diff --git a/modules/blox-tailwind/pnpm-lock.yaml b/modules/blox-tailwind/pnpm-lock.yaml index 0367c9db..f59df51a 100644 --- a/modules/blox-tailwind/pnpm-lock.yaml +++ b/modules/blox-tailwind/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@tailwindcss/nesting': + specifier: 0.0.0-insiders.565cd3e + version: 0.0.0-insiders.565cd3e(postcss@8.4.31) katex: specifier: ^0.16.9 version: 0.16.9 @@ -409,6 +412,15 @@ packages: resolution: {integrity: sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==} dev: false + /@tailwindcss/nesting@0.0.0-insiders.565cd3e(postcss@8.4.31): + resolution: {integrity: sha512-WhHoFBx19TnH/c+xLwT/sxei6+4RpdfiyG3MYXfmLaMsADmVqBkF7B6lDalgZD9YdM459MF7DtxVbWkOrV7IaQ==} + peerDependencies: + postcss: ^8.2.15 + dependencies: + postcss: 8.4.31 + postcss-nested: 5.0.6(postcss@8.4.31) + dev: false + /@tailwindcss/typography@0.5.10(tailwindcss@3.3.5): resolution: {integrity: sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==} peerDependencies: @@ -819,7 +831,6 @@ packages: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} hasBin: true - dev: true /cytoscape-cose-bilkent@4.1.0(cytoscape@3.26.0): resolution: {integrity: sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==} @@ -2654,6 +2665,16 @@ packages: yaml: 2.3.3 dev: true + /postcss-nested@5.0.6(postcss@8.4.31): + resolution: {integrity: sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.2.14 + dependencies: + postcss: 8.4.31 + postcss-selector-parser: 6.0.13 + dev: false + /postcss-nested@6.0.1(postcss@8.4.31): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} @@ -2689,7 +2710,6 @@ packages: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - dev: true /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} diff --git a/modules/blox-tailwind/postcss.config.js b/modules/blox-tailwind/postcss.config.js index aa2bb7ab..a805aa83 100644 --- a/modules/blox-tailwind/postcss.config.js +++ b/modules/blox-tailwind/postcss.config.js @@ -3,6 +3,7 @@ let tailwindConfig = process.env.HUGO_FILE_TAILWIND_CONFIG_JS || './tailwind.con module.exports = { plugins: { 'postcss-import': {}, + '@tailwindcss/nesting': {}, tailwindcss: {config: tailwindConfig}, autoprefixer: {}, }