Skip to content

_Template in different directories does not work as documented  #1640

@alzeih

Description

@alzeih

Describe the bug

The gollum wiki https://github.com/gollum/gollum/wiki says that

Using the --template-page option, you can also use _Template file that will be used as the template for creating new pages. You can have different _Template files in different directories.

However, only the /_Template file in the root directory is checked when using --template-page

gollum/lib/gollum/app.rb

Lines 354 to 356 in 123518b

if settings.wiki_options[:template_page] then
temppage = wiki_page('/_Template')
@template_page = (temppage.page != nil) ? temppage.page.raw_data : 'Template page option is set, but no /_Template page is present or committed.'

To Reproduce

  1. Create file Foo/_Template and commit to git
  2. Run gollum with --template-page
  3. Make a new page under Foo/

Expected behavior
The content of Foo/_Template should be the raw content of a new page under Foo/
This template should be able to exist and be different from other directories.

Environment Info
Gollum 5.1.2
Running on: x86_64-linux with Ruby version 2.7.2
Using:
rugged 0.99.0
gollum-rugged_adapter 1.0
gollum-lib 5.0.6
Markdown rendering gem: kramdown
Other renderering gems:
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions