Skip to content

Commit

Permalink
Add support for head, body_prefix, and body_suffix settings
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Jan 9, 2024
1 parent 15d0dab commit c0db17b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -44,3 +44,12 @@ The alternative:
from theme_153957 import theme
theme = theme.get_path()
plugins = ['theme_153957.full_menu', …]


### Wrapping album

Use the settings `head`, `body_prefix`, and `body_suffix` to add additional
code to the templates. The value of `head` is appended to the `head` element,
the `body` settings are placed just after the body opening tag (`prefix`) and
just before the closing body tag (`suffix`). This allows embedding the album
in your own website.
3 changes: 3 additions & 0 deletions theme_153957/templates/base.html
Expand Up @@ -11,8 +11,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ theme.url }}/css/normalize.css">
<link rel="stylesheet" href="{{ theme.url }}/css/style.css">
{{ settings.head|default('') }}
</head>
<body>
{{ settings.body_prefix|default('') }}
<div id="main"{% if not album.gallery.full_tree %} class="no_menu"{% endif %}>
{% if album.gallery.full_tree %}
<div id="menu">
Expand Down Expand Up @@ -78,6 +80,7 @@

{% endif %}
</div>
{{ settings.body_suffix|default('') }}
<script src="{{ theme.url }}/js/gallery.js"></script>
</body>
</html>

0 comments on commit c0db17b

Please sign in to comment.