Skip to content

Commit

Permalink
debug commit #2
Browse files Browse the repository at this point in the history
  • Loading branch information
docelic committed Aug 17, 2018
1 parent fca0a08 commit 180b01b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
4 changes: 4 additions & 0 deletions src/fluence/lib/accessible.cr
Expand Up @@ -34,6 +34,10 @@ abstract struct Fluence::Accessible

abstract def url_prefix : String

# Here due to https://github.com/crystal-lang/crystal/issues/2827
def initialize(@path : String, @name : String, @url : String, @title : String)
end

# translates a name ("/test/title" for example)
# into a file path ("/srv/data/test/ttle.md)
def self.name_to_file(name : String)
Expand Down
21 changes: 0 additions & 21 deletions src/fluence/lib/media.cr

This file was deleted.

19 changes: 11 additions & 8 deletions src/fluence/lib/page.cr
Expand Up @@ -28,23 +28,26 @@ struct Fluence::Page < Fluence::Accessible
def initialize(name : String, process : Bool = true, is_url : Bool = false)
name = Page.sanitize(name)
if is_url
@url = name
@name = @url[url_prefix.size..-1].strip "/"
url = name
name = url[url_prefix.size..-1].strip "/"
else
@name = name.strip "/"
@url = url_prefix + "/" + name
name = name.strip "/"
url = url_prefix + "/" + name
end
@path = Page.name_to_directory @name
@title = nil
path = "test"
title = nil

if process && exists?
@title, @toc, @intlinks = Page.process(@path)
title, @toc, @intlinks = Page.process(path)
else
@toc = Page::TableOfContent::Toc.new
@intlinks = Page::InternalLinks::LinkList.new
end

@title ||= File.basename @name
title ||= File.basename name

super(path, name, url, title)

@slug = Page.title_to_slug @title
end

Expand Down

0 comments on commit 180b01b

Please sign in to comment.