[Groonga-commit] ranguba/ranguba at 8770d09 [master] Add ability to add extra header in the head

Back to archive index
YUKI Hiroshi null+****@clear*****
Thu Oct 25 12:59:36 JST 2018


YUKI Hiroshi	2018-10-25 12:59:36 +0900 (Thu, 25 Oct 2018)

  Revision: 8770d09f635411da32af199a436ca9e3cd4deb17
  https://github.com/ranguba/ranguba/commit/8770d09f635411da32af199a436ca9e3cd4deb17

  Merged f0c9e79: Merge pull request #1 from piroor/add-ability-to-embed-extra-headers-in-head

  Message:
    Add ability to add extra header in the head

  Added files:
    config/customize/templates/head.txt.sample
  Modified files:
    app/views/layouts/application.html.erb
    config/customize/encodings.csv.sample
    lib/ranguba/template.rb

  Modified: app/views/layouts/application.html.erb (+1 -0)
===================================================================
--- app/views/layouts/application.html.erb    2018-10-25 12:42:17 +0900 (c09d147)
+++ app/views/layouts/application.html.erb    2018-10-25 12:59:36 +0900 (2e606df)
@@ -9,6 +9,7 @@
   <% if @canonical %>
     <link rel="canonical" href="<%= @canonical %>" />
   <% end %>
+  <%=raw @ranguba_template.head %>
 </head>
 <body>
   <div class="header">

  Modified: config/customize/encodings.csv.sample (+1 -0)
===================================================================
--- config/customize/encodings.csv.sample    2018-10-25 12:42:17 +0900 (8b5e637)
+++ config/customize/encodings.csv.sample    2018-10-25 12:59:36 +0900 (6bb77f7)
@@ -1,4 +1,5 @@
 types.csv,UTF-8
 categories.csv,Shift_JIS
+head.txt,Shift_JIS
 header.txt,Shift_JIS
 footer.txt,Shift_JIS

  Added: config/customize/templates/head.txt.sample (+1 -0) 100644
===================================================================
--- /dev/null
+++ config/customize/templates/head.txt.sample    2018-10-25 12:59:36 +0900 (da7ee42)
@@ -0,0 +1 @@
+<meta name="Author" content="Ranguba Project">

  Modified: lib/ranguba/template.rb (+6 -0)
===================================================================
--- lib/ranguba/template.rb    2018-10-25 12:42:17 +0900 (68f52d6)
+++ lib/ranguba/template.rb    2018-10-25 12:59:36 +0900 (edd59ca)
@@ -3,6 +3,7 @@ class Ranguba::Template
     @encodings = encodings || default_encodings
     @base = Ranguba::Application.config.customize_base_path + 'templates'
     @title_path = @base + 'title.txt'
+    @head_path = @base + 'head.txt'
     @header_path = @base + 'header.txt'
     @footer_path = @base + 'footer.txt'
   end
@@ -13,6 +14,10 @@ class Ranguba::Template
                                         "Ranguba")
   end
 
+  def head
+    @head ||= Ranguba::FileReader.read(@head_path, @encodings['head.txt'])
+  end
+
   def header
     @header ||= Ranguba::FileReader.read(@header_path, @encodings['header.txt'])
   end
@@ -25,6 +30,7 @@ class Ranguba::Template
   def default_encodings
     {
       'title.txt'  => Encoding::UTF_8,
+      'head.txt'  => Encoding::UTF_8,
       'header.txt' => Encoding::UTF_8,
       'footer.txt' => Encoding::UTF_8,
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181025/3e7db46c/attachment-0001.html>


More information about the Groonga-commit mailing list
Back to archive index