Make appropriate pages public

Going to be using this as a personal site.
This commit is contained in:
Trevor Vallender 2023-09-29 14:29:50 +01:00
parent 19319dba9c
commit a4cc6d1e3f
6 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class HomePagesController < ApplicationController class HomePagesController < ApplicationController
skip_before_action :require_login
def index; end def index; end
end end

View File

@ -1,10 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class MicropostsController < ApplicationController class MicropostsController < ApplicationController
skip_before_action :require_login, only: [:index, :show]
before_action :set_micropost, only: [:show] before_action :set_micropost, only: [:show]
def index def index
@microposts = helpers.current_user.microposts @microposts = Micropost.all
end end
def new def new

View File

@ -1 +1,10 @@
<h2>Hello, <%= current_user.full_name %></h2> <h2>Hello.</h2>
<p>Welcome to my site! Im a software engineer specialising in Ruby and Rails, with a love for *nix systems,
NixOS and free software in general. Im also a maker and dad, and here is where my thoughts get dumped.</p>
<h3>Find me:</h3>
<dl>
<dt>Mastodon</dt>
<dd><%= link_to "@tsvallender@ruby.social", "https://ruby.social/@tsvallender" %></dd>
</dl>

View File

@ -17,14 +17,11 @@
<% end %> <% end %>
<nav> <nav>
<ul> <ul>
<li><%= link_to t(".home"), root_path %></li>
<li><%= link_to t(".microposts"), microposts_path %></li>
<% if logged_in? %> <% if logged_in? %>
<li><%= link_to t(".home"), root_path %></li>
<li><%= link_to t(".microposts"), microposts_path %></li>
<li><%= link_to t(".profile"), user_path(current_user) %></li> <li><%= link_to t(".profile"), user_path(current_user) %></li>
<li><%= link_to t(".log_out"), log_out_path, data: { turbo_method: :delete } %></li> <li><%= link_to t(".log_out"), log_out_path, data: { turbo_method: :delete } %></li>
<% else %>
<li><%= link_to t(".log_in"), new_session_path %></li>
<li><%= link_to t(".register"), new_user_path %></li>
<% end %> <% end %>
</ul> </ul>
</nav> </nav>

View File

@ -1,6 +1,6 @@
<h2><%= t(".microposts") %></h2> <h2><%= t(".microposts") %></h2>
<%= link_to t(".new"), new_micropost_path %> <%= link_to t(".new"), new_micropost_path if logged_in? %>
<% if @microposts.empty? %> <% if @microposts.empty? %>
<p><%= t(".empty") %></p> <p><%= t(".empty") %></p>

View File

@ -4,6 +4,9 @@ image: tsvallender/soc
traefik: traefik:
host_port: 8000 host_port: 8000
args:
entryPoints.web.address: ':80'
entryPoints.web.forwardedHeaders.trustedIPs: 0.0.0.0/0
servers: servers:
- tsvallender.co.uk - tsvallender.co.uk