Custom splash page: Difference between revisions

From diaspora* project wiki
(Created page with "All you have to do is to create a <tt>app/views/home/_show.html.haml</tt> to define your own splash page for your Diaspora pod. Or <tt>app/views/home/_show.html.erb</tt> if yo...")
 
No edit summary
Line 1: Line 1:
All you have to do is to create a <tt>app/views/home/_show.html.haml</tt> to define your own splash page for your Diaspora pod. Or <tt>app/views/home/_show.html.erb</tt> if you prefer to write plain HTML instead of [http://haml-lang.com/ HAML]. Do not copy or overwrite <tt>app/views/home/show.html.haml</tt> (note the missing underscore)!
All you have to do is to create a <tt>app/views/home/_show.html.haml</tt> to define your own splash page for your Diaspora pod. Or <tt>app/views/home/_show.html.erb</tt> if you prefer to write plain HTML instead of [http://haml-lang.com/ HAML]. Do not copy or overwrite <tt>app/views/home/show.html.haml</tt> (note the missing underscore)!


A very basic example of a <tt>_show.html.haml</tt> would be something like:
A very basic example of a <tt>_show.html.haml</tt> would be something like:


<pre>
<syntaxhighlight lang="yaml">
#content
#content
   .center
   .center
     %h2 Welcome to my pod!
     %h2 Welcome to my pod!
</pre>
</syntaxhighlight>


A more complete example using the Twitter Bootstrap "Hero" template would look like the following:
A more complete example using the Twitter Bootstrap "Hero" template would look like the following:


<pre>
<syntaxhighlight lang="yaml">
.navbar.navbar-fixed-top
.navbar.navbar-fixed-top
   .navbar-inner
   .navbar-inner
Line 71: Line 72:
   %script{:src => "/js/jquery.js"}
   %script{:src => "/js/jquery.js"}
   %script{:src => "/js/bootstrap.js"}
   %script{:src => "/js/bootstrap.js"}
</pre>
</syntaxhighlight>


Diaspora already uses [http://twitter.github.com/bootstrap/ Bootstrap] CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found [https://github.com/czarneckid/twitter-bootstrap-examples-haml/tree/master/views here.] but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download [http://twitter.github.com/bootstrap/ here.])
Diaspora already uses [http://twitter.github.com/bootstrap/ Bootstrap] CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found [https://github.com/czarneckid/twitter-bootstrap-examples-haml/tree/master/views here.] but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download [http://twitter.github.com/bootstrap/ here.])
Line 81: Line 82:


[[Category:Podmin]]
[[Category:Podmin]]
[[Category:Github transfer done]]

Revision as of 13:35, 15 June 2013

All you have to do is to create a app/views/home/_show.html.haml to define your own splash page for your Diaspora pod. Or app/views/home/_show.html.erb if you prefer to write plain HTML instead of HAML. Do not copy or overwrite app/views/home/show.html.haml (note the missing underscore)!

A very basic example of a _show.html.haml would be something like:

#content
  .center
    %h2 Welcome to my pod!

A more complete example using the Twitter Bootstrap "Hero" template would look like the following:

.navbar.navbar-fixed-top
  .navbar-inner
    .container-fluid
      %a.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse"}
        %span.icon-bar
        %span.icon-bar
        %span.icon-bar
      %a.btn.btn-success.pull-left{:href => "/users/sign_in"} Login
      %a.brand{:href => "/"} Diaspora*
      .nav-collapse
        %ul.nav
          %li
            %a{:href => "/about.html"} About
          %li
            %a{:href => "/privacy.html"} Privacy
          %li
            %a{:href => "/terms.html"} Terms

  .subnav
    %ul.nav.nav-pills
      %li
        %a{:href => "https://twitter.com/joindiaspora"} @joindiaspora
      %li
        %a{:href => "https://github.com/diaspora/diaspora"} GitHub
      %li
        %a{:href => "/source.tar.gz"} Code
      %li
        %a{:href => "https://github.com/diaspora/diaspora/wiki/Changelog"} What's New?
      %li
        %a{:href => "https://goo.gl/1UR7m"} Dev-Blog

   
  .container{:style => "padding-top: 5%;"}
    .hero-unit
      %img{:alt => "Logo", :src => "/assets/branding/logo_caps.png"}/
      %hr/
      %p
        %b You're about to change the Internet. Let's get you set up, shall we?
      %p
        %a.btn.btn-primary.btn-large{:href => "/users/sign_up"} Start an account! &raquo;
    .row
      .span4
        %h2 Heading
        %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
        %p
          %a.btn{:href => "#"} View details &raquo;
      .span4
        %h2 Heading
        %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum ni.
        %p
          %a.btn{:href => "#"} View details &raquo;
      .span4
        %h2 Heading
        %p Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis.
        %p
          %a.btn{:href => "#"} View details &raquo;

  %script{:src => "/js/jquery.js"}
  %script{:src => "/js/bootstrap.js"}

Diaspora already uses Bootstrap CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found here. but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download here.)

Notice the examples above do not include the “head” & “html” elements, those are rendered by Diaspora. For your landing page you just need to provide the body section, and anything else you chose to include.

Ensure that public/ doesn’t contain any index.html or another file that would be used as index file by your Webserver. If such a file exists it’s given precedence by your Webserver and can break the log in.