diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..b601136 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,31 @@ +# Update the NODE_VERSION arg in docker-compose.yml to pick a Node version: 10, 12, 14 +ARG NODE_VERSION=14 +FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION} + +# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version. +ARG VARIANT=hugo +# VERSION can be either 'latest' or a specific version number +ARG VERSION=latest + +# Download Hugo +RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \ + rm -rf /var/lib/apt/lists/* && \ + case ${VERSION} in \ + latest) \ + export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\ + esac && \ + echo ${VERSION} && \ + wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-64bit.tar.gz && \ + tar xf ${VERSION}.tar.gz && \ + mv hugo /usr/bin/hugo + +# Hugo dev server port +EXPOSE 1313 + +# [Optional] Uncomment this section to install additional OS packages you may want. +# +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment if you want to install more global node packages +# RUN sudo -u node npm install -g diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4bf8a19 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,45 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo +{ + "name": "Hugo (Community)", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update VARIANT to pick hugo variant. + // Example variants: hugo, hugo_extended + // Rebuild the container if it already exists to update. + "VARIANT": "hugo_extended", + // Update VERSION to pick a specific hugo version. + // Example versions: latest, 0.73.0, 0,71.1 + // Rebuild the container if it already exists to update. + "VERSION": "latest", + // Update NODE_VERSION to pick the Node.js version: 12, 14 + "NODE_VERSION": "14", + } + }, + + // Set *default* container specific settings.json values on container create. + "settings": { + "html.format.templating": true, + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "bungcip.better-toml", + "davidanson.vscode-markdownlint" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 1313 + ], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node", + "features": { + "golang": "latest" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ebefdf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +public +resources +assets/jsconfig.json \ No newline at end of file diff --git a/assets/icons/brand-github.svg b/assets/icons/brand-github.svg new file mode 100644 index 0000000..1fe7e0b --- /dev/null +++ b/assets/icons/brand-github.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/brand-twitter.svg b/assets/icons/brand-twitter.svg new file mode 100644 index 0000000..17ab1b1 --- /dev/null +++ b/assets/icons/brand-twitter.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/scss/partials/menu.scss b/assets/scss/partials/menu.scss index 2c7ad74..1d612d1 100644 --- a/assets/scss/partials/menu.scss +++ b/assets/scss/partials/menu.scss @@ -201,3 +201,18 @@ } } } + +.social-menu { + list-style: none; + padding: 0%; + display: flex; + flex-direction: row; + gap: 10px; + + svg { + width: 24px; + height: 24px; + stroke: var(--body-text-color); + stroke-width: 1.33; + } +} diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..0e5283c --- /dev/null +++ b/config.yaml @@ -0,0 +1,147 @@ +module: + hugoVersion: + extended: true + min: "0.87.0" + +params: + mainSections: + - post + featuredImageField: image + rssFullContent: true + favicon: + + footer: + since: + customText: + + dateFormat: + published: Jan 02, 2006 + lastUpdated: Jan 02, 2006 15:04 MST + + sidebar: + emoji: + subtitle: + avatar: + enabled: true + local: true + src: img/avatar.png + + article: + math: false + toc: true + readingTime: true + license: + enabled: false + default: Licensed under CC BY-NC-SA 4.0 + + comments: + enabled: false + provider: disqus + + disqusjs: + shortname: + apiUrl: + apiKey: + admin: + adminLabel: + + utterances: + repo: + issueTerm: pathname + label: + + remark42: + host: + site: + locale: + + vssue: + platform: + owner: + repo: + clientId: + clientSecret: + autoCreateIssue: false + + # Waline client configuration see: https://waline.js.org/en/reference/client.html + waline: + serverURL: + lang: + visitor: + avatar: + emoji: + - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo + requiredMeta: + - name + - email + - url + placeholder: + locale: + admin: Admin + + twikoo: + envId: + region: + path: + lang: + + giscus: + repo: + repoID: + category: + categoryID: + mapping: + lightTheme: + darkTheme: + reactionsEnabled: 1 + emitMetadata: 0 + + gitalk: + owner: + admin: + repo: + clientID: + clientSecret: + + cusdis: + host: + id: + + widgets: + enabled: + - search + - archives + - tag-cloud + + archives: + limit: 5 + + tagCloud: + limit: 10 + + opengraph: + twitter: + # Your Twitter username + site: + + # Available values: summary, summary_large_image + card: summary_large_image + + defaultImage: + opengraph: + enabled: false + local: false + src: + + colorScheme: + # Display toggle + toggle: true + + # Available values: auto, light, dark + default: auto + + imageProcessing: + cover: + enabled: true + content: + enabled: true diff --git a/debug.sh b/debug.sh new file mode 100755 index 0000000..4d1312e --- /dev/null +++ b/debug.sh @@ -0,0 +1 @@ +cd exampleSite && hugo server --gc --themesDir=../.. \ No newline at end of file diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index dcf6c63..db3a8a9 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,7 +11,7 @@ disqusShortname: hugo-theme-stack googleAnalytics: # Theme i18n support -# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl, it +# Available values: en, fr, id, ja, ko, pt-br, zh-cn, es, de, nl, it, th, el DefaultContentLanguage: en # Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko] @@ -174,10 +174,23 @@ menu: name: Home url: / weight: -100 - pre: home params: ### For demonstration purpose, the home link will be open in a new tab newTab: true + icon: home + + social: + - identifier: github + name: GitHub + url: https://github.com/CaiJimmy/hugo-theme-stack + params: + icon: brand-github + + - identifier: twitter + name: Twitter + url: https://twitter.com + params: + icon: brand-twitter related: includeNewer: true diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about.md index 79898de..494cb46 100644 --- a/exampleSite/content/page/about.md +++ b/exampleSite/content/page/about.md @@ -11,7 +11,8 @@ lastmod: '2020-10-09' menu: main: weight: -90 - pre: user + params: + icon: user --- Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. diff --git a/exampleSite/content/page/archives.md b/exampleSite/content/page/archives.md index 027dfc6..2862deb 100644 --- a/exampleSite/content/page/archives.md +++ b/exampleSite/content/page/archives.md @@ -6,5 +6,6 @@ slug: "archives" menu: main: weight: -70 - pre: archives + params: + icon: archives --- diff --git a/exampleSite/content/page/search.md b/exampleSite/content/page/search.md index f54cdb5..b2a5943 100644 --- a/exampleSite/content/page/search.md +++ b/exampleSite/content/page/search.md @@ -8,5 +8,6 @@ outputs: menu: main: weight: -60 - pre: search + params: + icon: search --- \ No newline at end of file diff --git a/i18n/el.yaml b/i18n/el.yaml new file mode 100644 index 0000000..38d867f --- /dev/null +++ b/i18n/el.yaml @@ -0,0 +1,70 @@ +toggleMenu: + other: Εναλλαγή Μενού + +darkMode: + other: Σκοτεινό θέμα + +list: + page: + one: "{{ .Count }} σελιδα" + other: "{{ .Count }} σελιδες" + + section: + other: Ενότητα + + subsection: + one: Υποενότητα + other: Υποενότητες + +article: + back: + other: Πισω + + tableOfContents: + other: Πινακας περιεχομενων + + relatedContents: + other: Σχετικο περιεχομενο + + lastUpdatedOn: + other: Τελευταια τροποποιηση στις + + readingTime: + one: "{{ .Count }} λεπτό ανάγνωσης" + ### Seems that there's no need to add 's' even if it's plural in English + other: "{{ .Count }} λεπτά ανάγνωσης" + +notFound: + title: + other: Δε βρέθηκε + subtitle: + other: Η σελίδα δε βρέθηκε. + +widget: + archives: + title: + other: Αρχειο + + more: + other: Περισσότερα + + tagCloud: + title: + other: Tags + +search: + title: + other: Αναζήτηση + + placeholder: + other: Πληκτρολογήστε κάτι... + + resultTitle: + other: "#PAGES_COUNT σελιδες (#TIME_SECONDS δευτερολεπτα)" + +footer: + builtWith: + other: Δημιουργήθηκε με τη χρήση {{ .Generator }} + + designedBy: + other: Το θέμα {{ .Theme }} σχεδιάστηκε από το {{ .DesignedBy }} diff --git a/i18n/pt-BR.yaml b/i18n/pt-BR.yaml index 8240755..ffdbe41 100644 --- a/i18n/pt-BR.yaml +++ b/i18n/pt-BR.yaml @@ -17,11 +17,22 @@ list: other: Subseções article: + back: + other: Voltar + + tableOfContents: + other: Índice + relatedContents: - other: Conteúdos Relacionados + other: Conteúdo relacionado + lastUpdatedOn: other: Última atualização em + readingTime: + one: "{{ .Count }} minuto de leitura" + other: "{{ .Count }} minutos de leitura" + notFound: title: other: Não Encontrado diff --git a/i18n/th.yaml b/i18n/th.yaml new file mode 100644 index 0000000..b2ae1cd --- /dev/null +++ b/i18n/th.yaml @@ -0,0 +1,70 @@ +toggleMenu: + other: สลับเมนู + +darkMode: + other: ธีมมืด + +list: + page: + one: "{{ .Count }} หน้า" + other: "{{ .Count }} หน้า" + + section: + other: หมวดหมู่ + + subsection: + one: หมวดหมู่ย่อย + other: หมวดหมู่ย่อยอื่นๆ + +article: + back: + other: กลับไป + + tableOfContents: + other: สารบัญ + + relatedContents: + other: เนื้อหาคล้ายคลึงกัน + + lastUpdatedOn: + other: อัปเดตล่าสุดเมื่อ + + readingTime: + one: "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" + other: "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" + +notFound: + title: + other: ไม่พบหัวข้อ + + subtitle: + other: ไม่พบหน้านี้ในระบบ + +widget: + archives: + title: + other: เนื้อหาที่เก็บถาวรแล้ว + + more: + other: อื่นๆ นอกจากนี้ + + tagCloud: + title: + other: แท็ก + +search: + title: + other: ค้นหา + + placeholder: + other: พิมพ์เพื่อค้นหา ... + + resultTitle: + other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)" + +footer: + builtWith: + other: ถูกสร้างด้วย {{ .Generator }} + + designedBy: + other: ธีม {{ .Theme }} ออกแบบโดย {{ .DesignedBy }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 902fa98..8b21c52 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -29,7 +29,7 @@ {{ define "left-sidebar" }} {{ if (.Scratch.Get "hasTOC") }}
- + {{ (resources.Get "icons/back.svg").Content | safeHTML }} {{ T "article.back" }} diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 9174dd1..a78947e 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.2.0" -}} +{{- $ThemeVersion := "3.4.0" -}}