diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 7f0d337..ae1104d 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -16,7 +16,7 @@ concurrency: jobs: build-push: - name: Build and Push Jekyll Site + name: Build and Push Hugo Site runs-on: ubuntu-latest steps: @@ -24,33 +24,35 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - # submodules: true - # If using the 'assets' git submodule from Chirpy Starter, uncomment above - # (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets) # Build and test site - - name: Setup Ruby - uses: https://github.com/ruby/setup-ruby@v1 - with: - ruby-version: 3.3 - bundler-cache: true - - - name: Build site - run: bundle exec jekyll b -d _site + - name: Cache Hugo resources + uses: actions/cache@v4 env: - JEKYLL_ENV: "production" + cache-name: cache-hugo-resources + with: + path: resources + key: ${{ env.cache-name }} - - name: Test site - run: | - bundle exec htmlproofer _site \ - \-\-disable-external \ - \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" + - uses: actions/setup-go@v5 + with: + go-version: "^1.17.0" + - run: go version + + - name: Setup Hugo + uses: https://github.com/peaceiris/actions-hugo@v2 + with: + hugo-version: "latest" + extended: true + + - name: Build + run: hugo --minify --gc - name: Copy website to destination server uses: https://github.com/garygrossgarten/github-action-scp@release with: - local: _site + local: public remote: /srv/docker/nginx/html/blog host: ${{ secrets.SSH_HOST }} port: ${{ secrets.SSH_PORT }} diff --git a/.gitattributes b/.gitattributes index 262d6bd..f67ee0c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,3 +14,4 @@ *.png binary *.jpg binary *.ico binary +*.png binary diff --git a/.gitignore b/.gitignore index 7dd7cef..c8ff03a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,3 @@ -# Bundler cache -.bundle -vendor -Gemfile.lock - -# Jekyll cache -.jekyll-cache -.jekyll-metadata -_site - -# RubyGems -*.gem - -# NPM dependencies -node_modules -package-lock.json - -# IDE configurations -.idea -.vscode/* -!.vscode/settings.json -!.vscode/extensions.json -!.vscode/tasks.json - -# Misc -_sass/vendors -assets/js/dist +public +resources +.hugo_build.lock diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 234a92e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx:1.27.4@sha256:124b44bfc9ccd1f3cedf4b592d4d1e8bddb78b51ec2ed5056c52d3692baebc19 - -COPY _site /usr/share/nginx/html diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 7835d7d..0000000 --- a/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gem "jekyll-theme-chirpy", "~> 7.2", ">= 7.2.4" - -gem "html-proofer", "~> 5.0", group: :test - -platforms :mingw, :x64_mingw, :mswin, :jruby do - gem "tzinfo", ">= 1", "< 3" - gem "tzinfo-data" -end - -gem "wdm", "~> 0.2.0", :platforms => [:mingw, :x64_mingw, :mswin] diff --git a/LICENSE b/LICENSE index a6f6c9f..4b5f721 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Cotes Chung +Copyright (c) 2021 Jimmy Cai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 793cd08..fbfbbca 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,69 @@ -# Chirpy Starter +logo -[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy)][gem]  -[![GitHub license](https://img.shields.io/github/license/cotes2020/chirpy-starter.svg?color=blue)][mit] +# Hugo Theme Stack Starter Template -When installing the [**Chirpy**][chirpy] theme through [RubyGems.org][gem], Jekyll can only read files in the folders -`_data`, `_layouts`, `_includes`, `_sass` and `assets`, as well as a small part of options of the `_config.yml` file -from the theme's gem. If you have ever installed this theme gem, you can use the command -`bundle info --path jekyll-theme-chirpy` to locate these files. +This is a quick start template for [Hugo theme Stack](https://github.com/CaiJimmy/hugo-theme-stack). It uses [Hugo modules](https://gohugo.io/hugo-modules/) feature to load the theme. -The Jekyll team claims that this is to leave the ball in the user’s court, but this also results in users not being -able to enjoy the out-of-the-box experience when using feature-rich themes. +It comes with a basic theme structure and configuration. GitHub action has been set up to deploy the theme to a public GitHub page automatically. Also, there's a cron job to update the theme automatically everyday. -To fully use all the features of **Chirpy**, you need to copy the other critical files from the theme's gem to your -Jekyll site. The following is a list of targets: +## Get started -```shell -. -├── _config.yml -├── _plugins -├── _tabs -└── index.html +1. Click *Use this template*, and create your repository as `.github.io` on GitHub. +![Step 1](https://user-images.githubusercontent.com/5889006/156916624-20b2a784-f3a9-4718-aa5f-ce2a436b241f.png) + +2. Once the repository is created, create a GitHub codespace associated with it. +![Create codespace](https://user-images.githubusercontent.com/5889006/156916672-43b7b6e9-4ffb-4704-b4ba-d5ca40ffcae7.png) + +3. And voila! You're ready to go. The codespace has been configured with the latest version of Hugo extended, just run `hugo server` in the terminal and see your new site in action. + +4. Check `config` folder for the configuration files. You can edit them to suit your needs. Make sure to update the `baseurl` property in `config/_default/config.toml` to your site's URL. + +5. Open Settings -> Pages. Change the build branch from `master` to `gh-pages`. +![Build](https://github.com/namanh11611/hugo-theme-stack-starter/assets/16586200/12c763cd-bead-4923-b610-8788f388fcb5) + +6. Once you're done editing the site, just commit it and push it. GitHub action will deploy the site automatically to GitHub page asociated with the repository. +![GitHub action](https://user-images.githubusercontent.com/5889006/156916881-90b8bb9b-1925-4e60-9d7a-8026cda729bf.png) + +--- + +In case you don't want to use GitHub codespace, you can also run this template in your local machine. **You need to install Git, Go and Hugo extended locally.** + +## Update theme manually + +Run: + +```bash +hugo mod get -u github.com/CaiJimmy/hugo-theme-stack/v3 +hugo mod tidy ``` -To save you time, and also in case you lose some files while copying, we extract those files/configurations of the -latest version of the **Chirpy** theme and the [CD][CD] workflow to here, so that you can start writing in minutes. +> This starter template has been configured with `v3` version of theme. Due to the limitation of Go module, once the `v4` or up version of theme is released, you need to update the theme manually. (Modifying `config/module.toml` file) -## Usage +## Deploy to another static page hostings -Check out the [theme's docs](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). +If you want to build this site using another static page hosting, you need to make sure they have Go installed in the machine. -## Contributing +
+ Vercel + +You need to overwrite build command to install manually Go: -This repository is automatically updated with new releases from the theme repository. If you encounter any issues or want to contribute to its improvement, please visit the [theme repository][chirpy] to provide feedback. +``` +amazon-linux-extras install golang1.11 && hugo --gc --minify +``` -## License +![](https://user-images.githubusercontent.com/5889006/156917172-01e4d418-3469-4ffb-97e4-a905d28b8424.png) -This work is published under [MIT][mit] License. +If you are using Node.js 20, you need to overwrite the install command to install manually Go: -[gem]: https://rubygems.org/gems/jekyll-theme-chirpy -[chirpy]: https://github.com/cotes2020/jekyll-theme-chirpy/ -[CD]: https://en.wikipedia.org/wiki/Continuous_deployment -[mit]: https://github.com/cotes2020/chirpy-starter/blob/master/LICENSE +``` +dnf install -y golang +``` + +![image](https://github.com/zhi-yi-huang/hugo-theme-stack-starter/assets/83860323/777c1109-dfc8-4893-9db7-1305ec027cf5) + + +Make sure also to specify Hugo version in the environment variable `HUGO_VERSION` (Use the latest version of Hugo extended): + +![Environment variable](https://user-images.githubusercontent.com/5889006/156917212-afb7c70d-ab85-480f-8288-b15781a462c0.png) +
diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 3ab93e8..0000000 --- a/_config.yml +++ /dev/null @@ -1,227 +0,0 @@ -# The Site Configuration - -# Import the theme -theme: jekyll-theme-chirpy - -# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm -# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed, -# otherwise, the layout language will use the default value of 'en'. -lang: en - -# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker -timezone: Europe/Zurich - -# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md -# ↓ -------------------------- - -title: The Pensieve # the main title - -# it will display as the subtitle -tagline: >- - A stream of consciousness archive about some stuff I've done. - -description: >- # used by seo meta and the atom feed - -# Fill in the protocol & hostname for your site. -# E.g. 'https://username.github.io', note that it does not end with a '/'. -url: "https://blog.martin.md" - -github: - username: Radu-C-Martin # change to your GitHub username - -mastodon: - username: radu@mstdn.md - -social: - # Change to your full name. - # It will be displayed as the default author of the posts and the copyright owner in the Footer - name: Radu C. Martin - email: contact@martin.md - links: - - https://blog.martin.md - # The first element serves as the copyright owner's link - - https://github.com/Radu-C-Martin # change to your GitHub homepage - # Uncomment below to add more social links - # - https://www.facebook.com/username - - https://www.linkedin.com/in/Radu-C-Martin - -# Site Verification Settings -webmaster_verifications: - google: # fill in your Google verification code - bing: # fill in your Bing verification code - alexa: # fill in your Alexa verification code - yandex: # fill in your Yandex verification code - baidu: # fill in your Baidu verification code - facebook: # fill in your Facebook verification code - -# ↑ -------------------------- -# The end of `jekyll-seo-tag` settings - -# Web Analytics Settings -analytics: - google: - id: # fill in your Google Analytics ID - goatcounter: - id: # fill in your GoatCounter ID - umami: - id: # fill in your Umami ID - domain: # fill in your Umami domain - matomo: - id: # fill in your Matomo ID - domain: # fill in your Matomo domain - cloudflare: - id: # fill in your Cloudflare Web Analytics token - fathom: - id: # fill in your Fathom Site ID - -# Page views settings -pageviews: - provider: # now only supports 'goatcounter' - -# Prefer color scheme setting. -# -# Note: Keep empty will follow the system prefer color by default, -# and there will be a toggle to switch the theme between dark and light -# on the bottom left of the sidebar. -# -# Available options: -# -# light — Use the light color scheme -# dark — Use the dark color scheme -# -theme_mode: # [light | dark] - -# The CDN endpoint for media resources. -# Notice that once it is assigned, the CDN url -# will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/' -# -# e.g. 'https://cdn.com' -cdn: - -# the avatar on sidebar, support local or CORS resources -avatar: '/assets/avatar.png' - -# The URL of the site-wide social preview image used in SEO `og:image` meta tag. -# It can be overridden by a customized `page.image` in front matter. -social_preview_image: # string, local or CORS resources - -# boolean type, the global switch for TOC in posts. -toc: true - -comments: - # Global switch for the post-comment system. Keeping it empty means disabled. - provider: # [disqus | utterances | giscus] - # The provider options are as follows: - disqus: - shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname - # utterances settings › https://utteranc.es/ - utterances: - repo: # / - issue_term: # < url | pathname | title | ...> - # Giscus options › https://giscus.app - giscus: - repo: # / - repo_id: - category: - category_id: - mapping: # optional, default to 'pathname' - strict: # optional, default to '0' - input_position: # optional, default to 'bottom' - lang: # optional, default to the value of `site.lang` - reactions_enabled: # optional, default to the value of `1` - -# Self-hosted static assets, optional › https://github.com/cotes2020/chirpy-static-assets -assets: - self_host: - enabled: # boolean, keep empty means false - # specify the Jekyll environment, empty means both - # only works if `assets.self_host.enabled` is 'true' - env: # [development | production] - -pwa: - enabled: true # The option for PWA feature (installable) - cache: - enabled: true # The option for PWA offline cache - # Paths defined here will be excluded from the PWA cache. - # Usually its value is the `baseurl` of another website that - # shares the same domain name as the current website. - deny_paths: - # - "/example" # URLs match `/example/*` will not be cached by the PWA - -paginate: 10 - -# The base URL of your site -baseurl: "" - -# ------------ The following options are not recommended to be modified ------------------ - -kramdown: - footnote_backlink: "↩︎" - syntax_highlighter: rouge - syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options - css_class: highlight - # default_lang: console - span: - line_numbers: false - block: - line_numbers: true - start_line: 1 - -collections: - tabs: - output: true - sort_by: order - -defaults: - - scope: - path: "" # An empty string here means all files in the project - type: posts - values: - layout: post - comments: true # Enable comments in posts. - toc: true # Display TOC column in posts. - # DO NOT modify the following parameter unless you are confident enough - # to update the code of all other post links in this project. - permalink: /posts/:title/ - - scope: - path: _drafts - values: - comments: false - - scope: - path: "" - type: tabs # see `site.collections` - values: - layout: page - permalink: /:title/ - -sass: - style: compressed - -compress_html: - clippings: all - comments: all - endings: all - profile: false - blanklines: false - ignore: - envs: [development] - -exclude: - - "*.gem" - - "*.gemspec" - - docs - - tools - - README.md - - LICENSE - - purgecss.js - - rollup.config.js - - "package*.json" - -jekyll-archives: - enabled: [categories, tags] - layouts: - category: category - tag: tag - permalinks: - tag: /tags/:name/ - category: /categories/:name/ diff --git a/_data/contact.yml b/_data/contact.yml deleted file mode 100644 index 3574e11..0000000 --- a/_data/contact.yml +++ /dev/null @@ -1,38 +0,0 @@ -# The contact options. -# icons powered by -# -- type: github - icon: "fab fa-github" - -# - type: email -# icon: "fas fa-envelope" -# noblank: true # open link in current tab - -- type: mastodon - icon: 'fab fa-mastodon' - # Fill with your Mastodon account page, rel="me" will be applied for verification - url: 'https://mstdn.md/@radu' - -# - type: linkedin -# icon: 'fab fa-linkedin' # icons powered by -# url: 'www.linkedin.com/in/radu-c-martin' - -- type: matrix - icon: 'fa-solid fa-message' - url: 'https://matrix.to/#/@radu:martin.md' -# -# - type: bluesky -# icon: 'fa-brands fa-bluesky' -# url: '' # Fill with your Bluesky profile link -# -# - type: reddit -# icon: 'fa-brands fa-reddit' -# url: '' # Fill with your Reddit profile link -# -# - type: threads -# icon: 'fa-brands fa-threads' -# url: '' # Fill with your Threads profile link - -- type: rss - icon: "fas fa-rss" - noblank: true diff --git a/_data/share.yml b/_data/share.yml deleted file mode 100644 index 6f97568..0000000 --- a/_data/share.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Sharing options at the bottom of the post. -# Icons from - -platforms: - - type: Twitter - icon: "fa-brands fa-square-x-twitter" - link: "https://twitter.com/intent/tweet?text=TITLE&url=URL" - - - type: Facebook - icon: "fab fa-facebook-square" - link: "https://www.facebook.com/sharer/sharer.php?title=TITLE&u=URL" - - - type: Telegram - icon: "fab fa-telegram" - link: "https://t.me/share/url?url=URL&text=TITLE" - - # Uncomment below if you need to. - # - # - type: Linkedin - # icon: "fab fa-linkedin" - # link: "https://www.linkedin.com/sharing/share-offsite/?url=URL" - # - # - type: Weibo - # icon: "fab fa-weibo" - # link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL" - # - # - type: Mastodon - # icon: "fa-brands fa-mastodon" - # # See: https://github.com/justinribeiro/share-to-mastodon#properties - # instances: - # - label: mastodon.social - # link: "https://mastodon.social/" - # - label: mastodon.online - # link: "https://mastodon.online/" - # - label: fosstodon.org - # link: "https://fosstodon.org/" - # - label: photog.social - # link: "https://photog.social/" - # - # - type: Bluesky - # icon: "fa-brands fa-bluesky" - # link: "https://bsky.app/intent/compose?text=TITLE%20URL" - # - # - type: Reddit - # icon: "fa-brands fa-square-reddit" - # link: "https://www.reddit.com/submit?url=URL&title=TITLE" - # - # - type: Threads - # icon: "fa-brands fa-square-threads" - # link: "https://www.threads.net/intent/post?text=TITLE%20URL" diff --git a/_plugins/posts-lastmod-hook.rb b/_plugins/posts-lastmod-hook.rb deleted file mode 100644 index 1fd6ecf..0000000 --- a/_plugins/posts-lastmod-hook.rb +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -# -# Check for changed posts - -Jekyll::Hooks.register :posts, :post_init do |post| - - commit_num = `git rev-list --count HEAD "#{ post.path }"` - - if commit_num.to_i > 1 - lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"` - post.data['last_modified_at'] = lastmod_date - end - -end diff --git a/_posts/.placeholder b/_posts/.placeholder deleted file mode 100644 index 8b13789..0000000 --- a/_posts/.placeholder +++ /dev/null @@ -1 +0,0 @@ - diff --git a/_tabs/about.md b/_tabs/about.md deleted file mode 100644 index ddb2bc4..0000000 --- a/_tabs/about.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# the default layout is 'page' -icon: fas fa-info-circle -order: 4 ---- - -> Add Markdown syntax content to file `_tabs/about.md`{: .filepath } and it will show up on this page. -{: .prompt-tip } diff --git a/_tabs/archives.md b/_tabs/archives.md deleted file mode 100644 index c3abc59..0000000 --- a/_tabs/archives.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: archives -icon: fas fa-archive -order: 3 ---- diff --git a/_tabs/categories.md b/_tabs/categories.md deleted file mode 100644 index 2d241be..0000000 --- a/_tabs/categories.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: categories -icon: fas fa-stream -order: 1 ---- diff --git a/_tabs/tags.md b/_tabs/tags.md deleted file mode 100644 index ded3adc..0000000 --- a/_tabs/tags.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: tags -icon: fas fa-tags -order: 2 ---- diff --git a/assets/icons/brand-git.svg b/assets/icons/brand-git.svg new file mode 100644 index 0000000..7035edb --- /dev/null +++ b/assets/icons/brand-git.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/brand-mastodon.svg b/assets/icons/brand-mastodon.svg new file mode 100644 index 0000000..972d80b --- /dev/null +++ b/assets/icons/brand-mastodon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/brand-matrix.svg b/assets/icons/brand-matrix.svg new file mode 100644 index 0000000..290cb36 --- /dev/null +++ b/assets/icons/brand-matrix.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/person.svg b/assets/icons/person.svg new file mode 100644 index 0000000..d420380 --- /dev/null +++ b/assets/icons/person.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/assets/avatar.png b/assets/img/avatar.png similarity index 100% rename from assets/avatar.png rename to assets/img/avatar.png diff --git a/assets/jsconfig.json b/assets/jsconfig.json new file mode 100644 index 0000000..d0f8387 --- /dev/null +++ b/assets/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "*": [ + "../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.30.0/assets/*" + ] + } + } +} \ No newline at end of file diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss new file mode 100644 index 0000000..942c2bb --- /dev/null +++ b/assets/scss/custom.scss @@ -0,0 +1,3 @@ +/* + You can add your own custom styles here. +*/ \ No newline at end of file diff --git a/config/_default/_languages.toml b/config/_default/_languages.toml new file mode 100644 index 0000000..9a48cc4 --- /dev/null +++ b/config/_default/_languages.toml @@ -0,0 +1,6 @@ +# Rename this file to languages.toml to enable multilingual support +[en] +languageName = "English" +languagedirection = "ltr" +title = "The Pensieve" +weight = 1 diff --git a/config/_default/config.toml b/config/_default/config.toml new file mode 100644 index 0000000..4246354 --- /dev/null +++ b/config/_default/config.toml @@ -0,0 +1,18 @@ +# Change baseurl before deploy +baseurl = "https://blog.martin.md" +languageCode = "en-us" +title = "The Pensieve" + +# Theme i18n support +# Available values: en, fr, id, ja, ko, pt-br, zh-cn, zh-tw, es, de, nl, it, th, el, uk, ar +defaultContentLanguage = "en" + +# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko] +# This will make .Summary and .WordCount behave correctly for CJK languages. +hasCJKLanguage = false + +# Change it to your Disqus shortname before using +disqusShortname = "hugo-theme-stack" + +[pagination] +pagerSize = 5 diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..98928e0 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,26 @@ +# Markdown renderer configuration +[goldmark.renderer] +unsafe = true + +[goldmark.extensions.passthrough] +enable = true + +# LaTeX math support +# https://gohugo.io/content-management/mathematics/ +[goldmark.extensions.passthrough.delimiters] +block = [['\[', '\]'], ['$$', '$$']] +inline = [['\(', '\)']] + +[tableOfContents] +endLevel = 4 +ordered = true +startLevel = 2 + +[highlight] +noClasses = false +codeFences = true +guessSyntax = true +lineNoStart = 1 +lineNos = true +lineNumbersInTable = true +tabWidth = 4 \ No newline at end of file diff --git a/config/_default/menu.toml b/config/_default/menu.toml new file mode 100644 index 0000000..4860193 --- /dev/null +++ b/config/_default/menu.toml @@ -0,0 +1,44 @@ +# Configure main menu and social menu +#[[main]] +#identifier = "home" +#name = "Home" +#url = "/" +#[main.params] +#icon = "home" +#newtab = true + +[[social]] +identifier = "github" +name = "GitHub" +url = "https://github.com/Radu-C-Martin" +weight = 1 + +[social.params] +icon = "brand-github" + +[[social]] +identifier = "forgejo" +name = "Forgejo" +url = "https://git.martin.md/radu" +weight = 2 + +[social.params] +icon = "brand-git" + +[[social]] +identifier = "mastodon" +name = "Mastodon" +url = "https://mstdn.md/@radu" +weight = 3 + +[social.params] +icon = "brand-mastodon" + +[[social]] +identifier = "matrix" +name = "Matrix" +url = "https://matrix.to/#/@radu:martin.md" +weight = 4 + +[social.params] +icon = "brand-matrix" diff --git a/config/_default/module.toml b/config/_default/module.toml new file mode 100644 index 0000000..f13256c --- /dev/null +++ b/config/_default/module.toml @@ -0,0 +1,2 @@ +[[imports]] +path = "github.com/CaiJimmy/hugo-theme-stack/v3" diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..581d36e --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,85 @@ +# Pages placed under these sections will be shown on homepage and archive page. +mainSections = ["post"] +# Output page's full content in RSS. +rssFullContent = true +favicon = "/favicon.png" + +[footer] +since = 2025 +customText = "" + +[dateFormat] +published = "Jan 02, 2006" +lastUpdated = "Jan 02, 2006 15:04 MST" + +[sidebar] +emoji = "🎮" +subtitle = "A loosely organized archive of projects, thoughts, and experiments." + +[sidebar.avatar] +enabled = true +local = true +src = "img/avatar.png" + +[article] +headingAnchor = false +math = false +readingTime = true + +[article.license] +enabled = false +default = "Licensed under CC BY-NC-SA 4.0" + +## Widgets +[[widgets.homepage]] +type = "search" + +[[widgets.homepage]] +type = "archives" + +[widgets.homepage.params] +limit = 5 + +[[widgets.homepage]] +type = "categories" + +[widgets.homepage.params] +limit = 10 + +[[widgets.homepage]] +type = "tag-cloud" + +[widgets.homepage.params] +limit = 10 + +[[widgets.page]] +type = "toc" + +[opengraph.twitter] +site = "" +card = "summary_large_image" + +[defaultImage.opengraph] +enabled = false +local = false +src = "" + +[colorScheme] +toggle = true +default = "auto" + +[imageProcessing.cover] +enabled = true + +[imageProcessing.content] +enabled = true + +## Comments +[comments] +enabled = false +provider = "cactus" + +[comments.cactus] +defaultHomeserverUrl = "https://matrix.cactus.chat:8448" +serverName = "cactus.chat" +siteName = "" diff --git a/config/_default/permalinks.toml b/config/_default/permalinks.toml new file mode 100644 index 0000000..2499a7e --- /dev/null +++ b/config/_default/permalinks.toml @@ -0,0 +1,3 @@ +# Permalinks format of each content section +post = "/p/:slug/" +page = "/:slug/" \ No newline at end of file diff --git a/config/_default/related.toml b/config/_default/related.toml new file mode 100644 index 0000000..ae9f69a --- /dev/null +++ b/config/_default/related.toml @@ -0,0 +1,12 @@ +# Related contents configuration +includeNewer = true +threshold = 60 +toLower = false + +[[indices]] +name = "tags" +weight = 100 + +[[indices]] +name = "categories" +weight = 200 diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..636abae --- /dev/null +++ b/content/_index.md @@ -0,0 +1,8 @@ +--- +menu: + main: + name: Home + weight: 1 + params: + icon: home +--- \ No newline at end of file diff --git a/content/categories/example-category/_index.md b/content/categories/example-category/_index.md new file mode 100644 index 0000000..678b089 --- /dev/null +++ b/content/categories/example-category/_index.md @@ -0,0 +1,10 @@ +--- +title: Example Category +description: A description of this category +image: + +# Badge style +style: + background: "#2a9d8f" + color: "#fff" +--- \ No newline at end of file diff --git a/content/page/about/index.md b/content/page/about/index.md new file mode 100644 index 0000000..5a391f0 --- /dev/null +++ b/content/page/about/index.md @@ -0,0 +1,37 @@ +--- +title: About Me +slug: about +menu: + main: + weight: 5 + params: + icon: person + +readingTime: false +license: false +toc: false +--- +Hi, I'm Radu, and this is my personal blog. + +I'm a Mechanical Engineer by training, and a Software Developer by (current) +trade. + +This blog is a place where I document things I’ve built, explored, or +learned — whether it’s through code, a side project, or just a good book or film. +It’s part journal, part playground, and sometimes just a place to organize my +thoughts. + +The quality, quantity and length of posts will + +### Data Privacy Policy + +I don’t really expect this blog to get much traffic… or any, really. But since +it’s a publicly accessible page—and given the limited resources I can allocate +to it—I like to keep an eye on general activity. + +I don’t need in-depth tracking or detailed analytics, so commercial tracking +solutions aren’t a good fit here. + +Instead, this site uses a self-hosted instance of +[Umami](https://github.com/umami-software/umami) for basic analytics. All data +is anonymized, stored locally, and never shared with third parties. diff --git a/content/page/archives/index.md b/content/page/archives/index.md new file mode 100644 index 0000000..2b1bf20 --- /dev/null +++ b/content/page/archives/index.md @@ -0,0 +1,11 @@ +--- +title: "Archives" +date: 2022-03-06 +layout: "archives" +slug: "archives" +menu: + main: + weight: 2 + params: + icon: archives +--- \ No newline at end of file diff --git a/content/page/links/index.md b/content/page/links/index.md new file mode 100644 index 0000000..3449700 --- /dev/null +++ b/content/page/links/index.md @@ -0,0 +1,38 @@ +--- +title: Links +links: + - title: GitHub + description: GitHub is the world's largest software development platform. + website: https://github.com + image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + - title: TypeScript + description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. + website: https://www.typescriptlang.org + image: ts-logo-128.jpg +menu: + main: + weight: 4 + params: + icon: link + +draft: true +comments: false +--- + +To use this feature, add `links` section to frontmatter. + +This page's frontmatter: + +```yaml +links: + - title: GitHub + description: GitHub is the world's largest software development platform. + website: https://github.com + image: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + - title: TypeScript + description: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. + website: https://www.typescriptlang.org + image: ts-logo-128.jpg +``` + +`image` field accepts both local and external images. diff --git a/content/page/search/index.md b/content/page/search/index.md new file mode 100644 index 0000000..2a4bff1 --- /dev/null +++ b/content/page/search/index.md @@ -0,0 +1,13 @@ +--- +title: "Search" +slug: "search" +layout: "search" +outputs: + - html + - json +menu: + main: + weight: 3 + params: + icon: search +--- diff --git a/content/post/2025-04-07-hello-friend/index.md b/content/post/2025-04-07-hello-friend/index.md new file mode 100644 index 0000000..3092526 --- /dev/null +++ b/content/post/2025-04-07-hello-friend/index.md @@ -0,0 +1,72 @@ +--- +title: Hello, Friend +description: So I've decided to have a blog +slug: hello-friend +date: 2025-04-07 14:30:00+0200 +categories: + - Technology + - Projects +tags: + - homelab + - self-hosting + - docker-compose +weight: 1 +draft: true +--- + +## Introduction +This is -- technically -- not my first time hosting a blog, but it *is* the first +time this decade. + +First time I've tried hosting a blog was in 2009, the year I got my domain. The +domain came with an introductory offer of free web-hosting for a year. So I +figured out just enough MySql and FTP to yeet a WordPress installation on +there, and make it run. As I remember it, I got as far as installing a custom +theme I really liked, and writing at most three posts, all of them in the first +month. Then the blog just stayed up until my hosting expired, without any +further updates. + +Second time I tried a blog was a bit later, after I got into self-hosting. The +internet archive says it's 2018 [[1]], so it must be true. That time I +never ended up actually posting anything, since I was mainly just interested in +deploying the site. + +Which brings me to the present, and the third time I'm trying to set up a +blog. This time, the marginal cost of me setting a blog is insignificant, since +I'm already self-hosting plenty of services for my own use. This does not mean +that I'm going to be more active than before, but the blog will probably stay +up for more than a few months. + +## Why a blog? + + + +- Accountability for projects, whatever they might be +- Sense of finality for projects +- Reference older stuff +- It's about the journey, not the destination +- Random stuff that's longer form than a mastodon post + +### Yes, but why a **blog**? +A blog feels right for grouping, filtering, organization, content size limit, etc... + +## How a blog +Jekyll, Hugo, Ghost, and others. + +### Different concepts (CMS vs static websites) +### Different static website generators +#### Jekyll +#### Hugo + +### Infrastructure +#### Self hosting +#### Git repository and CI + +## Rules... Nay, guidelines +- I don't do projects to write a blog post about them, I write a blog post to document a project +- No promise of future posts, that NEVER works out (I'll explain why that's the case in a future post) + +## What to expect, and how often can be expected +No expectations whatsoever about frequency and/or quality of anything contained wihin this here page. + +[1]: https://web.archive.org/web/20180810023635/http://martin.md/ diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index da804ee..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - - blog: - image: git.martin.md/radu/blog:latest@sha256:7de45b21e33343b58cf29036c4f0818cb4e2e28325f1cb51ee05884f437c36fc - restart: unless-stopped - labels: - - "traefik.enable=true" - - "traefik.http.routers.blog.rule=Host(`${DC_BLOG_HOSTNAME:-blog.martin.md}`)" - - "traefik.http.routers.blog.entrypoints=websecure" - networks: - - traefik - -networks: - traefik: - external: true - diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..038ef8b --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/CaiJimmy/hugo-theme-stack-starter + +go 1.17 + +require github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..df9ea52 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0 h1:uITC7EKGyfPjyi3C5At++E0Uu1qQXtqiwMV4pd7LkLs= +github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0/go.mod h1:IPmCXiIxlFSLFYS0tOmYP6ySLviyeNVSabyvSuaxD+I= diff --git a/index.html b/index.html deleted file mode 100644 index 1357b08..0000000 --- a/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: home -# Index page ---- diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000..e53125d Binary files /dev/null and b/static/favicon.png differ diff --git a/tools/run.sh b/tools/run.sh deleted file mode 100755 index 0efc452..0000000 --- a/tools/run.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -# -# Run jekyll serve and then launch the site - -prod=false -command="bundle exec jekyll s -l" -host="127.0.0.1" - -help() { - echo "Usage:" - echo - echo " bash /path/to/run [options]" - echo - echo "Options:" - echo " -H, --host [HOST] Host to bind to." - echo " -p, --production Run Jekyll in 'production' mode." - echo " -h, --help Print this help information." -} - -while (($#)); do - opt="$1" - case $opt in - -H | --host) - host="$2" - shift 2 - ;; - -p | --production) - prod=true - shift - ;; - -h | --help) - help - exit 0 - ;; - *) - echo -e "> Unknown option: '$opt'\n" - help - exit 1 - ;; - esac -done - -command="$command -H $host" - -if $prod; then - command="JEKYLL_ENV=production $command" -fi - -if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then - command="$command --force_polling" -fi - -echo -e "\n> $command\n" -eval "$command" diff --git a/tools/test.sh b/tools/test.sh deleted file mode 100755 index 331de1c..0000000 --- a/tools/test.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash -# -# Build and test the site content -# -# Requirement: html-proofer, jekyll -# -# Usage: See help information - -set -eu - -SITE_DIR="_site" - -_config="_config.yml" - -_baseurl="" - -help() { - echo "Build and test the site content" - echo - echo "Usage:" - echo - echo " bash $0 [options]" - echo - echo "Options:" - echo ' -c, --config "" Specify config file(s)' - echo " -h, --help Print this information." -} - -read_baseurl() { - if [[ $_config == *","* ]]; then - # multiple config - IFS="," - read -ra config_array <<<"$_config" - - # reverse loop the config files - for ((i = ${#config_array[@]} - 1; i >= 0; i--)); do - _tmp_baseurl="$(grep '^baseurl:' "${config_array[i]}" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" - - if [[ -n $_tmp_baseurl ]]; then - _baseurl="$_tmp_baseurl" - break - fi - done - - else - # single config - _baseurl="$(grep '^baseurl:' "$_config" | sed "s/.*: *//;s/['\"]//g;s/#.*//")" - fi -} - -main() { - # clean up - if [[ -d $SITE_DIR ]]; then - rm -rf "$SITE_DIR" - fi - - read_baseurl - - # build - JEKYLL_ENV=production bundle exec jekyll b \ - -d "$SITE_DIR$_baseurl" -c "$_config" - - # test - bundle exec htmlproofer "$SITE_DIR" \ - --disable-external \ - --ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" -} - -while (($#)); do - opt="$1" - case $opt in - -c | --config) - _config="$2" - shift - shift - ;; - -h | --help) - help - exit 0 - ;; - *) - # unknown option - help - exit 1 - ;; - esac -done - -main