commit 0eee1e07714677b7b860e10ae484a89a71e0be40 Author: wompmacho Date: Wed Mar 25 00:54:34 2026 +0000 Finalize framework: Fix submodules and clean artifacts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..001bb31 --- /dev/null +++ b/.gitignore @@ -0,0 +1,132 @@ +# Hugo build folder +public/ +# Hugo resource cache +resources/_gen/ +# Build locks and temporary files +.hugo_build.lock +.DS_Store +# Temporary system files +Thumbs.db +# Hugo generated search/taxonomy files (if they are in the root) +index.json +index.xml +sitemap.xml +# If you have specific node_modules or temp files +node_modules/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# --- Added to exclude Hugo build artifacts --- +/index.html +/404.html +/css/ +/js/ +/img/ +/lib/ +/series/ +/tags/ +/update.sh +/layouts/partials/head_temp_overide.html \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..12ac799 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,7 @@ +[submodule "themes/blowfish"] + path = themes/blowfish + url = https://github.com/nunocoracao/blowfish.git + branch = main +[submodule "themes/hugo-admonitions"] + path = themes/hugo-admonitions + url = https://github.com/KKKZOZ/hugo-admonitions.git diff --git a/FUNDING.YML b/FUNDING.YML new file mode 100644 index 0000000..6d80795 --- /dev/null +++ b/FUNDING.YML @@ -0,0 +1,2 @@ +github: [nunocoracao] +custom: ["https://www.paypal.me/nunocoracao", "https://www.buymeacoffee.com/nunocoracao"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cf00ae5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Nuno Coração + +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/README.md b/README.md new file mode 100644 index 0000000..18fbed9 --- /dev/null +++ b/README.md @@ -0,0 +1,102 @@ +# Project: Self-Hosted CI/CD and Static Hosting (Blowfish) + +This project manages a centralized self-hosted environment using **Gitea** for version control and automation, **Caddy** as a lightweight web server, and **Nginx Proxy Manager** for SSL termination. The system relies on a shared host volume to move static files from the Gitea Runner to the web server directory. + +## 🏗️ Architecture Split + +To allow for seamless Dev vs. Prod workflows, the architecture is split into two repositories: + +1. **Framework (`/srv/dev/hugo/wiki`)**: This repository (`hugo-framework`). Contains the Hugo engine, themes (Blowfish), layouts, and configuration. +2. **Content (`/srv/docs/public`)**: A separate repository (`docs-public`). Contains only the Markdown files and static assets. + +**Local Dev "Live Link":** +In this `hugo-framework` repository, `content/` and `static/` are **symbolic links** pointing to `/srv/docs/public`. This allows for real-time local previews of your notes when running `hugo server`. + +## 🚀 CI/CD Pipeline + +Deployment is fully automated through Gitea Actions. + +1. **Trigger:** Push a commit to the `main` branch of the `docs-public` repository. +2. **Runner Execution:** The Gitea Runner mounts the `hugo-framework` directory and executes the build steps. +3. **Sync:** The Runner uses a volume mount (`/srv/caddy/sites:/deploy`) to copy the generated `public/` folder directly to the host's web server directory. + +--- + +## 💻 Local Development + +1. **Work in the Docs folder**: Edit your markdown files in `/srv/docs/public/`. +2. **Asset Management:** Place any files for download (PDFs, images) in the `/srv/docs/public/static/` directory. +3. **Preview changes (Code-Server)**: + ```bash + cd /srv/dev/hugo/wiki + alias hugo-rebuild='rm -rf public/ && hugo server --bind 0.0.0.0 --appendPort=false --baseURL="/" --ignoreCache' + hugo-rebuild + ``` +4. **Deploy**: + ```bash + cd /srv/docs/public + git add . + git commit -m "Your note update" + git push origin main + ``` + +--- + +## 🛠️ Hugo Fresh Installation Notes + +To rebuild this environment—especially for a project like **Blowfish**—you need more than just the binary; you need the extended capabilities for CSS processing. + +### Prerequisites + +- **Hugo (Extended Version)**: Required for SCSS/PostCSS processing. +- **Node.js** & **npm**: Required for managing the theme's dependencies. +- **npx**: Comes with npm; used to run build-time tools for Blowfish. + +```bash +# Install nvm script and updating bashrc +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash +``` + +### 1. Installation (The "Extended" Way) + +* **Linux/Ubuntu:** Use the `.deb` package from the [Hugo GitHub releases](https://github.com/gohugoio/hugo/releases). + + ```bash + wget https://github.com/gohugoio/hugo/releases/download/v0.140.0/hugo_extended_0.140.0_linux-amd64.deb + sudo dpkg -i hugo_extended_0.140.0_linux-amd64.deb + ``` +* **Verify:** Ensure you have the extended version: `hugo version` (it should explicitly say `+extended`). + +### 2. Initialize the Framework + +If you are cloning this `hugo-framework` repository fresh: + +1. **Clone the Repo**: + ```bash + git clone https://git.wompmacho.com/wompmacho/hugo-framework.git my-wiki + cd my-wiki + ``` +2. **Pull Submodules** (The Blowfish theme): + ```bash + git submodule update --init --recursive + ``` +3. **Install Node Dependencies**: + ```bash + npm install + ``` +4. **Establish Symlinks** (Point to your content repo): + ```bash + rm -rf content static + ln -s /path/to/docs-public/content ./content + ln -s /path/to/docs-public/static ./static + ``` + +### 3. Critical Blowfish Configuration Note + +To prevent common theme breakage during a fresh setup, you must initialize the configuration files correctly: + +- Copy the config directory from `themes/blowfish/config/_default/` to your project's `config/` directory. +- Ensure your `hugo.toml` (or `config.toml`) correctly references the Blowfish theme. +- If the site is blank, run `npx postcss` or ensure your `package.json` has the correct scripts to compile SCSS, as Hugo cannot process Blowfish's advanced CSS/JS requirements without these tools. + +For full theme documentation, visit: https://blowfish.page/docs/ diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..91181fb --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,10 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +description: "{{ replace .Name "-" " " | title }}" +summary: "" +date: {{ .Date }} +lastmod: {{ .Date }} +author: wompmacho +draft: true +--- + diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..83288ae --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,89 @@ +/* --- 1. Global Prose Rules --- */ +.article-content.prose { + width: 100%; + max-width: 65ch; + margin: 0 auto; +} + +/* --- 2. Absolute Isolation Layout --- */ +.single-post-wrapper { + display: flex; + flex-direction: column; /* On mobile, they stack normally */ + width: 100%; +} + +@media (min-width: 1280px) { + .single-post-wrapper { + display: block; /* Turns off Flexbox completely */ + } + + #main-content { + /* Standard block behavior: automatically centers prose within wrapper */ + display: block; + } + + #sidebar-toc { + /* Removes the TOC from document flow entirely */ + position: absolute; + top: 0; + + /* Math: Center of wrapper (50%) + half the prose width (32.5ch) + 2rem gap */ + left: calc(50% + 32.5ch + 2rem); + + /* The aside needs to be exactly 100% height of the wrapper for sticky to work */ + height: 100%; + width: 256px; + } +} + +/* --- 3. Sticky TOC Logic --- */ +#sidebar-toc .toc { + position: sticky; + top: 6rem; + max-height: calc(100vh - 8rem); + overflow-y: auto; + padding-right: 1rem; + z-index: 10; +} + +/* --- 4. Projects Page (Isolated) --- */ +.projects-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 1.5rem; +} + +/* --- Base Styles --- */ +#resume-table p { padding: .5em } +.iframe-wrapper { position: relative; padding-bottom: 56.25%; padding-top: 25px; height: 0; } +.iframe-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } +#resume-table { border-collapse: collapse } +#resume-table .statements td { font-style: italic; padding: 1em; text-align: center } +#resume-table .header { padding-top: 1em; padding-left: 1em; font-weight: 700; text-transform: uppercase; text-align: left } +.google-blue { color: #4285f4; font-weight: bolder; } +.google-red { color: #ea4335; font-weight: bolder; } +.google-yellow { color: #fbbc04; font-weight: bolder; } +.google-green { color: #34a853; font-weight: bolder; } +.header-google-blue { border-bottom: 4px solid #4285f4 } +.header-google-red { border-bottom: 4px solid #ea4335 } +.header-google-yellow { border-bottom: 4px solid #fbbc04 } +.header-google-green { border-bottom: 4px solid #34a853 } +#resume-table td, #resume-table tr { border-width: 0 } +#resume-table ul { margin-top: 0; margin-bottom: 0 } +#resume-table .section-header td { padding-top: .66em; font-weight: 700 } +#resume-table .role { padding: .66em; text-align: left } +#resume-table .dates { text-align: right; padding-right: 1em } +#resume-table .quote { text-align: center } +#resume-table .twitter-blue { color: #1da1f2; font-weight: bolder } +.center { text-align: center; padding: .5em } +img[src$='#center']{ display: block; margin: 0.7rem auto; } +img[src$='#floatleft']{ float:left; margin: 0.7rem; } +img[src$='#floatright']{ float:right; margin: 0.7rem; } +.homepage .content { text-align: left; } + + +/* Hide any TOC link that points to an element with the 'no-toc' class */ +.toc-right a.no-toc-link, +.toc-inside a.no-toc-link { + display: none !important; +} \ No newline at end of file diff --git a/assets/devops-lifecycle.png b/assets/devops-lifecycle.png new file mode 100644 index 0000000..3d356e2 Binary files /dev/null and b/assets/devops-lifecycle.png differ diff --git a/assets/devops_diagram.png b/assets/devops_diagram.png new file mode 100644 index 0000000..bc42edc Binary files /dev/null and b/assets/devops_diagram.png differ diff --git a/assets/icons/SE_home_page_logo.svg b/assets/icons/SE_home_page_logo.svg new file mode 100644 index 0000000..9bfea1a --- /dev/null +++ b/assets/icons/SE_home_page_logo.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/me/me_stream_doom.PNG b/assets/me/me_stream_doom.PNG new file mode 100644 index 0000000..f29ecdf Binary files /dev/null and b/assets/me/me_stream_doom.PNG differ diff --git a/assets/me/wampyDance.gif b/assets/me/wampyDance.gif new file mode 100644 index 0000000..b300b7e Binary files /dev/null and b/assets/me/wampyDance.gif differ diff --git a/authors/index.html b/authors/index.html new file mode 100644 index 0000000..205ed02 --- /dev/null +++ b/authors/index.html @@ -0,0 +1,432 @@ + + + + + + + + + + + + Authors · Blowfish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + Skip to main content + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +

Authors

+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + +
+ +
+ + + + +
+ + + + +
+ + +

+ © + 2025 + Your name here +

+ + + + +

+ + + Powered by Hugo & Blowfish +

+ +
+ + + + + + + + +
+ + +
+ + + diff --git a/categories/index.html b/categories/index.html new file mode 100644 index 0000000..e6d3282 --- /dev/null +++ b/categories/index.html @@ -0,0 +1,432 @@ + + + + + + + + + + + + Categories · Blowfish + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + Skip to main content + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +

Categories

+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + +
+ +
+ + + + +
+ + + + +
+ + +

+ © + 2025 + Your name here +

+ + + + +

+ + + Powered by Hugo & Blowfish +

+ +
+ + + + + + + + +
+ + +
+ + + diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml new file mode 100644 index 0000000..d0af0c7 --- /dev/null +++ b/config/_default/hugo.toml @@ -0,0 +1,44 @@ +# -- Site Configuration -- +# Refer to the theme docs for more details about each of these parameters. +# https://nunocoracao.github.io/blowfish/docs/getting-started/ + +theme = ["hugo-admonitions", "blowfish"] +baseURL = "https://wiki.wompmacho.com/" +defaultContentLanguage = "en" +relativeURLs = true + +enableRobotsTXT = true +summaryLength = 5 + +buildDrafts = true +buildFuture = true +enableEmoji = true + +# googleAnalytics = "G-XXXXXXXXX" + +[taxonomies] + tag = "tags" + category = "categories" + author = "authors" + series = "series" + +[sitemap] + changefreq = 'daily' + filename = 'sitemap.xml' + priority = 0.5 + +[outputs] + home = ["HTML", "RSS", "JSON"] + +[frontmatter] + # Hugo will check for 'lastmod' in the file first, + # then the Git commit date, then the 'date' field. + lastmod = ["lastmod", ":git", "date"] + +# Required if you want to use the Git commit date automatically +enableGitInfo = true + +[markup.tableOfContents] + endLevel = 3 + ordered = false + startLevel = 2 \ No newline at end of file diff --git a/config/_default/languages.en.toml b/config/_default/languages.en.toml new file mode 100644 index 0000000..b5d9bf7 --- /dev/null +++ b/config/_default/languages.en.toml @@ -0,0 +1,27 @@ +languageCode = "en" +languageName = "English" +weight = 1 +title = "wiki.wompmacho.com" + +[params] +displayName = "EN" +isoCode = "en" +rtl = false +description = "my personal wiki" +dateFormat = "2 January 2006" + +[params.author] +name = "Michael" +image = "me/wampyDance.gif" +headline = "aka `Mitch` / aka `WompMacho`" +bio = "some dude that works on datacenters, plays guitar, streams, has a lot of side projects and unhealthy addiction to ow" + + [params.author.social] + gitlab = "https://git.wompmacho.com/wompmacho" + email = "michael@wompmacho.com" + streamelements = "https://streamelements.com/wompmacho/tip" + discord = "https://discord.com/invite/P5aZU7jHbD" + twitch = "https://www.twitch.tv/wompmacho" + youtube = "https://www.youtube.com/wompmacho?sub_confirmation=1" + + \ No newline at end of file diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..d153923 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,19 @@ +# -- Markup -- +# These settings are required for the theme to function. + +[goldmark] + [goldmark.renderer] + unsafe = true + +[markup] + [markup.tableOfContents] + startLevel = 2 + endLevel = 4 + ordered = false + +[highlight] + noClasses = false + +[markup.goldmark.parser.attribute] + block = true + title = true \ No newline at end of file diff --git a/config/_default/menus.en.toml b/config/_default/menus.en.toml new file mode 100644 index 0000000..0a38821 --- /dev/null +++ b/config/_default/menus.en.toml @@ -0,0 +1,57 @@ +# -- Main Menu -- +# The main menu is displayed in the header at the top of the page. +# Acceptable parameters are name, pageRef, page, url, title, weight. +# +# The simplest menu configuration is to provide: +# name = The name to be displayed for this menu link +# pageRef = The identifier of the page or section to link to +# +# By default the menu is ordered alphabetically. This can be +# overridden by providing a weight value. The menu will then be +# ordered by weight from lowest to highest. + +[[main]] + name = "projects" + pageRef = "projects" + weight = 10 + +[[main]] + name = "posts" + pageRef = "posts" + weight = 20 + +[[main]] + name = "stream" + pageRef = "stream" + weight = 30 + +[[subnavigation]] + name = "lab" + pageRef = "lab_setup" + weight = 10 + +[[subnavigation]] + name = "resume" + pageRef = "resume" + weight = 20 + +# [[subnavigation]] +# name = "My Awesome Category" +# pageRef = "categories/awesome" +# weight = 20 + +# -- Footer Menu -- +# The footer menu is displayed at the bottom of the page, just before +# the copyright notice. Configure as per the main menu above. + +# config/_default/menus.toml + +# [[footer]] +# name = "Tags" +# pageRef = "tags" +# weight = 10 + +# [[footer]] +# name = "Categories" +# pageRef = "categories" +# weight = 20 diff --git a/config/_default/module.toml b/config/_default/module.toml new file mode 100644 index 0000000..74f7727 --- /dev/null +++ b/config/_default/module.toml @@ -0,0 +1,3 @@ +[hugoVersion] + extended = false + min = "0.87.0" diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..4f82f63 --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,114 @@ +# -- Theme Options -- +# These options control how the theme functions and allow you to +# customise the display of your website. +# +# Refer to the theme docs for more details about each of these parameters. +# https://nunocoracao.github.io/blowfish/docs/configuration/#theme-parameters + +colorScheme = "github" +defaultAppearance = "light" # valid options: light or dark +autoSwitchAppearance = true + +enableSearch = true +enableCodeCopy = true +customCSS = true + +# mainSections = ["section1", "section2"] +# robots = "" + +[header] + layout = "fixed" # valid options: basic, fixed + +[footer] + # showMenu = true + showCopyright = true + showThemeAttribution = true + showAppearanceSwitcher = true + showScrollToTop = true + +[homepage] + layout = "background" # valid options: page, profile, hero, card, background, custom + homepageImage = "me/me_stream_doom.PNG" # used in: hero, and card + showRecent = false + showRecentItems = 5 + showMoreLink = false + showMoreLinkDest = "/posts" + cardView = false + cardViewScreenWidth = false + layoutBackgroundBlur = false # only used when layout equals background + +[search] + enable = true + type = "fuse" + showPercent = true + showWidth = true + +[article] # https://blowfish.page/docs/configuration/ + showDate = true + showViews = false + showLikes = false + showDateUpdated = true + showHero = true + heroStyle = "basic" # valid options: basic, big, background + showBreadcrumbs = true + showDraftLabel = true + seriesOpened = true + showHeadingAnchors = true + showPagination = true + invertPagination = false + showReadingTime = true + showTableOfContents = true + showTaxonomies = true + showWordCount = true + showSummary = true + sharingLinks = [ "linkedin", "twitter", "whatsapp", "pinterest", "reddit", "facebook", "email"] + showAuthor = true + showAuthorsBadges = true # This helps style the author profile + showEdit = true + showEditURL = true + editURL = "https://git.wompmacho.com/wompmacho/wiki/src/branch/main/content" + editAppendPath = true + showZenMode = false + smartTOC = true + +[list] + showBreadcrumbs = true + showSummary = true + showTableOfContents = true + showCards = true + groupByYear = true + cardView = true + cardViewScreenWidth = false + columnCount = 3 + showReadMore = true + +[sitemap] + excludedKinds = [] + +[taxonomy] + showTermCount = true + +[firebase] + # apiKey = "XXXXXX" + # authDomain = "XXXXXX" + # projectId = "XXXXXX" + # storageBucket = "XXXXXX" + # messagingSenderId = "XXXXXX" + # appId = "XXXXXX" + # measurementId = "XXXXXX" + +[fathomAnalytics] + # site = "ABC12345" + # domain = "llama.yoursite.com" + +[verification] + # google = "" + # bing = "" + # pinterest = "" + # yandex = "" + +[app] + # Some versions of Blowfish look for 'mainIcon' or 'themeIcon' + # Try both if one fails. + mainIcon = "icons/icon.svg" + themeIcon = "icons/icon.svg" \ No newline at end of file diff --git a/content b/content new file mode 120000 index 0000000..ab722b0 --- /dev/null +++ b/content @@ -0,0 +1 @@ +/srv/docs/public \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..b462b44 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,138 @@ +{{ define "main" }} + {{ .Scratch.Set "scope" "list" }} + {{ $enableToc := .Params.showTableOfContents | default (site.Params.list.showTableOfContents | default false) }} + {{ $showToc := and $enableToc (in .TableOfContents " + {{ if .Params.showBreadcrumbs | default (site.Params.list.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} + {{ end }} +

{{ .Title }}

+
+ {{ partial "article-meta/list.html" (dict "context" . "scope" "single") }} +
+ + + {{/* Description (markdown content) */}} + {{ $tocMargin := cond $showToc "mt-12" "mt-0" }} + {{ $topClass := cond (hasPrefix site.Params.header.layout "fixed") "lg:top-[140px]" "lg:top-10" }} +
+ {{ if $showToc }} +
+
+ {{ if $showToc }} + {{ partial "toc.html" . }} + {{ end }} +
+
+ {{ end }} +
+ {{ .Content }} +
+
+ + {{/* Article Grid */}} + {{ if gt .Pages 0 }} + {{ $cardView := .Params.cardView | default (site.Params.list.cardView | default false) }} + {{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (site.Params.list.cardViewScreenWidth | default false) }} + {{ $groupByYear := .Params.groupByYear | default (site.Params.list.groupByYear | default false) }} + {{ $orderByWeight := .Params.orderByWeight | default (site.Params.list.orderByWeight | default false) }} + {{ $groupByYear := and (not $orderByWeight) $groupByYear }} + + {{ if not $cardView }} +
+ {{ if not $orderByWeight }} + {{ range (.Pages.GroupByDate "2006") }} + {{ if $groupByYear }} +

+ {{ .Key }} +

+ {{ end }} + {{ range .Pages }} + {{ partial "article-link/simple.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range .Pages.ByWeight }} + {{ partial "article-link/simple.html" . }} + {{ end }} + {{ end }} +
+ {{ else }} + {{ if $groupByYear }} + {{ range (.Pages.GroupByDate "2006") }} + {{ if $cardViewScreenWidth }} +
+

+ {{ .Key }} +

+
+ {{ range .Pages }} + {{ partial "article-link/card.html" . }} + {{ end }} +
+
+ {{ else }} +

+ {{ .Key }} +

+
+ {{ range .Pages }} + {{ partial "article-link/card.html" . }} + {{ end }} +
+ {{ end }} + {{ end }} + {{ else }} + {{ if $cardViewScreenWidth }} +
+
+ {{ if not $orderByWeight }} + {{ range (.Pages.GroupByDate "2006") }} + {{ range .Pages }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range .Pages.ByWeight }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{ end }} +
+
+ {{ else }} +
+ {{ if not $orderByWeight }} + {{ range (.Pages.GroupByDate "2006") }} + {{ range .Pages }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range .Pages.ByWeight }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{ end }} +
+ {{ end }} + {{ end }} + {{ end }} + {{ else }} +
+

+ {{ i18n "list.no_articles" | emojify }} +

+
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..50cdd0d --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,82 @@ +{{ define "main" }} + {{ .Scratch.Set "scope" "single" }} + +
+ {{ if .Params.showHero | default (site.Params.article.showHero | default false) }} + {{ partial (printf "hero/%s.html" (.Params.heroStyle | default site.Params.article.heroStyle)) . }} + {{ end }} + +
+

{{ .Title | emojify }}

+
+ {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} +
+ {{ if not (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }} + {{ template "SingleAuthor" . }} + {{ end }} +
+ + {{/* The Relative Wrapper: Acts as an anchor for the absolute TOC */}} +
+ + {{/* Sidebar TOC: Mobile flow (Top), Desktop absolute (Right) */}} + {{ if .Params.showTableOfContents | default site.Params.article.showTableOfContents }} + + {{ end }} + + {{/* Main Content: Dead center, uninfluenced by anything */}} +
+
+ {{ partial "series/series.html" . }} + {{ .Content }} + + {{ if .Params.replyByEmail | default site.Params.replyByEmail }} + + Reply by Email + + {{ end }} + +
+ {{ if (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }} + {{ template "SingleAuthor" . }} + {{ end }} + {{ partial "series/series-closed.html" . }} + {{ partial "sharing-links.html" . }} + {{ partial "related.html" . }} +
+
+
+ +
+ +
+ {{ partial "article-pagination.html" . }} +
+
+{{ end }} + +{{ define "SingleAuthor" }} +
+ {{ $authorsData := site.Data.authors }} + {{ $baseURL := site.BaseURL }} + {{ $isAuthorBottom := (.Params.showAuthorBottom | default ( site.Params.article.showAuthorBottom | default false)) }} + {{ if not (strings.HasSuffix $baseURL "/") }}{{ $baseURL = delimit (slice $baseURL "/") "" }}{{ end }} + + {{ if .Params.showAuthor | default (site.Params.article.showAuthor | default true) }} + {{ partial "author.html" . }} + {{ end }} + + {{ range $author := .Page.Params.authors }} + {{ $authorData := index $authorsData $author }} + {{ if $authorData }} + {{ $link := printf "%sauthors/%s/" $baseURL $author }} + {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $link) }} + {{ end }} + {{ end }} +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..3b35e78 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,8 @@ +{{ define "main" }} + {{ $partial := print "home/" .Site.Params.homepage.layout ".html" }} + {{ if templates.Exists ( printf "partials/%s" $partial ) }} + {{ partial $partial . }} + {{ else }} + {{ partial "home/profile.html" . }} + {{ end }} +{{ end }} diff --git a/layouts/partials/article-link/card.html b/layouts/partials/article-link/card.html new file mode 100644 index 0000000..4728a92 --- /dev/null +++ b/layouts/partials/article-link/card.html @@ -0,0 +1,102 @@ +{{/* Used by + 1. list.html and term.html (when the cardView option is enabled) + 2. Recent articles template (when the cardView option is enabled) + 3. Shortcode list.html +*/}} +{{ $disableImageOptimization := site.Store.Get "disableImageOptimization" }} + +{{ $page := .Page }} +{{ $featured := "" }} +{{ $featuredURL := "" }} +{{ if not .Params.hideFeatureImage }} + {{/* frontmatter and resources logic remains the same */}} + {{ with $page }} + {{ with .Params.featureimage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ if site.Params.hotlinkFeatureImage }} + {{ $featuredURL = . }} + {{ else }} + {{ $featured = resources.GetRemote . }} + {{ end }} + {{ else }} + {{ $featured = resources.Get . }} + {{ end }} + {{ end }} + {{ if not (or $featured $featuredURL) }} + {{ $images := .Resources.ByType "image" }} + {{ range slice "*feature*" "*cover*" "*thumbnail*" }} + {{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }} + {{ end }} + {{ end }} + {{ if not (or $featured $featuredURL) }} + {{ $default := site.Store.Get "defaultFeaturedImage" }} + {{ if $default.url }} + {{ $featuredURL = $default.url }} + {{ else if $default.obj }} + {{ $featured = $default.obj }} + {{ end }} + {{ end }} + {{ if not $featuredURL }} + {{ with $featured }} + {{ $featuredURL = .RelPermalink }} + {{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }} + {{ $featuredURL = (.Resize "600x").RelPermalink }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} +{{ end }} + +
+ {{ with $featuredURL }} +
+ +
+ {{ end }} + {{ if and .Draft .Site.Params.article.showDraftLabel }} + + {{ partial "badge.html" (i18n "article.draft" | emojify) }} + + {{ end }} + + {{/* Main Content Wrapper - Added flex-grow to push footer down */}} +
+
+ +

+ {{ .Title | emojify }} + {{ if .Params.externalUrl }} + + + + + {{ end }} +

+
+
+
+ {{ partial "article-meta/basic.html" . }} +
+ + {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} + {{/* Added line-clamp-3 and flex-grow here */}} +
+ {{ .Summary | plainify }} +
+ {{ end }} +
+ +
+
\ No newline at end of file diff --git a/layouts/partials/favicons.html b/layouts/partials/favicons.html new file mode 100644 index 0000000..8f18301 --- /dev/null +++ b/layouts/partials/favicons.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..e6f4d55 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,71 @@ +
+ {{/* Footer menu */}} + {{ if .Site.Params.footer.showMenu | default true }} + {{ if .Site.Menus.footer }} + {{ $onlyIcon := true }} + {{ range .Site.Menus.footer }} + {{ if .Name }} + {{ $onlyIcon = false }} + {{ break }} + {{ end }} + {{ end }} + {{ $navClass := printf "flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400 %s" (cond $onlyIcon "overflow-x-auto py-2" "") }} + {{ $ulClass := printf "flex list-none %s" (cond $onlyIcon "flex-row" "flex-col sm:flex-row") }} + {{ $liClass := printf "flex mb-1 text-end sm:mb-0 sm:me-7 sm:last:me-0 %s" (cond $onlyIcon "me-4" "") }} + + {{ end }} + {{ end }} +
+ {{/* Copyright */}} + {{ if .Site.Params.footer.showCopyright | default true }} +

+ {{- with replace .Site.Params.copyright "{ year }" now.Year }} + {{ . | markdownify }} + {{- else }} + © + {{ now.Format "2006" }} + {{ .Site.Params.Author.name | markdownify }} + {{- end }} +

+ {{ end }} + + {{/* Theme attribution */}} + {{ if .Site.Params.footer.showThemeAttribution | default true }} +

+ Powered by Your Mom +

+ {{ end }} +
+ {{ if not .Site.Params.disableImageZoom | default true }} + + {{ end }} + {{/* Extend footer - eg. for extra scripts, etc. */}} + {{ if templates.Exists "partials/extend-footer.html" }} + {{ partialCached "extend-footer.html" . }} + {{ end }} +
diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html new file mode 100644 index 0000000..95849e4 --- /dev/null +++ b/layouts/partials/home/background.html @@ -0,0 +1,126 @@ +{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} +
+
+
+
+
+
+ {{ $useDefault := true }} + {{ $homepageImage := "" }} + {{ with .Site.Params.defaultBackgroundImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} + {{ with .Site.Params.homepage.homepageImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ $useDefault = false }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ $useDefault = false }} + {{ end }} + {{ end }} + {{ if $homepageImage }} + {{ $style := "" }} + {{ $defaultPosition := cond $useDefault site.Params.imagePosition false }} + {{ with $.Params.imagePosition | default $defaultPosition }} + {{ $style = printf "object-position: %s;" . }} + {{ end }} + +
+
+ {{ end }} +
+ +
+ {{ with .Site.Params.Author.image }} + {{ $authorImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $authorImage = resources.GetRemote . }} + {{ else }} + {{ $authorImage = resources.Get . }} + {{ end }} + {{ if $authorImage }} + {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} + {{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }} + {{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} + {{ end }} + {{ $.Site.Params.Author.name | default `Author` }} + {{ end }} + {{ end }} +

+ {{ .Site.Params.Author.name | default .Site.Title }} +

+ {{ with .Site.Params.Author.headline }} +

+ {{ . | markdownify }} +

+ {{ end }} +
+ {{ with .Site.Params.Author.links }} +
+ {{ range $links := . }} + {{ range $name, $url := $links }} + + {{ partial "icon.html" $name }} + + {{ end }} + {{ end }} +
+ {{ end }} +
+
+ +
+
+ {{ .Content }} +
+
+
+
+
+
+ +
+ {{ partial "recent-articles/main.html" . }} +
+ +{{ if .Site.Params.homepage.layoutBackgroundBlur | default false }} +
+ {{ $backgroundBlur := resources.Get "js/background-blur.js" }} + {{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html new file mode 100644 index 0000000..3730cbe --- /dev/null +++ b/layouts/partials/toc.html @@ -0,0 +1,143 @@ +
+ + {{ i18n "article.table_of_contents" }} + +
+ {{/* We use Hugo's native TOC generator so it never disappears */}} + {{ .TableOfContents | safeHTML }} +
+
+ +
+ + {{ i18n "article.table_of_contents" }} + +
+ {{ .TableOfContents | safeHTML }} +
+
+ +{{ if .Site.Params.smartTOC }} + +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html new file mode 100644 index 0000000..88c822a --- /dev/null +++ b/layouts/shortcodes/rawhtml.html @@ -0,0 +1 @@ +{{ .Inner }} \ No newline at end of file diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..a85f5fe --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..bd0b874 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "blowfish_template", + "version": "1.0.0", + "description": "Blowfish Template", + "main": "index.js", + "scripts": { + "dev": "hugo server --minify -D -E -F" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nunocoracao/blowfish_template.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/nunocoracao/blowfish_template/issues" + }, + "homepage": "https://github.com/nunocoracao/blowfish_template#readme" +} \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..b27b184 --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: /sitemap.xml diff --git a/site.webmanifest b/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file