Looking to build and publish a Wowchemy widget that doesnβt exist yet?
Wowchemy makes it easy to create a beautiful website for free. Edit your site in Markdown, Jupyter, or RStudio, generate it with Hugo, and deploy with GitHub or Netlify. Customize anything on your site with widgets, themes, and language packs.
- Each Wowchemy widget consists of an HTML file
- You may use Go Templating and Bootstrap layouts to design the widget HTML
- Click the Use This Template button on GitHub
- Name your repository
wowchemy-widget-<WIDGET-NAME>
where<WIDGET-NAME>
is an appropriate name for your widget
- Name your repository
- Browse your new GitHub project, click the
go.mod
file, and then the βοΈ pencil button to edit it- Replace the placeholder URL in
go.mod
with your new GitHub URL in the formmodule github.com/<USERNAME>/wowchemy-widget-<WIDGET-NAME>
where<USERNAME>
is your GitHub username and<WIDGET-NAME>
is the name of the widget - Scroll to the bottom and click Commit Changes to save
- Replace the placeholder URL in
- Browse to the
layouts/partials/widgets/
folder, clickmy-widget.html
, and click the βοΈ pencil button to edit it- Rename
my-widget.html
in the text box to a unique ID in the formgithub.<USERNAME>.<WIDGET-NAME>.html
, again replacing<USERNAME>
with your GitHub username and<WIDGET-NAME>
with your widget name - Scroll to the bottom and click Commit Changes to save
- Rename
- Edit the HTML for your new widget
- You may use Go Templating and Bootstrap layouts
- You can access page and section (widget instance) variables using
$page
and$section
, respectively - Check out the built-in widgets for inspiration
Say your GitHub username is pikachu
and you wish to create a widget named pokemon
:
- We click Use This Template and enter
wowchemy-widget-pokemon
as the project name - We replace the first line of
go.mod
withmodule github.com/pikachu/wowchemy-widget-pokemon
- We browse to the
layouts/partials/widgets/
folder, and renamemy-widget.html
togithub.pikachu.pokemon.html
- We customize the HTML in
github.pikachu.pokemon.html
- We add the widget to our site and share the widget with the community following the guide below
- Install the widget by referencing it in your
config/_defaults/config.yaml
:module: imports: # Your widget's GitHub URL (replace <USERNAME> and <WIDGET-NAME> with your GitHub username and widget name) - path: github.com/<USERNAME>/wowchemy-widget-<WIDGET-NAME>
- Create an instance of your widget in
home/
, for example let's createhome/my-widget.md
:--- # Replace <USERNAME> and <WIDGET-NAME> with your GitHub username and widget name, respectively. widget: 'github.<USERNAME>.<WIDGET-NAME>' # This file represents a page section. headless: true # Order that this section appears on the page. weight: 1 title: Hello --- Welcome to my new widget!
Add the wowchemy-hugo-extension tag to your widget's GitHub repository to help other users find it.
Share your widget with the community on Discord and Twitter.