p3k documentation

Post Types

Every post in p3k is one of a few top-level types:

The posts themselves may have various properties which cause the post to be rendered appropriately.

URL Structure

Posts

Post URLs in p3k come in two forms. Either a date-based URL (with optional slug suffix), or a custom URL which can contain path separators. The date-based URLs are in the form:

Posts without a slug use the trailing slash so that relative image links within the post work the same for both types of URLs.

The index number is incremented sequentially based on when the post was created in the website. This means it is possible for post URLs to be "out of order" relative to the date they were created if they are sent to the website out of order.

Any post can define a custom slug, either relative or absolute, which means posts can appear to be "pages" that live outside this date structure. Internally, they still live on disk at their date-based URL but are served from the custom URL instead. For example, you could create a post that contains a resume and make it visible at the following URL:

/resume

Custom slugs can contain slashes, so it is also possible to create a nested URL structure for a set of pages if desired.

If the post defines a relative slug, then the full post URL includes that slug. Visiting the unique path component (year/month/day/index) without the slug, or with a different slug, will send a permanent redirect to the new slug.

Tags

Tag pages live under the /tag folder, and show all posts that match that tag. For example:

/tag/indieweb

Posts can be pinned in a tag and will always appear at the top of the tag page.

Channels

A p3k website provides one or more top-level channels, starting with the home page. Each channel is exposed as an h-feed. Posts can be added to one or more channels. If a post doesn't appear in any channel, then it is a sort of "hidden" post, only accessible if you know the URL. (Since p3k URLs are somewhat sequential, this should not be used to create private posts.) Channel URLs live at the root, for example:

/events

Posts can be pinned in a channel and will always appear at the top of the channel page.

API

Posts are created using Micropub.

Services

Much of the functionality of p3k is actually broken out into separate services. Many of the services are publicly available, and since they use open standards like Microformats and Micropub, you can use them even if your website is not powered by p3k.

Most of these services are open source so you can also run your own instance of them if you wish.

Libraries

p3k also makes use of many open source libraries which are useful for other IndieWeb-friendly websites.