Portfolio: Blog Page
Mix.install([
{:kino, github: "livebook-dev/kino", override: true},
{:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
{:vega_lite, "~> 0.1.4"},
{:kino_vega_lite, "~> 0.1.1"},
{:benchee, "~> 0.1"},
{:ecto, "~> 3.7"},
{:math, "~> 0.7.0"},
{:faker, "~> 0.17.0"},
{:utils, path: "#{__DIR__}/../utils"},
{:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])
Navigation
Blog Page
You’re going to add a blog to your existing portfolio project.
Blogs should have a title, subtitle, and content.
classDiagram
class Blog {
title: :string
subtitle: :string
content: :text
}
Blog Requirements
Ensure you:
-
Add the full matrix of HTTP actions under the
"/blog"
route using eitherresources/4
or individualget/4
,post/4
andput/4
macros. -
Create a controller with the corresponding
:index
,:edit
,:show
,:new
,:create
,:update
, and:delete
actions. -
Create a view and templates for the
:index
- Create a context.
-
Create a schema for the blog post with at least the
:title
,:subtitle
, and:content
fields. - Create a migration to create a blog posts table.
Also ensure that you do not break any existing functionality. You should still be able to visit the home page on http://localhost:4000.
Outside of these requirements you may stretch your creativity. Consider spending any additional time you may have on improving the styles for the project.
You may find the mix phx.gen.html
command useful for this exercise.
Navigation
Add navigation links on both the blog and home page.
Consider adding this navigation in lib/portfolio_web/templates/layout/root.html.heex
to have the same navigation on every page and avoid duplicating code.
The navigation should include a link to the "/"
route to view the home page, and the "/blog"
route to view the blog page. Consider using Path Helpers instead of static routes.
Commit Your Progress
Run the following in your command line from the project folder to track and save your progress in a Git commit.
$ git add .
$ git commit -m "finish portfolio blog page exercise"