Skip to content

Commit

Permalink
Merge pull request #3 from mkdocs-material/statusbadge
Browse files Browse the repository at this point in the history
added example for page statuses
  • Loading branch information
squidfunk authored Oct 5, 2023
2 parents 092099c + 8179be9 commit 7ced3a2
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/statusbadge/docs/deprecated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
status: deprecated
---

# This is a page with deprecated content
7 changes: 7 additions & 0 deletions examples/statusbadge/docs/happy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
status: happy
---

# Happy, happy page!

This page has a custom page status.
15 changes: 15 additions & 0 deletions examples/statusbadge/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Page Status Example

The example shows how to add a [page status] to a page. This works for
section index pages as well as 'normal' pages.

You can add the existing status identifiers `new`
and `deprecated` but also define custom ones by:

1. defining the tooltip in your `mkdocs.yml`
2. defining the icon to use in your `extra.css`

[page status]: https://squidfunk.github.io/mkdocs-material/reference/#setting-the-page-status



5 changes: 5 additions & 0 deletions examples/statusbadge/docs/newsect/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
status: new
---

# Brand new content!
1 change: 1 addition & 0 deletions examples/statusbadge/docs/newsect/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Another page in the new section
4 changes: 4 additions & 0 deletions examples/statusbadge/docs/stylesheets/extra.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions examples/statusbadge/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
site_name: Page Status Example

theme:
name: material
features:
- navigation.indexes

extra:
status:
new: Recently Added
happy: Happy!

extra_css:
- stylesheets/extra.css

nav:
- "Home": index.md
- "Deprecated": deprecated.md
- "Happy": happy.md
- "New Section":
- newsect/index.md
- "Other": newsect/other.md

0 comments on commit 7ced3a2

Please sign in to comment.