RapidWeaver Docs
Search…
⌃K

Macros (Advanced)

A powerful, but underused feature of RapidWeaver
Macros in RapidWeaver were initially implemented to help with theme development, however, some of them can be useful when used in the pages you create inside RapidWeaver. Let's get started by taking a look at an example that uses the Site Title macro.

Macro Example

Macros are tags that can be used within RapidWeaver pages to pull in content or details about your website. Macros tags also start and end with the % character.
For example, if you place "%site_title% within a text area on a page, the syntax would be replaced with the site title you specified in the Site Settings area.
Input: Welcome to %site_title%, I hope you like it.
Would then be turned into:
Output: Welcome to My Website, I hope you like it.
Macro Example: Input
Macro Example: Output
Why use a macro tag? If you used %site_title% throughout your site, you'd only have to update it in one place (Site Settings) to change the name of your website. Instead of having to manually change the instance on every page within your site.

Macro Syntax

RapidWeaver Classic support the following Macros:
%title% - Outputs the title of the current page.
%site_title% - Outputs the site title from the site setup.
%site_slogan% - Outputs the site slogan from the site setup.
%logo% - Outputs the logo from site setup, including required html. e.g.
<img src="rw_common/images/my_logo.jpg" width="350" height="100" alt="My Website">
%footer% - Outputs the contents of the footer from the site setup.
%email% - Outputs the email address from the site setup.
%website_address% - Outputs the website address as specified in the site setup.
%sidebar_title% - Outputs the sidebar title.
%sidebar% - Outputs the sidebar content.
%base_url% - Outputs the base URL of the website.
%resource(image.png)% - Outputs a link to the name resource.
%last_published% - Outputs the last published date as dd/mm/yyyy
%ogTitle% - Outputs the Open Graph Title (under Social Tags)
%ogDescription% - Outputs the Open Graph Description (under Social Tags)
%ogImage% - Outputs the url of the Open Graph Image (under Social Tags) e.g.
/resources/my-social-image.png

Resources Macro Example

The resources macro is one of the most useful macros. If you need to embed an image or have use for an image’s address, instead of hardcoding the link you can use a resource macro.
Whenever a resource macro is found in your project, RapidWeaver will substitute it for a link to the resource. Here's an example of the syntax:
%resource(image.jpg)%
The above macro would become a path to a resource called image.jpg. If the resource is inside a folder, be sure to include the name of the folder in your macro, like this:
%resource(folder-name/image.jpg)%
You can get a resources macro by right-clicking on an image or file in the Resources Browser and choosing "Copy Macro", a super handy, yet little known feature.
You can then paste the "macro" into any area when you want to link to that resource.