Skip to content

Commit

Permalink
shortlink fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Dec 27, 2024
1 parent 92db246 commit edad969
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion script/image-export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
text += "path: #{image.path}\n"
text += "created_at: #{image.created_at.to_s(:long)}\n"
text += "---\n\n"
text += "<script>window.location.replace('.." + image.path + '");</script>';
text += "<script>window.location.replace('..#{ image.path }');</script>";
File.open(path, 'w') do |file|
file.write(text)
end
Expand Down
9 changes: 6 additions & 3 deletions script/node-export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@
if node.type.include?('redirect')
file.write(node.type.split('redirect|').last)
else
text = "---\n"\
"title: '#{node.title}'\n"\
"tagnames: '#{node.tagnames.join(', ')}'\n"\
text = "---\n"
text += 'title: "' + node.title + '"' + "\n"
text += "tagnames: '#{node.tagnames.join(', ')}'\n"\
"author: #{node.author.username}\n"\
"author: #{node.author.username}\n"\
"path: #{path.split("static").last}\n"\
"nid: #{node.nid}\n"\
"uid: #{node.uid}\n\n"\
"---\n\n"



if node.main_image
# img_path = @node.main_image.path(@node.main_image.photo_file_name == "blob" ? :original : :large)
# special case for "blob" images, see https://github.com/publiclab/plots2/issues/10210
Expand Down
2 changes: 1 addition & 1 deletion script/node-shortlink-export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"uid: #{node.uid}\n"\
"path: #{node.path}\n"
text += "---\n\n"
text += "<script>window.location.replace('.." + node.path + '");</script>';
text += "<script>window.location.replace('..#{ node.path }');</script>";

path = "public/static/n/#{node.id}.md"

Expand Down

0 comments on commit edad969

Please sign in to comment.