Skip to content

Instantly share code, notes, and snippets.

View candidexmedia's full-sized avatar
🤙
Creating a platform for open source content creation

candide ꘎ media candidexmedia

🤙
Creating a platform for open source content creation
View GitHub Profile
@candidexmedia
candidexmedia / dark-mode-toggle-Publii.md
Last active July 23, 2025 04:28
How to add light mode / dark mode toggle button in Publii

In reponse to the forum discussion on manual toggling, and inspired by the following Codepen by Marco Pontili

It's possible to get a toggle based on the Codepen working right inside the Publii GUI (without having to edit theme files). Here's a very rudimentary example and tutorial using the latest Simple Theme:

Add the Toggle JS

8e4fd5e9-74fa-4ed8-8ac6-38fb78878c69

Go to Tools & Plugins > Custom HTML > Footer, and insert the following script (exact same as the Codepen):

@candidexmedia
candidexmedia / PubliiCSS.md
Last active October 27, 2025 00:56
Editing CSS in Publii

Option 1: Custom CSS in the Publii GUI

In Publii, access the Tools & Plugins page, then select "Custom CSS":

Custom CSS in Publii

You'll find a text area to paste in your custom CSS rules.

image

@candidexmedia
candidexmedia / File Tips For Custom Publii Theming.md
Last active October 21, 2025 16:24
Tips for creating your own Publii theme from an existing one

I'm working on a custom Publii theme that's derived from an existing theme, but doesn't make use of theme overrides. I'm making the changes directly to the theme files, because I want this to be a standalone theme by the end of my modifications.

As I learn new things, I'll add them to the list below. Let's assume we're starting from the "Simple" theme, and changing it to a new theme called "My-New-Theme"

1. Make sure the folder name for your theme and the name in config.json match:

Folder structure:

.
└── site name/
@candidexmedia
candidexmedia / 1 - Adding Custom HTML Tags in the Publii Toolbar.md
Last active July 4, 2025 21:14
Experiments in Publii TinyMCE WYSIWYG Editor Extensions (customElementsMode, Formats, Blocks, Templates)

Custom HTML Elements (via customElementsMode)

Custom Elements allow you to wrap selected text in the editor with the HTML tag and CSS class (optionally) of your choice <element>like this</element>. These wrappers can be given custom names and grouped in subfolders.

demo

A huge thanks to @b0fh for guidance on this in the forum and GH discussion.

Instructions

Deploy the new NocoDB template

  1. Go to the dashboard

  2. Click New Project

  3. Click Deploy a template

  4. Search for NocoDB

@candidexmedia
candidexmedia / update-date-publii.md
Last active July 4, 2025 21:14
[Publii] Post Modification Date – Manual Editing
@candidexmedia
candidexmedia / Publii-Simple-Mods.md
Last active July 4, 2025 21:15
Publii - Simple Fix for longer text descriptions in the hero

Here's a 2nd fix for the forum topic Need Help with Publii Glitches in Author and Tag Descriptions, which uses the Simple theme. Demo of issue: video

I'm assuming you're editing the main.css file in a theme override. If you're using "Custom CSS" inside Publii, try to override every rule that has to be deleted using "unset" (ex: .hero { position: unset; })

.hero Class

Delete or comment out the following three lines inside the .hero rule:

.hero {
  height: var(--hero-height); /*delete this line*/
@candidexmedia
candidexmedia / Masonry-Photoswipe-Publii.md
Last active October 26, 2025 01:22
Publii - Photoswipe Masonry

This is an explanation of how to achieve a Masonry gallery effect for Photoswipe galleries in Publii, in response to the forum post "Why a masonry layout for front pages, e.g. Mercury, but not for the galleries ?"

Credit: Yaroslav Khvorostyanenko - "Masonry gallery for Publii static CMS" and www.koolkatphotography.com

Instructions

Go to your site folder > input > themes > [theme name] > css and edit the main.css file in the text editor of your choice.

Comment out (/*like this*/) or delete all the lines of code related to the gallery. These lines should be near the end of the file, around line 2,312. Next, paste the following code:

@candidexmedia
candidexmedia / 1 - Publii Google Translate Widget.md
Last active October 27, 2025 13:41
Publii Google Translate Widget

UPDATE: This method seems to be working again. If it ever stops working again, try GTranslate instead

Google Translate Widget Script

This is an English expansion of the Google Translate widget script covered in this video: https://www.youtube.com/watch?v=5meQKQhGBZg. Thank you to Programming with Vishal !

To get started, place this script in Tools & Plugins > Custom HTML > Footer:

Basic

@candidexmedia
candidexmedia / Publii-Google-Fonts-Self-Hosted.md
Last active July 4, 2025 21:16
Self-Host Google Fonts to Publii