diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..1969d8b --- /dev/null +++ b/config.toml @@ -0,0 +1,73 @@ +baseurl = "/" +languageCode = "en-us" +# Add it only if you keep the theme in the `themes` directory. +# Remove it if you use the theme as a remote Hugo Module. +theme = "hello-friend" +paginate = 5 +enableGitInfo = true + +[params] + # dir name of your blog content (default is `content/posts`). + # the list of set content will show up on your index page (baseurl). + contentTypeName = "homelab" + + # OS theme is default when not provided, but you can force it to "light" or "dark" + defaultTheme = "light" + + # if you set this to 0, only submenu trigger will be visible + showMenuItems = 5 + + # Show reading time in minutes for posts + showReadingTime = true + + # Show table of contents at the top of your posts (defaults to false) + # Alternatively, add this param to post front matter for specific posts + # toc = true + + # Show full page content in RSS feed items + #(default is Description or Summary metadata in the front matter) + # rssFullText = true + +[languages] + [languages.en] + title = "broillet@blog" + subtitle = "A blog about self-hosting and homelab." + keywords = "proxmox,vm,docker,lxc,selfhost,self-hosted,homelab,network" + copyright = "" + menuMore = "Show more" + writtenBy = "Written by" + readMore = "Read more" + readOtherPosts = "Read other posts" + newerPosts = "Newer posts" + olderPosts = "Older posts" + minuteReadingTime = "min read" + dateFormatSingle = "January 2, 2006" + dateFormatList = "January 2, 2006" + # leave empty to disable, enter display text to enable + lastModDisplay = "Modified:" + + [languages.en.params.logo] + logoText = "broillet@blog" + logoHomeLink = "/" + # or + # + # path = "/img/your-example-logo.svg" + # alt = "Your example logo alt text" + + [languages.en.menu] + [[languages.en.menu.main]] + identifier = "about" + name = "About" + url = "/about" + [[languages.en.menu.main]] + identifier = "general" + name = "General" + url = "/general" + [[languages.en.menu.main]] + identifier = "homelab" + name = "HomeLab" + url = "/homelab" + [[languages.en.menu.main]] + identifier = "archive" + name = "Archive" + url = "/archive" \ No newline at end of file diff --git a/config.yaml b/config.yaml.disabled similarity index 100% rename from config.yaml rename to config.yaml.disabled diff --git a/content/about.md b/content/about.md index ff8ecfc..07e686e 100644 --- a/content/about.md +++ b/content/about.md @@ -1,21 +1,24 @@ -+++ -title = "About" -date = "2019-01-25" -author = "Radek" -+++ +--- +title: "About" +date: "2023-06-11" +author: "Mathieu Broillet" +#cover : "img/myself.jpg" +#coverAlt : "picture of myself" +description : "About me, who am I?" +tags : ['about', 'whoami'] +--- -# Hi there -My name is Radek and I'm the author of this theme. I made it to help you present your ideas easier. -We all know how hard is to start something on the web, especially these days. You need to prepare a bunch of stuff, configure them and when that’s done — create the content. +{{< image src="/img/myself.png" position="center" style="height: auto; width: auto">}} -This theme is pretty basic and covers all of the essentials. All you have to do is start typing! +# > whoami -The theme includes: +Hello, everyone! 👋 -- **light/dark mode**, depending on your preferences -- great reading experience thanks to [**Inter UI font**](https://rsms.me/inter/), made by [Rasmus Andersson](https://rsms.me/about/) -- nice code highlighting thanks to [**PrismJS**](https://prismjs.com) +I'm Mathieu Broillet, I am 19 years old living in Switzerland 🇨🇭 and the proud author of this **captivating** blog! -So, there you have it... enjoy! +Here, I primarily delve into the fascinating world of self-hosting and share insights about my own homelab. One of my main goals is to provide comprehensive documentation on each service I deploy. +By doing so, I hope to simplify the process for both novice users (and myself), enabling them to effortlessly (re)create these services within their own homelab environments. + +*While I may not claim the title of a flawless wordsmith, I am committed to expressing my thoughts and ideas with utmost clarity and eloquence. It's worth mentioning that English is not my native language, but I strive to deliver high-quality content nonetheless.* \ No newline at end of file diff --git a/content/archive.md b/content/archive.md index 68c3b18..9fed37c 100644 --- a/content/archive.md +++ b/content/archive.md @@ -1,6 +1,6 @@ -+++ -title = "Archive" -layout = "list" -url = "/archive" -type = "archive" -+++ +--- +title: "Archive" +layout: "list" +url: "/archive" +type: "archive" +--- diff --git a/content/general/create-nfs-share.md b/content/general/create-nfs-share.md new file mode 100644 index 0000000..3192d92 --- /dev/null +++ b/content/general/create-nfs-share.md @@ -0,0 +1,42 @@ +--- +title: "How to create and connect to an NFS Share" +date: 2023-06-11T15:33:44+02:00 +draft: true +author: "Mathieu Broillet" + +description : "Just a few commands to keep on hand" +tags : ['emojis', 'fedora'] +--- + + +To create an NFS share, you'll first need to install the `nfs-kernel-server` package. You can do this by running the following command: + +{{< code language="BASH" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo apt install -y nfs-kernel-server +{{< /code >}} + +Once the installation is complete, navigate to the `/etc/exports` file and add the following configuration (this is just an example): + +{{< code language="BASH" expand="Show" collapse="Hide" isCollapsed="false" >}} +/data/library 192.168.0.0/16(rw,sync,no_subtree_check) +{{< /code >}} + +To mount the NFS share on a client machine, you'll need the `nfs-common` package. Install it by running: + +{{< code language="BASH" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo apt install -y nfs-common +{{< /code >}} + +Next, open the `/etc/fstab` file and add the following entry: + +{{< code language="BASH" expand="Show" collapse="Hide" isCollapsed="false" >}} +192.168.1.207:/data/library /data/library/ nfs defaults,user,auto,nofail,_netdev,bg 0 0 +{{< /code >}} + +If you prefer to mount the share without using `/etc/fstab`, you can run the following command: + +{{< code language="BASH" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo mount -t nfs 192.168.1.207:/data/library /mnt/temp +{{< /code >}} + +That's it! You should now have your NFS share set up and ready to use. Let me know if you need further assistance. \ No newline at end of file diff --git a/content/general/fedora-emoji.md b/content/general/fedora-emoji.md new file mode 100644 index 0000000..82174bf --- /dev/null +++ b/content/general/fedora-emoji.md @@ -0,0 +1,18 @@ +--- +title: "How to replace Google emoji by Twitter's on Fedora" +date: 2023-06-11T13:06:44+02:00 +draft: true +author: "Mathieu Broillet" +cover : "img/twitter-emojis.png" +# coverAlt : "alt image" +# coverCaption : "credit of image" +description : "Tired of the defaults noto-sans emojis?" +tags : ['emojis', 'fedora'] +--- + +By default, Fedora uses the Google Noto emojis, but let's be honest, they're not the prettiest ones out there. They can make some apps look less appealing than they could be. That's why I'm going to show you how to install the Twitter emojis, which, in my personal opinion, have a better look. Let's make our Fedora system even more stylish! + +{{< code language="BASH" title="Uninstall noto and install twemoji" id="1" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo dnf remove google-noto-emoji-color-fonts -y +sudo dnf install twitter-twemoji-fonts -y +{{< /code >}} \ No newline at end of file diff --git a/content/homelab/install-docker.md b/content/homelab/install-docker.md new file mode 100644 index 0000000..69a83eb --- /dev/null +++ b/content/homelab/install-docker.md @@ -0,0 +1,96 @@ +--- +title: "How to install Docker and Portainer" +date: 2023-06-11T13:06:44+02:00 +draft: true +author: "Mathieu Broillet" +cover : "img/docker.png" +# coverAlt : "alt image" +# coverCaption : "credit of image" +description : "How to install Docker, Portainer and the Portainer agent" +tags : ['docker', 'portainer', 'podman'] +--- + +# Introduction + +To install Docker, you can follow the steps outlined in the [official](https://docs.docker.com/engine/install/) Docker installation documentation. + +# Installation +## Docker +### Debian +If you're using Debian, you can use the following commands: +{{< code language="BASH" title="Debian" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo apt-get remove docker docker-engine docker.io containerd runc -y +sudo apt-get update -y +sudo apt-get install \ + ca-certificates \ + curl \ + gnupg -y +sudo install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +sudo chmod a+r /etc/apt/keyrings/docker.gpg +echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update -y +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y +{{< /code >}} + + +### Ubuntu +If you're using Ubuntu, you can use the following commands: + +{{< code language="BASH" title="Ubuntu" expand="Show" collapse="Hide" isCollapsed="false" >}} +sudo apt-get remove docker docker-engine docker.io containerd runc -y +sudo apt-get update -y +sudo apt-get install ca-certificates curl gnupg -y +sudo install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +sudo chmod a+r /etc/apt/keyrings/docker.gpg +echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update -y +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y +{{< /code >}} + +## Portainer + +Here are the commands to install Portainer and upgrade the Portainer container: + +{{< code language="BASH" title="Installation" expand="Show" collapse="Hide" isCollapsed="false" >}} +docker run -d -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest +{{< /code >}} + +{{< code language="BASH" title="Upgrade" expand="Show" collapse="Hide" isCollapsed="false" >}} +docker stop portainer +docker rm portainer +docker image rm portainer/portainer-ce:latest +docker run -d -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest +{{< /code >}} + +### Agent + +{{< code language="BASH" title="Installation" expand="Show" collapse="Hide" isCollapsed="false" >}} +docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent +{{< /code >}} + +{{< code language="BASH" title="Re-installation" expand="Show" collapse="Hide" isCollapsed="false" >}} +docker stop portainer_agent +docker rm portainer_agent +docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent +{{< /code >}} + +{{< code language="BASH" title="Installation on Podman" expand="Show" collapse="Hide" isCollapsed="false" >}} +systemctl enable --now podman.socket +mkdir -p /var/lib/containers/storage/volumes + +podman run -d --privileged \ + -p 9001:9001 \ + --name portainer_agent \ + --restart=always \ + -v /run/podman/podman.sock:/var/run/docker.sock:Z \ + -v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \ + portainer/agent +{{< /code >}} \ No newline at end of file diff --git a/content/homelab/updates-with-watchtower.md b/content/homelab/updates-with-watchtower.md new file mode 100644 index 0000000..9e5c3d0 --- /dev/null +++ b/content/homelab/updates-with-watchtower.md @@ -0,0 +1,189 @@ +--- +title: "Automatics updates with WatchTower and HA notifications" +date: 2023-06-11T13:06:44+02:00 +draft: true +author: "Mathieu Broillet" +cover : "img/watchtower-docker.png" +# coverAlt : "alt image" +# coverCaption : "credit of image" +description : "Tired of checking for updates every few days? Install WatchTower!" +tags : ['docker', 'watchtower'] +--- + +With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially. + +I made a short script to automatically create the docker compose file and start it on any host (should work on debian/alpine). It also sends a notification to a webhook running on HomeAssistant. + +{{< code language="BASH" title="Script to auto create a watchtower compose stack" expand="Show" collapse="Hide" isCollapsed="false" >}} +apk add docker-compose # if on alpine +docker container stop watchtower-watchtower-1 +docker container rm watchtower-watchtower-1 +mkdir -p /var/data/watchtower/ +cat </var/data/watchtower/docker-compose.yml +--- +version: "3" +services: + watchtower: + image: containrrr/watchtower + # command: --run-once #notify-upgrade + restart: always + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + WATCHTOWER_CLEANUP: "true" + WATCHTOWER_NOTIFICATION_REPORT: "true" + WATCHTOWER_NOTIFICATION_URL: > + generic://ha.xyz.abc/api/webhook/watchtower_notification + WATCHTOWER_NOTIFICATION_TEMPLATE: | + {{- if .Report -}} + {{- with .Report -}} + {{len .Scanned}} Scan, {{len .Updated}} Mise à jour, {{len .Failed}} Échec + {{- range .Updated}} + - {{.ImageName}}: Mis à jour + {{- end -}} + {{- range .Fresh}} + - {{.ImageName}}: OK + {{- end -}} + {{- range .Skipped}} + - {{.ImageName}}: {{.State}}: {{.Error}} + {{- end -}} + {{- range .Failed}} + - {{.ImageName}}: {{.State}}: {{.Error}} + {{- end -}} + {{- end -}} + {{- else -}} + {{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}} + {{- end -}} +EOF +cd /var/data/watchtower/ +docker compose up -d +{{< /code >}} + + +I am then using Node-RED to parse the notification and send it to my phone in a more "readable" format. +For this code to work, you need to have NodeRED and the HomeAssistant addon (node-red-contrib-home-assistant-websocket) installed. + +{{< code language="JSON" title="NodeRED flow for parsing watchtower webhook" expand="Show" collapse="Hide" isCollapsed="true" >}} +[ + { + "id": "cbcf3a96685a4553", + "type": "ha-webhook", + "z": "ee9d63dee39b7924", + "name": "Watchtower Notification", + "server": "f00dc31d.a2b0e", + "version": 1, + "outputs": 1, + "webhookId": "watchtower_notification", + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "data" + } + ], + "payloadLocation": false, + "payloadLocationType": false, + "headersLocation": false, + "headersLocationType": false, + "x": 150, + "y": 2280, + "wires": [ + [ + "56ae4b8a75d63963" + ] + ] + }, + { + "id": "56ae4b8a75d63963", + "type": "switch", + "z": "ee9d63dee39b7924", + "name": "Check if any update/skip/fail", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "cont", + "v": "Mis à jour", + "vt": "str" + }, + { + "t": "cont", + "v": "Fail", + "vt": "str" + }, + { + "t": "cont", + "v": "Skip", + "vt": "str" + } + ], + "checkall": "false", + "repair": false, + "outputs": 3, + "x": 430, + "y": 2280, + "wires": [ + [ + "f90014bfd991bb75" + ], + [ + "f90014bfd991bb75" + ], + [ + "f90014bfd991bb75" + ] + ] + }, + { + "id": "f90014bfd991bb75", + "type": "api-call-service", + "z": "ee9d63dee39b7924", + "name": "Send notification to mathieu", + "server": "f00dc31d.a2b0e", + "version": 5, + "debugenabled": false, + "domain": "notify", + "service": "mobile_app_oneplus_8t", + "areaId": [], + "deviceId": [], + "entityId": [], + "data": "{\t \"title\": \"WatchTower\",\t \"message\": payload,\t \"data\": {\t \"ttl\": 0,\t \"priority\": \"high\"\t }\t}\t", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "x": 730, + "y": 2280, + "wires": [ + [] + ] + }, + { + "id": "bfcb353047dce568", + "type": "comment", + "z": "ee9d63dee39b7924", + "name": "Watchtower notification", + "info": "", + "x": 150, + "y": 2240, + "wires": [] + }, + { + "id": "f00dc31d.a2b0e", + "type": "server", + "name": "Home Assistant", + "addon": false, + "rejectUnauthorizedCerts": true, + "ha_boolean": "", + "connectionDelay": false, + "cacheJson": false, + "heartbeat": false, + "heartbeatInterval": "", + "statusSeparator": "", + "enableGlobalContextStore": false + } +] +{{< /code >}} +*Import this via the NodeRED UI (Ctrl+I)* \ No newline at end of file diff --git a/content/homelab/vscode-alpine.md b/content/homelab/vscode-alpine.md new file mode 100644 index 0000000..44a1882 --- /dev/null +++ b/content/homelab/vscode-alpine.md @@ -0,0 +1,54 @@ +--- +title: "Use VSCode Remote on Alpine Linux hosts" +date: 2023-06-11T16:01:44+02:00 +draft: true +author: "Mathieu Broillet" +cover : "img/vscode.png" +# coverAlt : "alt image" +# coverCaption : "credit of image" +description : "Microsoft not even capable of adding a few commands to their install script..." +tags : ['docker', 'watchtower'] +--- + +When it comes to Microsoft, it's not uncommon to encounter unresolved issues, and one such case is using the VSCode remote agent on Alpine Linux. +By default, Alpine Linux utilizes Dropbear, which isn't compatible with remote development in VSCode. However, fret not! I've got a few commands that can help you overcome this hurdle and add support for Alpine. + +{{< code language="BASH" title="Add Alpine support for Remote VSCode" expand="Show" collapse="Hide" isCollapsed="false" >}} +# Stop and remove Dropbear +rc-service dropbear stop +rc-update del dropbear +apk del dropbear* -f + +# Stop and remove SSHD +rc-service sshd stop +rc-update del sshd +apk del openssh* -f + +# Clean up Dropbear and SSH configurations +rm -rf /etc/dropbear +rm -rf /etc/ssh +rm /etc/init.d/ssh + +# Reboot now if needed +# reboot now + +# Install OpenSSH and necessary packages +apk add openssh gcompat libstdc++ curl bash git grep +apk add procps --no-cache + +# Start and add SSHD to startup +rc-service sshd start +rc-update add sshd + +# Update AllowTcpForwarding setting +sed -i 's/^#*AllowTcpForwarding.*/AllowTcpForwarding yes/' /etc/ssh/sshd_config + +# Update PermitTunnel setting +sed -i 's/^#*PermitTunnel.*/PermitTunnel yes/' /etc/ssh/sshd_config + +# Uncomment the line if needed (remove '#' at the beginning) +sed -i 's/^#PermitTunnel.*/PermitTunnel yes/' /etc/ssh/sshd_config + +# Restart the SSH service to apply the changes +/etc/init.d/sshd restart +{{< /code >}} diff --git a/content/posts/my-first-post.md b/content/posts/my-first-post.md index a6f2439..221a358 100644 --- a/content/posts/my-first-post.md +++ b/content/posts/my-first-post.md @@ -4,7 +4,10 @@ date: 2023-06-11T13:06:44+02:00 draft: true # author: "Mathieu Broillet" # cover : "img/image.jpg" +# coverAlt : "alt image" +# coverCaption : "credit of image" # description : "Description" +tags : ['test', 'demo'] --- > "Hello, friend?" That's lame. diff --git a/content/showcase.md b/content/showcase.md deleted file mode 100644 index 2fa96a6..0000000 --- a/content/showcase.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "Showcase" -date: "2019-01-18" -author: "Lorem Ipsum" ---- - -## Header 2 - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec interdum metus. Aenean rutrum ligula sodales ex auctor, sed tempus dui mollis. Curabitur ipsum dui, aliquet nec commodo at, tristique eget ante. **Donec quis dolor nec nunc mollis interdum vel in purus**. Sed vitae leo scelerisque, sollicitudin elit sed, congue ante. In augue nisl, vestibulum commodo est a, tristique porttitor est. Proin laoreet iaculis ornare. Nullam ut neque quam. - -> Fusce pharetra suscipit orci nec tempor. Quisque vitae sem sit amet sem mollis consequat. Sed at imperdiet lorem. Vestibulum pharetra faucibus odio, ac feugiat tellus sollicitudin at. Pellentesque varius tristique mi imperdiet dapibus. Duis orci odio, sodales lacinia venenatis sit amet, feugiat et diam. - -### Header 3 - -Nulla libero turpis, lacinia vitae cursus ut, auctor dictum nisl. Fusce varius felis nec sem ullamcorper, at convallis nisi vestibulum. Duis risus odio, porta sit amet placerat mollis, tincidunt non mauris. Suspendisse fringilla, `odio a dignissim pharetra`, est urna sollicitudin urna, eu scelerisque magna ex vitae tellus. - -```css -/* PostCSS code */ - -pre { - background: #1a1a1d; - padding: 20px; - border-radius: 8px; - font-size: 1rem; - overflow: auto; - - @media ($phone) { - white-space: pre-wrap; - word-wrap: break-word; - } - - code { - background: none !important; - color: #ccc; - padding: 0; - font-size: inherit; - } -} -``` - -```js -// JS code - -const menuTrigger = document.querySelector('.menu-trigger') -const menu = document.querySelector('.menu') -const mobileQuery = getComputedStyle(document.body).getPropertyValue('--phoneWidth') -const isMobile = () => window.matchMedia(mobileQuery).matches -const isMobileMenu = () => { - menuTrigger.classList.toggle('hidden', !isMobile()) - menu.classList.toggle('hidden', isMobile()) -} - -isMobileMenu() - -menuTrigger.addEventListener('click', () => menu.classList.toggle('hidden')) - -window.addEventListener('resize', isMobileMenu) -``` - -```html - - -
-
-

{{ .Title }}

- {{ range .Pages }} - {{ .Render "summary"}} - {{ end }} -
-
-``` - -#### Header 4 - -Curabitur scelerisque felis viverra varius scelerisque. Ut enim libero, molestie gravida blandit at, mollis ornare tellus. Cras arcu mi, ultrices vel pulvinar vel, volutpat eu tortor. Nullam nec eros quis massa ultrices iaculis sed in metus. Praesent sollicitudin sem sit amet orci tempor gravida. - -- Maecenas elementum vitae nibh vitae porttitor. -- Aenean consequat, risus ut cursus placerat, arcu nulla sodales risus, ut molestie tellus tellus et dui. -- Integer imperdiet turpis vitae lacus imperdiet, ut ornare ligula auctor. Integer in mi eu velit vehicula suscipit eget vulputate nulla. -- Etiam vitae enim quis velit lobortis placerat a ut sem. - - Curabitur lobortis ante sit amet orci pulvinar, sollicitudin viverra nunc accumsan. - - Praesent fermentum orci quis leo facilisis posuere. - -Aliquam erat volutpat. In hac habitasse platea dictumst. Nunc ut tincidunt mauris. Sed at gravida risus, id semper magna. Nullam vitae enim mattis, sodales neque non, pharetra elit. Cras sit amet sagittis augue, et finibus turpis. Ut tempus tincidunt diam vel pharetra. Nulla porttitor odio sit amet nulla scelerisque, quis aliquam mi imperdiet. Sed tincidunt dui vel tellus vestibulum rhoncus. Donec tempus ultrices velit. diff --git a/static/img/docker.png b/static/img/docker.png new file mode 100644 index 0000000..c3da175 Binary files /dev/null and b/static/img/docker.png differ diff --git a/static/img/myself.png b/static/img/myself.png new file mode 100644 index 0000000..912f4c6 Binary files /dev/null and b/static/img/myself.png differ diff --git a/static/img/twitter-emojis.png b/static/img/twitter-emojis.png new file mode 100644 index 0000000..9f3f9e1 Binary files /dev/null and b/static/img/twitter-emojis.png differ diff --git a/static/img/vscode.png b/static/img/vscode.png new file mode 100644 index 0000000..e9366c3 Binary files /dev/null and b/static/img/vscode.png differ diff --git a/static/img/watchtower-docker.png b/static/img/watchtower-docker.png new file mode 100644 index 0000000..b859716 Binary files /dev/null and b/static/img/watchtower-docker.png differ diff --git a/static/themes/hello-friend/.eslintrc.yml b/static/themes/hello-friend/.eslintrc.yml new file mode 100644 index 0000000..58ea9e6 --- /dev/null +++ b/static/themes/hello-friend/.eslintrc.yml @@ -0,0 +1,54 @@ +--- + +env: + es6: true + +extends: + # https://github.com/airbnb/javascript + - airbnb + - eslint:recommended + - prettier + +parser: babel-eslint + +rules: + # best practices + arrow-parens: + - 2 + - as-needed + semi: + - 2 + - never + class-methods-use-this: 0 + comma-dangle: + - 2 + - always-multiline + no-console: + - 2 + no-unused-expressions: 0 + no-param-reassign: + - 2 + - props: false + no-useless-escape: 0 + func-names: 0 + quotes: + - 2 + - single + - allowTemplateLiterals: true + no-underscore-dangle: 0 + object-curly-newline: 0 + function-paren-newline: 0 + operator-linebreak: + - 2 + - after + no-unused-vars: + - 2 + - argsIgnorePattern: "^_" + +globals: + document: true + requestAnimationFrame: true + window: true + self: true + fetch: true + Headers: true diff --git a/static/themes/hello-friend/.gitignore b/static/themes/hello-friend/.gitignore new file mode 100644 index 0000000..36170a7 --- /dev/null +++ b/static/themes/hello-friend/.gitignore @@ -0,0 +1,2 @@ +node_modules +public diff --git a/static/themes/hello-friend/.husky/.gitignore b/static/themes/hello-friend/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/static/themes/hello-friend/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/static/themes/hello-friend/.husky/pre-push b/static/themes/hello-friend/.husky/pre-push new file mode 100755 index 0000000..f1fd679 --- /dev/null +++ b/static/themes/hello-friend/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn build && git add . && git commit --amend --no-edit diff --git a/static/themes/hello-friend/.prettierrc b/static/themes/hello-friend/.prettierrc new file mode 100644 index 0000000..2ec43f6 --- /dev/null +++ b/static/themes/hello-friend/.prettierrc @@ -0,0 +1,11 @@ +{ + "parser": "babel", + "printWidth": 100, + "trailingComma": "all", + "overrides": [{ + "files": ["*.html"], + "options": { + "parser": "go-template" + } + }] +} diff --git a/static/themes/hello-friend/COMMUNITY-FEATURES.md b/static/themes/hello-friend/COMMUNITY-FEATURES.md new file mode 100644 index 0000000..8bda059 --- /dev/null +++ b/static/themes/hello-friend/COMMUNITY-FEATURES.md @@ -0,0 +1,17 @@ +# Community features + + diff --git a/static/themes/hello-friend/LICENSE.md b/static/themes/hello-friend/LICENSE.md new file mode 100644 index 0000000..770457f --- /dev/null +++ b/static/themes/hello-friend/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 panr + +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/static/themes/hello-friend/README.md b/static/themes/hello-friend/README.md new file mode 100644 index 0000000..7fc013e --- /dev/null +++ b/static/themes/hello-friend/README.md @@ -0,0 +1,310 @@ +# Hello Friend + +## The theme is no longer maintained, but can still be used + +Even if the repository is archived you can still use the theme, fork it, download it, expand it, etc. Remember that each Hugo theme is a module that can be modified to match your needs. The theme is fully "open" and it depends only on the internal engines implemented in Hugo. + +The theme brings many useful features thanks to [all people that contributed to it](https://github.com/panr/hugo-theme-hello-friend/graphs/contributors) (I want to thank you all!). At the time of archiving the theme has reached 14th place on the [official Hugo Themes list](https://themes.gohugo.io/). This is huge! Thanks to you! + +---- + +![Hello Friend](https://github.com/panr/hugo-theme-hello-friend/blob/master/images/screenshot.png?raw=true) + +### DEMO - https://hugo-hello-friend.now.sh/ + +--- + +- [Hello Friend](#hello-friend) + - [DEMO - https://hugo-hello-friend.now.sh/](#demo) + - [Features](#features) + - [Built-in shortcodes](#built-in-shortcodes) + - [Code highlighting](#code-highlighting) + - [Improved RSS Feed](#improved-rss-feed) + - [How to start](#how-to-start) + - [How to run your site](#how-to-run-your-site) + - [How to configure](#how-to-configure) + - [How to add a cover image to your posts](#how-to-add-a-cover-image-to-your-posts) + - [How to display the Last Modified Date in your posts](#how-to-display-the-last-modified-date-in-your-posts) + - [How to hide "Read more" button](#how-to-hide-read-more-button) + - [Add-ons](#add-ons) + - [How to edit the theme](#how-to-edit) + - [Found a bug?](#bug) + - [New cool idea or feature](#feature) + - [`Hello Friend` theme user?](#hello-friend-theme-user) + - [License](#license) + +## Features + +- **dark/light mode**, depending on your preferences (the theme of your operating system is default, but you can change it) +- great reading experience thanks to [**Inter font**](https://rsms.me/inter/), made by [Rasmus Andersson](https://rsms.me/about/) +- nice code highlighting thanks to [**PrismJS**](https://prismjs.com) +- fully responsive + +#### Built-in shortcodes + +- **`image`** (prop required: **`src`**; props optional: **`alt`**, **`position`** (**left** is default | center | right), **`style`**) + - eg: `{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}` +- **`figure`** (same as `image`, plus few optional props: **`caption`**, **`captionPosition`** (left | **center** is default | right), **`captionStyle`** + - eg: `{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}` +- **`imgproc`** Hugo shortcode for image processing, plus additional **`position`** param [ left | center | right ] (optional). + - eg: `{{< imgproc "img/hello.png" Resize "250x" center />}}` + - More detailed info on processing commands at [https://gohugo.io/content-management/image-processing/](https://gohugo.io/content-management/image-processing/) +- **`code`** (prop required: **`language`**; props optional: **`title`**, **`id`**, **`expand`** (default "△"), **`collapse`** (default "▽"), **`isCollapsed`**) + - eg: + ```go + {{< code language="css" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}} + pre { + background: #1a1a1d; + padding: 20px; + border-radius: 8px; + font-size: 1rem; + overflow: auto; + + @media ($phone) { + white-space: pre-wrap; + word-wrap: break-word; + } + + code { + background: none !important; + color: #ccc; + padding: 0; + font-size: inherit; + } + } + {{< /code >}} + ``` + +#### Code highlighting + +By default the theme is using PrismJS to color your code syntax. All you need to do is to wrap you code like this: + +
+```html
+  // your code here
+```
+
+ +**Supported languages**: bash/shell, css, clike, javascript, apacheconf, actionscript, applescript, c, csharp, cpp, coffeescript, ruby, csp, css-extras, diff, django, docker, elixir, elm, markup-templating, erlang, fsharp, flow, git, go, graphql, less, handlebars, haskell, http, java, json, kotlin, latex, markdown, makefile, objectivec, ocaml, perl, php, php-extras, r, sql, processing, scss, python, jsx, typescript, toml, reason, textile, rust, sass, stylus, scheme, pug, swift, yaml, haml, twig, tsx, vim, visual-basic, wasm. + +#### Improved RSS Feed + +Some enhancements have been made to Hugo's [internal RSS](https://github.com/gohugoio/hugo/blob/25a6b33693992e8c6d9c35bc1e781ce3e2bca4be/tpl/tplimpl/embedded/templates/_default/rss.xml) generation code. + +**A page's cover image now appears at the top of its feed display**. This image is set manually using [the cover params](#how-to-add-a-cover-image-to-your-posts). If unset, the RSS generator searches for the first image file in the page bundle whose name includes 'featured', 'cover', or 'thumbnail'. + +**You can optionally display the full page content in your RSS feed** (default is Description or Summary data from Front Matter). Set `rssFullText = true` in your `config.toml` file to enable this option. + +**You can choose a site image to be displayed when searching for your RSS feed.** Set `rssImage = "image/url/here"` in your `config.toml` file to enable this option. + +## How to start + +You can download the theme manually by going to [https://github.com/panr/hugo-theme-hello-friend.git](https://github.com/panr/hugo-theme-hello-friend.git) and pasting it to `themes/hello-friend` in your root directory. + +You can also choose **one of the 3 possibilities** to install the theme: + +1. as Hugo Module +2. as a standalone local directory +3. as a git submodule + +⚠️ **The theme needs at least Hugo **Extended** v0.90.x**. + +### Install theme as Hugo Module + +```bash +# If this is the first time you're using Hugo Modules +# in your project. You have to initiate your own module before +# you fetch the theme module. +# +# hugo mod init [your website/module name] +hugo mod get github.com/panr/hugo-theme-hello-friend +``` + +and in your config file add: + +```toml +[module] + # this is needed when you fetch the theme as a submodule to your repo. + # replacements = "github.com/panr/hugo-theme-hello-friend -> themes/hello-friend" +[[module.imports]] + path = 'github.com/panr/hugo-theme-hello-friend' +``` + +Keep in mind that the theme by default won't show up in the `themes` directory. This means that you are using the theme as it was on the repository at the moment you fetched it. Your local `go.sum` file keeps all the references. Read more about Hugo Modules in the [official documentation](https://gohugo.io/hugo-modules/). + +⚠️ If you encounter any issues with: + +```bash +Error: module "hello-friend" not found; either add it as a Hugo Module or store it in "[...your custom path]/themes".: module does not exist +``` + +then please try to remove `theme = "hello-friend"` from your config file. + +### Install theme locally + +```bash +git clone https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend +``` + +This will clone the repository directly to the `themes/hello-friend` directory. + +### Install theme as a submodule + +```bash +git submodule add -f https://github.com/panr/hugo-theme-hello-friend.git themes/hello-friend +``` + +This will install the repository as a sumbodule in the `themes/hello-friend` directory. + +## How to run your site + +From your Hugo root directory run: + +``` +hugo server -t hello-friend +``` + +and go to `localhost:1313` in your browser. From now on all the changes you make will go live, so you don't need to refresh your browser every single time. + +## How to configure + +The theme doesn't require any advanced configuration. Just copy: + +```toml +baseurl = "/" +languageCode = "en-us" +# Add it only if you keep the theme in the `themes` directory. +# Remove it if you use the theme as a remote Hugo Module. +theme = "hello-friend" +paginate = 5 + +[params] + # dir name of your blog content (default is `content/posts`). + # the list of set content will show up on your index page (baseurl). + contentTypeName = "posts" + + # OS theme is default when not provided, but you can force it to "light" or "dark" + defaultTheme = "dark" + + # if you set this to 0, only submenu trigger will be visible + showMenuItems = 2 + + # Show reading time in minutes for posts + showReadingTime = false + + # Show table of contents at the top of your posts (defaults to false) + # Alternatively, add this param to post front matter for specific posts + # toc = true + + # Show full page content in RSS feed items + #(default is Description or Summary metadata in the front matter) + # rssFullText = true + +[languages] + [languages.en] + title = "Hello Friend" + subtitle = "A simple theme for Hugo" + keywords = "" + copyright = "" + menuMore = "Show more" + writtenBy = "Written by" + readMore = "Read more" + readOtherPosts = "Read other posts" + newerPosts = "Newer posts" + olderPosts = "Older posts" + minuteReadingTime = "min read" + dateFormatSingle = "2006-01-02" + dateFormatList = "2006-01-02" + # leave empty to disable, enter display text to enable + # lastModDisplay = "" + + [languages.en.params.logo] + logoText = "hello friend" + logoHomeLink = "/" + # or + # + # path = "/img/your-example-logo.svg" + # alt = "Your example logo alt text" + + [languages.en.menu] + [[languages.en.menu.main]] + identifier = "about" + name = "About" + url = "/about" + [[languages.en.menu.main]] + identifier = "showcase" + name = "Showcase" + url = "/showcase" +``` + +to `config.toml` file in your Hugo root directory and change params fields. In case you need, here's [a YAML version](https://gist.github.com/panr/8f9b363e358aaa33f6d353c77feee959). + +**NOTE:** Please keep in mind that currently main menu doesn't support nesting. + +## How to add a cover image to your posts + +Adding a cover image to your post is simple and there are two options when you edit your `index.md` file in `content/posts/blog-entry-xy/index.md`: + +* Use `cover = "/path/to/absolute/img.jpg"` to link an absolute image + * Resulting in `https://www.yourpage.com/path/to/absolute/img.jpg` +* Use `cover = "img.jpg"` and `useRelativeCover = true` to link the image relative to the blog post folder + * Resulting in `https://www.yourpage.com/posts/blog-entry-xy/img.jpg` +* Use `coverAlt = "description of image"` to add custom alt text to the cover image (defaults to post or page title as alt text) +* Use `coverCaption = "Image Credit to [Barry Bluejeans](https://unsplash.com/)"` to add a caption for the cover image. + +## How to display the Last Modified Date in your posts + +Add `lastModDisplay = "[your display text]"` to `config.toml` to enable last modified date on your posts. Note - an empty string value `""` does not display anything. + +Example: `lastModDisplay = "Modified:"` --> "Modified: Jan 01, 0001" + +:octocat: Hugo's `enableGitInfo` option is a nice complement to this feature. + +## How to hide "Read more" button + +In a post's front matter you have to add `hideReadMore` param set to `true`. This will result in that the post won't have "Read more" button in the list view. + +## Add-ons + +- **Archive** — Theme has built-in `archive` page for main content (see `contentTypeName` variable in config). If you need archive on your blog just copy https://github.com/panr/hugo-theme-hello-friend/blob/master/exampleSite/content/archive.md to your `content` dir. If you need multilangual archives, duplicate `content/archive.md` and add `.Lang` variable, eg: `content/archive.pl.md` (remember to change `url` in duplicated file). +- **Comments** — for adding comments to your blog posts please take a look at `layouts/partials/comments.html` https://github.com/panr/hugo-theme-terminal/blob/master/layouts/partials/comments.html. +- **Prepended ``** — if you need to add something inside `` element, and before any of the theme's ` diff --git a/static/themes/hello-friend/layouts/partials/comments.html b/static/themes/hello-friend/layouts/partials/comments.html new file mode 100644 index 0000000..8dd2afb --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/comments.html @@ -0,0 +1,7 @@ + diff --git a/static/themes/hello-friend/layouts/partials/extended_footer.html b/static/themes/hello-friend/layouts/partials/extended_footer.html new file mode 100644 index 0000000..f2374c7 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/extended_footer.html @@ -0,0 +1,4 @@ + diff --git a/static/themes/hello-friend/layouts/partials/extended_head.html b/static/themes/hello-friend/layouts/partials/extended_head.html new file mode 100644 index 0000000..c422b63 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/extended_head.html @@ -0,0 +1,4 @@ + diff --git a/static/themes/hello-friend/layouts/partials/footer.html b/static/themes/hello-friend/layouts/partials/footer.html new file mode 100644 index 0000000..d92d431 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/footer.html @@ -0,0 +1,22 @@ +
+ +{{ $menu := resources.Get "js/menu.js" | js.Build }} +{{ $prism := resources.Get "js/prism.js" | js.Build }} +{{ $theme := resources.Get "js/theme.js" | js.Build }} +{{ $bundle := slice $menu $prism $theme | resources.Concat "bundle.js" | resources.Minify }} + + +{{- partial "extended_footer.html" . }} diff --git a/static/themes/hello-friend/layouts/partials/greater-icon.html b/static/themes/hello-friend/layouts/partials/greater-icon.html new file mode 100644 index 0000000..dc69bbb --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/greater-icon.html @@ -0,0 +1,3 @@ + + + diff --git a/static/themes/hello-friend/layouts/partials/head.html b/static/themes/hello-friend/layouts/partials/head.html new file mode 100644 index 0000000..07938e1 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/head.html @@ -0,0 +1,48 @@ + + + + + + + + +{{- partial "prepended_head.html" . }} + + +{{ $res := resources.Get "css/style.scss" }} +{{ $style := $res | resources.ToCSS }} + + + + + + + + + + + + + + + + + +{{ template "_internal/twitter_cards.html" . }} + + +{{ template "_internal/opengraph.html" . }} + + +{{ range .AlternativeOutputFormats -}} + {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} +{{ end -}} + + +{{- partial "extended_head.html" . }} diff --git a/static/themes/hello-friend/layouts/partials/header.html b/static/themes/hello-friend/layouts/partials/header.html new file mode 100644 index 0000000..f7b5e75 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/header.html @@ -0,0 +1,19 @@ +
+ + {{ partial "logo.html" . }} + + {{ if len $.Site.Menus }} + {{ partial "menu.html" . }} + + + + + + + {{ end }} + + {{ partial "theme-icon.html" . }} + + + +
diff --git a/static/themes/hello-friend/layouts/partials/lastmod.html b/static/themes/hello-friend/layouts/partials/lastmod.html new file mode 100644 index 0000000..3f210bd --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/lastmod.html @@ -0,0 +1,10 @@ +{{ $hourInSec := 3600 }} + +{{ if gt .Lastmod (add (time .Date).Unix $hourInSec) }} + {{ with .Lastmod }} + + ({{ $.Site.Params.LastModDisplay }} + {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}) + + {{ end }} +{{ end }} diff --git a/static/themes/hello-friend/layouts/partials/logo.html b/static/themes/hello-friend/layouts/partials/logo.html new file mode 100644 index 0000000..598006f --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/logo.html @@ -0,0 +1,15 @@ + diff --git a/static/themes/hello-friend/layouts/partials/menu.html b/static/themes/hello-friend/layouts/partials/menu.html new file mode 100644 index 0000000..660e02e --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/menu.html @@ -0,0 +1,42 @@ + diff --git a/static/themes/hello-friend/layouts/partials/pagination.html b/static/themes/hello-friend/layouts/partials/pagination.html new file mode 100644 index 0000000..55c8b57 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/pagination.html @@ -0,0 +1,20 @@ + diff --git a/static/themes/hello-friend/layouts/partials/postcover.html b/static/themes/hello-friend/layouts/partials/postcover.html new file mode 100644 index 0000000..d9e0bc6 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/postcover.html @@ -0,0 +1,11 @@ +
+ {{ if .Params.UseRelativeCover }} + {{ .Params.CoverAlt | plainify | default .Title }} + {{ else }} + {{ .Params.CoverAlt | plainify | default .Title }} + {{ end }} + + {{ if .Params.CoverCaption }} +
{{ .Params.CoverCaption | markdownify }}
+ {{ end }} +
diff --git a/static/themes/hello-friend/layouts/partials/prepended_head.html b/static/themes/hello-friend/layouts/partials/prepended_head.html new file mode 100644 index 0000000..03c91de --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/prepended_head.html @@ -0,0 +1,4 @@ + diff --git a/static/themes/hello-friend/layouts/partials/theme-icon.html b/static/themes/hello-friend/layouts/partials/theme-icon.html new file mode 100644 index 0000000..c44b326 --- /dev/null +++ b/static/themes/hello-friend/layouts/partials/theme-icon.html @@ -0,0 +1,14 @@ + + + diff --git a/static/themes/hello-friend/layouts/shortcodes/code.html b/static/themes/hello-friend/layouts/shortcodes/code.html new file mode 100644 index 0000000..8bab825 --- /dev/null +++ b/static/themes/hello-friend/layouts/shortcodes/code.html @@ -0,0 +1,15 @@ +{{ $id := delimit (shuffle (seq 1 9)) "" }} + +{{ if .Get "language" }} +
+ + +
{{ .Inner | string }}
+
+{{ else }} + {{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }} +{{ end }} diff --git a/static/themes/hello-friend/layouts/shortcodes/figure.html b/static/themes/hello-friend/layouts/shortcodes/figure.html new file mode 100644 index 0000000..e3c2fe2 --- /dev/null +++ b/static/themes/hello-friend/layouts/shortcodes/figure.html @@ -0,0 +1,8 @@ +{{ if .Get "src" }} +
+ {{ . | plainify }} + {{ if .Get "caption" }} +
{{ .Get "caption" | markdownify }}
+ {{ end }} +
+{{ end }} diff --git a/static/themes/hello-friend/layouts/shortcodes/image.html b/static/themes/hello-friend/layouts/shortcodes/image.html new file mode 100644 index 0000000..6b2a2c0 --- /dev/null +++ b/static/themes/hello-friend/layouts/shortcodes/image.html @@ -0,0 +1,3 @@ +{{ if .Get "src" }} + {{ . | plainify }} +{{ end }} diff --git a/static/themes/hello-friend/layouts/shortcodes/imgproc.html b/static/themes/hello-friend/layouts/shortcodes/imgproc.html new file mode 100644 index 0000000..1155796 --- /dev/null +++ b/static/themes/hello-friend/layouts/shortcodes/imgproc.html @@ -0,0 +1,30 @@ +{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }} +{{ $command := .Get 1 }} +{{ $options := .Get 2 }} +{{ $position := .Get 3 }} + +{{ if eq $command "Fit" }} + {{ .Scratch.Set "image" ($original.Fit $options) }} + {{ else if eq $command "Resize" }} + {{ .Scratch.Set "image" ($original.Resize $options) }} + {{ else if eq $command "Fill" }} + {{ .Scratch.Set "image" ($original.Fill $options) }} + {{ else }} + {{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize." }} +{{ end }} + +{{ $image := .Scratch.Get "image" }} + +
+ + {{ with .Inner }} +
+ {{ . }} +
+ {{ end }} +
diff --git a/static/themes/hello-friend/package.hugo.json b/static/themes/hello-friend/package.hugo.json new file mode 100644 index 0000000..fc2a6a2 --- /dev/null +++ b/static/themes/hello-friend/package.hugo.json @@ -0,0 +1,44 @@ +{ + "name": "hello-friend", + "version": "3.0.0", + "main": "index.js", + "author": "Radosław Kozieł <@panr> ", + "license": "MIT", + "scripts": { + "test": "echo 'Test'" + }, + "browserslist": [ + "last 2 versions", + ">1%", + "not dead" + ], + "comments": { + "dependencies": { + "yarn": "project" + }, + "devDependencies": { + "browserslist": "project", + "clipboard": "project", + "eslint-config-airbnb": "project", + "eslint-config-prettier": "project", + "eslint-plugin-jsx-a11y": "project", + "husky": "project" + } + }, + "dependencies": { + "yarn": "^1.22.10" + }, + "devDependencies": { + "browserslist": "^4.16.5", + "clipboard": "^2.0.4", + "eslint-config-airbnb": "^18.2.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "husky": "^5.1.3" + }, + "husky": { + "hooks": { + "pre-push": "yarn build && git add . && git commit --amend --no-edit" + } + } +} diff --git a/static/themes/hello-friend/package.json b/static/themes/hello-friend/package.json new file mode 100644 index 0000000..fc2a6a2 --- /dev/null +++ b/static/themes/hello-friend/package.json @@ -0,0 +1,44 @@ +{ + "name": "hello-friend", + "version": "3.0.0", + "main": "index.js", + "author": "Radosław Kozieł <@panr> ", + "license": "MIT", + "scripts": { + "test": "echo 'Test'" + }, + "browserslist": [ + "last 2 versions", + ">1%", + "not dead" + ], + "comments": { + "dependencies": { + "yarn": "project" + }, + "devDependencies": { + "browserslist": "project", + "clipboard": "project", + "eslint-config-airbnb": "project", + "eslint-config-prettier": "project", + "eslint-plugin-jsx-a11y": "project", + "husky": "project" + } + }, + "dependencies": { + "yarn": "^1.22.10" + }, + "devDependencies": { + "browserslist": "^4.16.5", + "clipboard": "^2.0.4", + "eslint-config-airbnb": "^18.2.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "husky": "^5.1.3" + }, + "husky": { + "hooks": { + "pre-push": "yarn build && git add . && git commit --amend --no-edit" + } + } +} diff --git a/static/themes/hello-friend/postcss.config.js b/static/themes/hello-friend/postcss.config.js new file mode 100644 index 0000000..95c260e --- /dev/null +++ b/static/themes/hello-friend/postcss.config.js @@ -0,0 +1,24 @@ +const url = require("postcss-url"); +const imports = require("postcss-import"); +const nested = require("postcss-nested"); +const postcssCustomMedia = require("postcss-custom-media"); +const postCSSPresetEnv = require("postcss-preset-env"); +const browsers = require("browserslist"); +const cssnano = require("cssnano"); +const mixins = require("postcss-mixins"); + +module.exports = () => ({ + plugins: [ + url, + imports, + mixins, + nested, + postcssCustomMedia, + postCSSPresetEnv({ + stage: 1, + }), + cssnano({ + preset: "default", + }), + ], +}); diff --git a/static/themes/hello-friend/static/img/apple-touch-icon-144-precomposed.png b/static/themes/hello-friend/static/img/apple-touch-icon-144-precomposed.png new file mode 100644 index 0000000..bde2fe0 Binary files /dev/null and b/static/themes/hello-friend/static/img/apple-touch-icon-144-precomposed.png differ diff --git a/static/themes/hello-friend/static/img/favicon.png b/static/themes/hello-friend/static/img/favicon.png new file mode 100644 index 0000000..b973699 Binary files /dev/null and b/static/themes/hello-friend/static/img/favicon.png differ diff --git a/static/themes/hello-friend/static/style.css b/static/themes/hello-friend/static/style.css new file mode 100644 index 0000000..e69de29 diff --git a/static/themes/hello-friend/theme.toml b/static/themes/hello-friend/theme.toml new file mode 100644 index 0000000..9afa8b2 --- /dev/null +++ b/static/themes/hello-friend/theme.toml @@ -0,0 +1,27 @@ +name = "hello-friend" +description = "A simple theme for Hugo. That's it." +features = ["blog", "shortcode", "syntax Highlighting"] +homepage = "https://github.com/panr/hugo-theme-hello-friend/" +license = "MIT" +licenselink = "https://github.com/panr/hugo-theme-hello-friend/blob/master/LICENSE.md" +min_version = 0.90 +tags = [ + "blog", + "clean", + "customizable", + "dark", + "highlighting", + "light", + "minimal", + "monochromatic", + "multilingual", + "personal", + "responsive", + "simple", + "technical", +] + +[author] +homepage = "https://radoslawkoziel.pl" +name = "panr" +twitter = "https://twitter.com/panr" diff --git a/themes/hello-friend/assets/css/post.scss b/themes/hello-friend/assets/css/post.scss index bf2891a..4aea1c5 100644 --- a/themes/hello-friend/assets/css/post.scss +++ b/themes/hello-friend/assets/css/post.scss @@ -34,7 +34,6 @@ text-decoration: none; } } - &-tags { display: block; margin-bottom: 20px; @@ -82,4 +81,4 @@ margin-bottom: 20px; } } -} +} \ No newline at end of file diff --git a/themes/hello-friend/layouts/partials/footer.html b/themes/hello-friend/layouts/partials/footer.html index b972a48..d92d431 100644 --- a/themes/hello-friend/layouts/partials/footer.html +++ b/themes/hello-friend/layouts/partials/footer.html @@ -5,8 +5,9 @@ {{ else }} {{ partial "logo.html" . }} {{ end }}